Use while loop for pir_holdtime
Ensures that the time keeps extending as long as the sensor is firing.
This commit is contained in:
		@@ -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);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user