From 76d8721a7c28565a5b50ed43c923037a2877ce09 Mon Sep 17 00:00:00 2001 From: mike Date: Tue, 2 Jan 2024 01:58:22 -0800 Subject: [PATCH] When enabled helper goes OFF, reset the countdown timer --- mikes-motion-activated-scenes.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mikes-motion-activated-scenes.yaml b/mikes-motion-activated-scenes.yaml index efb2627..5f045f8 100644 --- a/mikes-motion-activated-scenes.yaml +++ b/mikes-motion-activated-scenes.yaml @@ -128,7 +128,7 @@ blueprint: When activating a scene, try this many times in a row. This is sometimes useful when the network seems buggy or laggy, or for certain lights that fail to correctly apply brightness/color when first turning on. - + default: 1 selector: number: @@ -309,6 +309,14 @@ action: name: "Debug: Disabled scene" message: "Disabled scene is currently set to: {{ disabled_scene }}" + # If the enabled helper is OFF, we should start by resetting + # the countdown timer to default + - alias: "Reset countdown timer when enabled helper is switched OFF." + service: input_number.set_value + data: + entity_id: !input delay_seconds_helper + value: "{{ delay_seconds_default }}" + # In "auto" mode, activate the ON or OFF scene based on whether motion is currently detected # Also use "auto" mode if motion activation is ENABLED. - alias: "auto mode: Activate ON scene, if motion is currently detected, otherwise activate the OFF scene"