lys kontor

This commit is contained in:
2026-03-15 15:35:29 +01:00
parent fae90550ca
commit 9baac7742f
+37
View File
@@ -0,0 +1,37 @@
- alias: Kontor lys motion
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.kontor_motion_bevaegelse
to: "on"
variables:
timeout: >
{% if now().hour >= 6 and now().hour < 22 %}
{{ states('input_number.kontor_timeout_day') | int }}
{% else %}
{{ states('input_number.kontor_timeout_night') | int }}
{% endif %}
action:
- service: scene.turn_on
target:
entity_id: scene.kontor_klar
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.kontor_motion_bevaegelse
to: "off"
- delay:
minutes: "{{ timeout }}"
- condition: state
entity_id: binary_sensor.kontor_motion_bevaegelse
state: "off"
- service: light.turn_off
target:
entity_id: light.strip