@henaa wrote:
Hi i have radio
when i try to change speaker the result the music stop to play and no change to another speker
what the problem ?
Automation:
- action: - service: script.radio_start alias: Radio Channel Change condition: - condition: state entity_id: input_boolean.radio_play state: 'on' id: radio_channel_change trigger: - entity_id: input_select.radio_station platform: state - action: - service: script.radio_change_speakers data_template: previous_speakers: '{{ trigger.from_state.state }}' alias: Radio Speaker Change condition: - condition: state entity_id: input_boolean.radio_play state: 'on' id: radio_speaker_change trigger: - entity_id: input_select.radio_speakers platform: state
scripts:
radio_change_speakers: alias: Change Radio Speakers sequence: - service: media_player.media_stop data_template: entity_id: > {% if previous_speakers == "Livingroom" %} media_player.livingroom_speaker {% elif previous_speakers == "Kitchen" %} media_player.kitchen_speaker {% elif previous_speakers == "Bedroom" %} media_player.bedroom_speaker {% elif previous_speakers == "Everywhere" %} media_player.home_group {% endif %} - service: input_boolean.turn_off entity_id: input_boolean.radio_play
Posts: 1
Participants: 1