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: