WIP dual motion not working

This commit is contained in:
2024-11-04 21:04:22 +01:00
parent c2f023d80c
commit 437553f5ec
4 changed files with 164 additions and 38 deletions

View File

@@ -36,13 +36,35 @@ blueprint:
no_motion_wait:
name: Wait time
description: Time to leave the light on after last motion is detected.
default: 120
default: 30
selector:
number:
min: 0
max: 3600
min: 10
max: 120
unit_of_measurement: seconds
trigger_variables:
use_sun: !input sun_condition
# local_condition:
# mode: single
# sequence:
# - choose:
# - conditions:
# - condition: template
# value_template: "{{ use_sun }}"
# sequence:
# data: >
# - condition: sun
# after: sunset
# after_offset: "-01:00:00"
# before: sunrise
# before_offset: "+01:00:00"
# - conditions:
# - condition: template
# value_template: "{{ not use_sun }}"
# sequence:
# data: []
# If motion is detected within the delay,
# we restart the script.
mode: restart
@@ -58,13 +80,16 @@ triggers:
from: "off"
to: "on"
# {% if states( use_sun ) %}
conditions:
# {% if %}
- condition: sun
after: sunset
after_offset: "-01:00:00"
before: sunrise
before_offset: "+01:00:00"
# {% endif %}
# conditions: "{{ local_conditions }}"
actions:
- alias: "Turn on the light"