Use while loop for pir_holdtime
Ensures that the time keeps extending as long as the sensor is firing.
This commit is contained in:
parent
4c04042aeb
commit
2ea97ac300
@ -74,7 +74,11 @@ script:
|
|||||||
then:
|
then:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
id(pir_motion).publish_state(true);
|
id(pir_motion).publish_state(true);
|
||||||
- delay: ${pir_holdtime}
|
- while:
|
||||||
|
condition:
|
||||||
|
binary_sensor.is_on: pir_gpio
|
||||||
|
then:
|
||||||
|
- delay: ${pir_holdtime}
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
id(pir_motion).publish_state(false);
|
id(pir_motion).publish_state(false);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user