Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95459

Radio - change speakers

$
0
0

@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 ?
image

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

Read full topic


Viewing all articles
Browse latest Browse all 95459

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>