Need help with a rule

I want to create a Rule that if Humidity is between 1 and 48, the "Office Fountain" is off, otherwise I need it to turn on until the humidity falls within that 1~48 range and then turn off. I would also need it to check every hour for the humidity level.

This is for a dehumidifier we have in the crawlspace, and the "Office Fountain" is a Wifi Switch.

This is what I have so far and I cant get it to work.
As you can see, the Sensor is at 52 and the switch does not come on.

Thank you

you need to post logs.. and turn on logging on the rule as i dont see anything about it being off or on.

that said it is not good to constantly turn them on or off as they can burn out.. that is why they put lockouts in them.. i would do a rule like this to avoid ping ponging.

trigger :humidity changed

if humitidy >= 48
switch on
else if humidity < =45
switch off
end if

So dumb question, but your trigger is a humidity change - I realize that the current reading is 52, but has it changed?

Also, agree with @kahn-hubitat, you need to build in hysteresis like all "stats" have so that it doesn't rapidly turn on/off.

Here's a humidistat that I built with some help from the community a year or 2 ago. You can ignore the top If statement - it just makes sure that the humidifier doesn't turn on if the heat isn't on:

Your rule as written will skip both ON and OFF if humidity is 0% (something that will probably never happen). You also need hysteresis to prevent rapid on/off switching of your fountain.

Here's how I would rewrite this:
TRIGGER:
Humidity of Water sensor reports < 47
ACTIONS:
Off: Office Fountain
Wait for event: Humidity of Water sensor reports > 52
On: Office Fountain

If you want it to check at least every hour, setup on your humidity device page to report every 60 minutes.

OR you could change the trigger to "Periodic" and set to every "0" minutes. Then the rule will check the humidity at the top of every hour (12:00, 1:00, 2:00, etc.) and set the switch accordingly.

There are some other minor issues with your conditions, but changing the trigger will make this rule run reliably for humidity levels from 1-100% and the minimum cycle time will be one hour. No need for hysteresis. A slight change to your conditions cleans it up even further...

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.