I’m working on an automation that will turn on the bathroom fan (right now its just set up to send a notification for testing, but eventually the action will be to turn on a switch) once a certain humidity is reached. The code below works, but my issue is that after the delay is up, the automation does not trigger again if the humidity is still above the threshold.
Does the humidity have to go below the threshold, and then above again to get a second trigger? The idea is to get the automation to continually make sure the fan is turned on until the humidity is below the threshold. Thanks
alias: Auto Fan Power
trigger:
- platform: template
value_template: '{{ states.sensor.bathroom_humidity.state | int > 40 }}'
action:
- service: notify.pushover
data:
message: Someone is in shower? Humidity at {{states('sensor.bathroom_humidity')}}
- delay: '00:01:59'
- service: notify.pushover
data:
message: It has been 2 minutes, humidity is at {{states('sensor.bathroom_humidity')}}