From cea46f911a1683cb2335f8a37bd1e9892b28f5b2 Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Tue, 7 Apr 2026 19:44:15 +0200 Subject: [PATCH] Adjust living room light automation for TV evenings --- include/automations/lys_stue.yaml | 50 ++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/include/automations/lys_stue.yaml b/include/automations/lys_stue.yaml index 475750f..f5abdb2 100644 --- a/include/automations/lys_stue.yaml +++ b/include/automations/lys_stue.yaml @@ -64,7 +64,7 @@ entity_id: light.livingroom - id: stue_motion_sluk_eftermiddag_aften - alias: Sluk stue lys efter 120 min uden bevægelse mellem 16 og 22 + alias: Sluk stue lys efter 120 min uden bevægelse mellem 16 og 19 mode: restart trigger: @@ -75,7 +75,7 @@ condition: - condition: time after: "16:00:00" - before: "22:00:00" + before: "19:00:00" action: - wait_for_trigger: @@ -91,6 +91,43 @@ target: entity_id: light.livingroom +- id: stue_motion_sluk_aften_tv + alias: Sluk stue lys efter 10 min uden bevægelse når TV er slukket mellem 19 og 00 + mode: restart + + trigger: + - platform: state + entity_id: binary_sensor.stue_bevaegelse + to: "off" + - platform: state + entity_id: media_player.samsung_s95ca_55_3 + to: "off" + + condition: + - condition: time + after: "19:00:00" + before: "00:00:00" + + action: + - condition: state + entity_id: media_player.samsung_s95ca_55_3 + state: "off" + - wait_for_trigger: + - platform: state + entity_id: binary_sensor.stue_bevaegelse + to: "on" + timeout: "00:10:00" + continue_on_timeout: true + - condition: state + entity_id: binary_sensor.stue_bevaegelse + state: "off" + - condition: state + entity_id: media_player.samsung_s95ca_55_3 + state: "off" + - service: light.turn_off + target: + entity_id: light.livingroom + - id: stue_motion_sluk_nat alias: Sluk stue lys efter 30 min uden bevægelse om natten mode: restart @@ -101,12 +138,9 @@ to: "off" condition: - - condition: or - conditions: - - condition: time - before: "06:00:00" - - condition: time - after: "22:00:00" + - condition: time + after: "00:00:00" + before: "06:00:00" action: - wait_for_trigger: