Hi all!
Maybe this is a very basic question… what I just can’t figure out how to solve it.
I have this Radio panel with the On/Off switch. The problem, is that for some reason I can’t understand, the switch is showing twice instead of just in the body. How can I solve this?
This is my code:
group:
Residence Radio:
name: Residentie Radio
entities:
- input_select.radio_station
- input_select.chromecast_radio
- script.radio
- input_number.volume_radio
- input_boolean.alarm_clock
input_select:
radio_station:
name: 'Select Radio Station:'
options:
- Flaixbac
- RAC1
- Vaughan
- Catalunya Radio
- LOS40
- EUROPA FM
- KISS FM
- Radio Art - Sleep
- Ambi Nature Radio
- Calm Radio - Sleep
- Dinamo.FM Sleep
initial: Flaixbac
icon: mdi:radio
chromecast_radio:
name: 'Select Speakers:'
options:
- Livingroom
- Bedroom
- Multiroom
initial: Multiroom
icon: mdi:speaker-wireless
put_number:
volume_radio:
name: Volume
icon: mdi:volume-high
min: 0
max: 1
step: 0.05
input_boolean:
alarm_clock:
name: On/Off
initial: off
icon: mdi:toggle-switch
automation:
- alias: Listen Radio
hide_entity: True
trigger:
- platform: state
entity_id: input_select.radio_station
action:
- service: script.radio
- alias: Set Chromecast Radio Volume
trigger:
platform: state
entity_id: input_number.volume_radio
action:
service: media_player.volume_set
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio", "Multiroom") %} media_player.multiroom
{% elif is_state("input_select.chromecast_radio", "Bedroom") %} media_player.bathroom_speaker
{% elif is_state("input_select.chromecast_radio", "Livingroom") %} media_player.living_room_speaker
{% endif %}
volume_level: '{{ states.input_number.volume_radio.state }}'
- alias: Stop Streaming Radio
trigger:
- platform: state
entity_id: input_boolean.alarm_clock
to: "None"
action:
service: media_player.media_stop
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio", "Multiroom") %} media_player.multiroom
{% elif is_state("input_select.chromecast_radio", "Bedroom") %} media_player.bathroom_speaker
{% elif is_state("input_select.chromecast_radio", "Livingroom") %} media_player.living_room_speaker
{% endif %}