homeassistant-config/automations/esszimmerradio_an_aus.yaml

137 lines
3.5 KiB
YAML

# ------ Einschalten ---------------
- alias: EsszimmerRadio Oben an
trigger:
# Switch on when pushing play or power
- platform: event
event_type: ir_command_received
event_data:
button_name: key_play
repeat_counter: 0
host: esszimmerradio.fritz.box
- platform: event
event_type: ir_command_received
event_data:
button_name: key_power
repeat_counter: 0
host: esszimmerradio.fritz.box
# Switch on when pressing any number button
- platform: event
event_type: ir_command_received
event_data:
button_name: btn_1
repeat_counter: 0
host: esszimmerradio.fritz.box
- platform: event
event_type: ir_command_received
event_data:
button_name: btn_2
repeat_counter: 0
host: esszimmerradio.fritz.box
- platform: event
event_type: ir_command_received
event_data:
button_name: btn_3
repeat_counter: 0
host: esszimmerradio.fritz.box
- platform: event
event_type: ir_command_received
event_data:
button_name: btn_4
repeat_counter: 0
host: esszimmerradio.fritz.box
- platform: event
event_type: ir_command_received
event_data:
button_name: btn_5
repeat_counter: 0
host: esszimmerradio.fritz.box
- platform: event
event_type: ir_command_received
event_data:
button_name: btn_6
repeat_counter: 0
host: esszimmerradio.fritz.box
- platform: event
event_type: ir_command_received
event_data:
button_name: btn_7
repeat_counter: 0
host: esszimmerradio.fritz.box
- platform: event
event_type: ir_command_received
event_data:
button_name: btn_8
repeat_counter: 0
host: esszimmerradio.fritz.box
- platform: event
event_type: ir_command_received
event_data:
button_name: btn_9
repeat_counter: 0
host: esszimmerradio.fritz.box
action:
service: switch.turn_on
data:
entity_id: switch.esszimmer_oben_radio_steckdose1
# ------ Ausschalten ---------------
- alias: EsszimmerRadio Oben aus
trigger:
# Switch off when pushing goto or pause
- platform: event
event_type: ir_command_received
event_data:
button_name: key_goto
repeat_counter: 0
host: esszimmerradio.fritz.box
- platform: event
event_type: ir_command_received
event_data:
button_name: key_pause
repeat_counter: 0
host: esszimmerradio.fritz.box
action:
- service: switch.turn_off
data:
entity_id: switch.esszimmer_oben_radio_steckdose1
- service: media_player.media_stop
data:
entity_id: media_player.esszimmer
- alias: Radio Stop
trigger:
- platform: event
event_type: ir_command_received
event_data:
button_name: key_stop
repeat_counter: 0
host: esszimmerradio.fritz.box
- platform: event
event_type: ir_command_received
event_data:
button_name: key_pause
repeat_counter: 0
host: esszimmerradio.fritz.box
action:
service: media_player.media_pause
data:
entity_id: media_player.esszimmer
# ------ Squeezelite neustart ---------------
- alias: EsszimmerRadio oben squeezelite neustart
trigger:
- platform: event
event_type: ir_command_received
event_data:
button_name: key_record
repeat_counter: 0
host: esszimmerradio.fritz.box
action:
service: sysdweb.restart
data:
hostname: esszimmerradio.fritz.box
service_name: squeezelite