diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2024-06-13 05:41:46 +0400 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2024-06-13 05:41:46 +0400 |
commit | 6ff83b7acca705bbeca565783eb9c14129118f81 (patch) | |
tree | daeef3b24cd3fcdfea74c86c0a70e62762eba2c2 /blueprints | |
parent | cc45b7a670931c077514ca8f4daeb87d62f659d9 (diff) | |
download | hass-6ff83b7acca705bbeca565783eb9c14129118f81.tar.gz hass-6ff83b7acca705bbeca565783eb9c14129118f81.tar.bz2 hass-6ff83b7acca705bbeca565783eb9c14129118f81.tar.xz hass-6ff83b7acca705bbeca565783eb9c14129118f81.zip |
Allow some delay for Aqara sensors to propogate luminance after motion started (in motion_switch blueprint). Use luminance of presence sensor in kitchen automation
Diffstat (limited to 'blueprints')
-rw-r--r-- | blueprints/automation/motion/motion_switch.yaml | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/blueprints/automation/motion/motion_switch.yaml b/blueprints/automation/motion/motion_switch.yaml index 67e62b6..dd4111e 100644 --- a/blueprints/automation/motion/motion_switch.yaml +++ b/blueprints/automation/motion/motion_switch.yaml @@ -188,8 +188,9 @@ action: conditions: - condition: template value_template: '{{ test == "sensor" }}' - - condition: template - value_template: '{{ (states(illuminance_entity) | float) < lux_threshold }}' +# This will be checked inside to allow short wait +# - condition: template +# value_template: '{{ (states(illuminance_entity) | float) < lux_threshold }}' - condition: and conditions: - condition: template @@ -224,6 +225,17 @@ action: seconds: 2 continue_on_timeout: false +# On motion sensors, illuminance is updated only on motion. We need to give some time to propagate + - if: + - condition: template + value_template: '{{ test == "sensor" }}' + - condition: template + value_template: '{{ (states(illuminance_entity) | float) >= lux_threshold }}' + then: + - wait_template: '{{ (states(illuminance_entity) | float) < lux_threshold }}' + timeout: '00:00:02' # Timeout after 1 minute + continue_on_timeout: false + - choose: [] default: !input "on_click" - service: switch.turn_on |