From 2ea97ac300ad53e68a850aa88b0191305e98eb02 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Wed, 22 Nov 2023 20:23:58 -0500 Subject: [PATCH] Use while loop for pir_holdtime Ensures that the time keeps extending as long as the sensor is firing. --- supersensor.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/supersensor.yaml b/supersensor.yaml index 69388a8..53229f1 100644 --- a/supersensor.yaml +++ b/supersensor.yaml @@ -74,7 +74,11 @@ script: then: - lambda: |- id(pir_motion).publish_state(true); - - delay: ${pir_holdtime} + - while: + condition: + binary_sensor.is_on: pir_gpio + then: + - delay: ${pir_holdtime} - lambda: |- id(pir_motion).publish_state(false);