From 5b4f8b09e8ad9a13b44f8df2f395908eb3bfd51a Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Sun, 15 Mar 2026 15:23:47 +0100 Subject: [PATCH] =?UTF-8?q?T=C3=A6nd=20lys=20n=C3=A5r=20andreas=20kommer?= =?UTF-8?q?=20hjem=20og=20det=20er=20m=C3=B8rkt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../andreas_kommer_hjem_taend_lys.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 include/automations/andreas_kommer_hjem_taend_lys.yaml diff --git a/include/automations/andreas_kommer_hjem_taend_lys.yaml b/include/automations/andreas_kommer_hjem_taend_lys.yaml new file mode 100644 index 0000000..9bfe61e --- /dev/null +++ b/include/automations/andreas_kommer_hjem_taend_lys.yaml @@ -0,0 +1,53 @@ +- id: andreas_arrival_lights_pro + alias: Andreas hjem - udelys (pro) + description: Tænder udelys ved hjemkomst i mørke/tusmørke og slukker igen efter 10 min + mode: restart + + trigger: + - platform: state + entity_id: person.andreas_schusler_dethlefsen + from: "not_home" + to: "home" + for: "00:00:15" + + condition: + # Andreas skal have været væk lidt tid + - condition: state + entity_id: person.andreas_schusler_dethlefsen + state: "home" + + # Lux skal være lav + - condition: numeric_state + entity_id: sensor.indkorsel_sensor_illuminance + below: 120 + + # Solen skal være lav (backup hvis lux sensor er upålidelig) + - condition: numeric_state + entity_id: sun.sun + attribute: elevation + below: 4 + + action: + - variables: + lights: + - light.indkorsel_2 + - light.extended_color_light_1 + - light.garage + + lights_to_turn_on: > + {{ lights | select('is_state','off') | list }} + + - choose: + - conditions: "{{ lights_to_turn_on | length > 0 }}" + sequence: + + - service: light.turn_on + target: + entity_id: "{{ lights_to_turn_on }}" + + - delay: "00:10:00" + + - service: light.turn_off + target: + entity_id: "{{ lights_to_turn_on }}" +