diff --git a/automation/media/tv.yaml b/automation/media/tv.yaml index f9a8de0..c7765d8 100644 --- a/automation/media/tv.yaml +++ b/automation/media/tv.yaml @@ -46,7 +46,7 @@ - service: script.close_covers_for_tv - wait_for_trigger: platform: state - entity_id: switch.sonos_playbar + entity_id: switch.tv_media from: "on" to: "off" - service: script.open_covers_for_tv diff --git a/includes/scripts.yaml b/includes/scripts.yaml index 0b7fe7a..18862b4 100644 --- a/includes/scripts.yaml +++ b/includes/scripts.yaml @@ -345,12 +345,24 @@ apple_tv_sleep: target: entity_id: media_player.wohnzimmer -turn_on_tv: +turn_tv_and_playbar: sequence: - service: switch.turn_on data: entity_id: - switch.sonos_playbar + - service: script.turn_on_tv + +turn_off_tv_and_playbar: + sequence: + - service: switch.turn_off + data: + entity_id: + - switch.sonos_playbar + - service: script.turn_off_tv + +turn_on_tv: + sequence: - service: remote.send_command data: entity_id: remote.wohnzimmer @@ -359,10 +371,6 @@ turn_on_tv: turn_off_tv: sequence: - - service: switch.turn_off - data: - entity_id: - - switch.sonos_playbar - service: script.apple_tv_sleep toggle_speaker_and_light_childroom: diff --git a/includes/switch.yaml b/includes/switch.yaml index 14fdcd8..85b14d3 100644 --- a/includes/switch.yaml +++ b/includes/switch.yaml @@ -20,7 +20,12 @@ service: vacuum.return_to_base entity_id: vacuum.vacuum_cleaner tv_media: - value_template: "{{ is_state('switch.sonos_playbar', 'on')}}" + value_template: "{{ is_state('switch.tv', 'on')}}" + turn_on: + service: script.turn_on_tv_and_playbar + turn_off: + service: script.turn_off_tv_and_playbar + tv: turn_on: service: script.turn_on_tv turn_off: