Tænd lys når andreas kommer hjem og det er mørkt

This commit is contained in:
2026-03-15 15:23:47 +01:00
parent 532611f6f9
commit 5b4f8b09e8
@@ -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 }}"