Copy state of a input select

Hi.
I am trying to save the state of an input_select in another identical input _select.

This is what i tried.
I know it is wrong but i hope this will give a hint of what i want to do.

Here is my input_selects:

input_select:
  webradio:
    name: Webradio
    options:
     - Inget spelas
     - Bandit Rock
     - Guldkanalen
     - Guldkanalen 80-tal
     - Guldkanalen 90-tal
     - Lugna Favoriter
     - Mix Megapol
     - NRJ
     - Rix FM
     - Rockklassiker
    initial: Inget spelas
    icon: mdi:radio  

  resume_webradio:
    name: Kanal som spelas vid avlarmning / Channel that will be played when alarm is turned off
    options:
     - Inget spelas
     - Bandit Rock
     - Guldkanalen
     - Guldkanalen 80-tal
     - Guldkanalen 90-tal
     - Lugna Favoriter
     - Mix Megapol
     - NRJ
     - Rix FM
     - Rockklassiker
    initial: Inget spelas
    icon: mdi:radio

Here is the script.

#  resume_radio:
#    alias: Resume Webradio
#    sequence:
#      - service: input_select.select_option
#        data_template:
#        entity_id: input_select.resume_webradio
#        data_template: >
#          {% if states('input_select.webradio', 'Bandit Rock') %} 'Bandit Rock'
#          {% elif states('input_select.webradio', 'Guldkanalen') %} 'Guldkanalen'
#          {% elif states('input_select.webradio', 'Guldkanalen 80-tal') %} 'Guldkanalen 80-tal'
#          {% elif states('input_select.webradio', 'Guldkanalen 90-tal') %} 'Guldkanalen 90-tal'
#          {% elif states('input_select.webradio', 'Lugna Favoriter') %} 'Lugna Favoriter'
#          {% elif states('input_select.webradio', 'Mix Megapol') %} 'Mix Megapol'
#          {% elif states('input_select.webradio', 'NRJ') %} 'NRJ'
#          {% elif states('input_select.webradio', 'Rix FM') %} 'Rix FM'
#          {% elif states('input_select.webradio', 'Rockklassiker') %} 'Rockklassiker'
#          {% endif %}

What i want to do here is to launch the scprit when i arm my alarm and “move” the radio channel to the other input_select

It’s much simpler than that:

script:
  resume_radio:
    alias: Resume Webradio
    sequence:
      - service: input_select.select_option
        data_template:
          entity_id: input_select.resume_webradio
          option: '{{ states.input_select.webradio.state }}'
3 Likes

Thank you so much.
Sometimes it is simlpe. =)