Files
N22/include/automations/andreas_kommer_hjem_taend_lys.yaml
claus d0e3a6c3e5 Indkørsel: erstat Hue plug med Zigbee stik_indkorsel
- grupper.yaml: fjern light.indkorsel_plug fra Indkørsel og Udendørslamper grupper
- lysindkorsel.yaml: tilføj switch.stik_indkorsel turn_on/off ved alle 6 handlinger
- presence_simulation.yaml: tilføj switch.stik_indkorsel i morgen/aften sekvenser
- andreas_kommer_hjem: tilføj switch.stik_indkorsel turn_on/off
2026-05-17 11:14:38 +02:00

65 lines
1.7 KiB
YAML

- 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: >
{% set base = ['light.indkorsel_2', 'light.garage'] %}
{% if now().isocalendar()[1] >= 42 or now().isocalendar()[1] <= 8 %}
{{ (base + ['light.extended_color_light_1']) | list }}
{% else %}
{{ base }}
{% endif %}
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 }}"
- service: switch.turn_on
data:
entity_id: switch.stik_indkorsel
- delay: "00:10:00"
- service: light.turn_off
target:
entity_id: "{{ lights_to_turn_on }}"
- service: switch.turn_off
data:
entity_id: switch.stik_indkorsel