update tv sync automation

This commit is contained in:
Georgi Gardev
2023-11-06 16:45:23 +02:00
parent 566ccd3699
commit 75f93ba7d6

View File

@@ -93,21 +93,11 @@ automation:
trigger:
platform: state
entity_id: media_player.living_room_tv
to: "off"
condition: "{{ not is_state('media_player.nvidia_shield', 'off') }}"
action:
- choose:
- conditions: "{{ trigger.to_state.state == 'off' and not is_state('media_player.nvidia_shield', 'off') }}"
sequence:
- service: media_player.turn_off
entity_id: media_player.nvidia_shield
- conditions: "{{ trigger.to_state.state == 'on' }}"
sequence:
- service: media_player.turn_on
entity_id: media_player.nvidia_shield
- service: logbook.log
data_template:
name: "📺 Media Module · "
message: "Sync TV state · Turning Shield {{ trigger.to_state.state }} - TV is {{ trigger.to_state.state }} ··"
domain: media_player
- service: media_player.turn_off
entity_id: media_player.nvidia_shield
- alias: TV · State · Sync Shield state
trigger: