From 25d502281330ec05f6cbf44bd041633e1546eedf Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Wed, 27 Apr 2022 23:42:10 +0200 Subject: [PATCH] Update bedroom motion to not turn on lights when watching tv --- configuration/automations/bedroom-motion.yaml | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/configuration/automations/bedroom-motion.yaml b/configuration/automations/bedroom-motion.yaml index 1b7fc0a..6aade30 100644 --- a/configuration/automations/bedroom-motion.yaml +++ b/configuration/automations/bedroom-motion.yaml @@ -14,7 +14,26 @@ entity_id: input_select.home_mode state: Day action: - - service: script.bedroom_lights_on + - choose: + - conditions: + - condition: state + entity_id: media_player.bedroom_tv + state: 'on' + sequence: + - choose: + - conditions: + - condition: state + entity_id: sensor.bedroom_tv_media_input_source + state: HDMI2 + - condition: not + conditions: + - condition: state + entity_id: media_player.bedroom_atv + state: playing + sequence: + - service: script.bedroom_lights_on + default: + - service: script.bedroom_lights_on - id: bedroom-motion-off alias: '[Bedroom] Motion Off'