From cef398831e0889685fbe930b1c093ec9a82f1c49 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sun, 26 Jul 2020 12:18:08 +0300 Subject: [PATCH] Automatically switch to TV when casting --- config/packages/devices/living_room/tv.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/config/packages/devices/living_room/tv.yaml b/config/packages/devices/living_room/tv.yaml index fe63450..5cb7fde 100644 --- a/config/packages/devices/living_room/tv.yaml +++ b/config/packages/devices/living_room/tv.yaml @@ -149,7 +149,6 @@ automation: message: "Sync TV state · Turning TV on - Shield is on" domain: media_player - - alias: TV · State · Sync on Shield off trigger: platform: state @@ -167,6 +166,16 @@ automation: message: "Sync TV state · Turning TV off - Shield is off" domain: media_player + - alias: TV · Sonos join TV on Google Cast + trigger: + platform: state + entity_id: media_player.nvidia_shield + condition: + - condition: template + value_template: "{{ state_attr('media_player.nvidia_shield', 'source') == 'Google Cast' }}" + action: + - service: script.sonos_join_tv + homeassistant: customize: media_player.living_room_tv: