I cannot figure out why the following automation is not working. I have restarted HA several times and ensured the ranges drop below to reset accordingly. What am I doing wrong?
id: "1732760906762"
alias: Main Dehum
description: Turn on dehum when above 50% humidity for 10 minutes, off below 48%
triggers:
- entity_id:
- sensor.i_9psl_humidity
for:
minutes: 10
above: 50
id: "on"
trigger: numeric_state
- entity_id:
- sensor.i_9psl_humidity
for:
minutes: 10
below: 48
id: "off"
trigger: numeric_state
actions:
- target:
entity_id: switch.attic_esp32_dehum_main
action: switch.turn_{{ trigger.id }}
mode: single
I am guessing, but at anytime you were testing, did the humidity pass thru 50% or 48% and stay there for 10 minutes? It actually has to have data points on both sides of the trigger point you set.
The problem as ever is you are triggering above a certain value, this will only trigger when the value changes from below to above. If it is already above it will never trigger.
You need to trigger on a numeric state change (with no values) then use condition for the humidity value.
It wont, if the humidity is above 50 when you restart HA it will not run. If the lights are on when HA restarts and the humdity is less 20 the lights will stay on. If your sensor becomes unavailable whilst the threshold is past in either direction the automation will not trigger. But hey if you insist on doing it that way feel free.
It creates a climate entity that, once set to a desired humidity level, will automatically turn the dehumidifier on/off to maintain the desired humidity.