I have an input_select.sonos which holds my radio stations:
options: None,.977 80’s Hits,Ambi Nature Radio (Sleep, Relaxation & Meditation),Gary Stadler,GotRadio Folklore,Nirvana Meditation Radio,Relax Zone,SomaFM: ThistleRadio
friendly_name: Sonos
icon: mdi:radio
I choose an option from the list and my sonos change the station… that is ok!
Now I want to add an automation that must cycle on the stations:
- id: cube_bianco_change_radio
alias: "MiCube2 Shake - Sono Cambia Radio"
initial_state: 'on'
trigger:
platform: event
event_type: cube_action
event_data:
entity_id: binary_sensor.cube_158d00010fce06
action_type: shake_air
action:
- service: input_select.select_option
data_template:
entity_id: input_select.sonos
option: >
{% if is_state("input_select.select_option","GotRadio Folklore") %}
Gary Stadler
{% elif is_state("input_select.select_option","Nirvana Meditation Radio") %}
GotRadio Folklore
{% else %}
Ambi Nature Radio (Sleep, Relaxation & Meditation)
{% endif %}
The automation starts but alway fallback to else statement : “Ambi Nature…”
What I am doing wrong?
Thanks