I'm trying to automate my bathroom humidity sensors to do the following:
2 devices
Bathroom humidity sensor
Lounge humidity sensor
I'm trying to do the following:
When bathroom humidity sensor senses 20% more humidity than the lounge humidity sensor I want to turn on the bathroom exhaust fan, then turn off once the humidity level in the bathroom is less than 20% plus 5 minutes just to be sure the humidity level is down to a normal level.
A couple of issue I see.
First your trigger is correct but remember the rule will trigger every time the evaluation is true. So once the humidity is 20% above the reference sensor every increase in that sensor will trigger the rule again. SO your rule will keep sending on commands to your fan. won't hurt anything really but a lot of unnecessary traffic.
You can stop that by using the private boolean. Set your trigger to a conditional trigger that will only trigger when the private boolean is true. The first action of your rule would be to set the private boolean False, and the last action to set it back true.
The second issue I see is your wait. You are using a timeout. That means that the action will wait for the evaluation to be true, but only for 5 minutes. So no matter what the value of the sensor, the wait will timeout in 5 minutes. I think you want to use the and stays option.
All that being said I believe there is a app in HPM for this, you might want to check that out.
Ignore the thermostat. Large bathroom, insufficient fan so I also turn on the furnace fan to help distribute the moisture. The fan is in an enclosed space with the toilet so there is an auto off/resume for that.
Your rule sets the fan to turn after 5 minutes of run time. RM will have to keep checking the humidity difference every time one the sensors changes.
Suggestions
Use two triggers, one for the bathroom humidity increasing and the other for the lounge humidity decreasing. Even though RM will be calculating the difference each time, this should cut the number of calculations in half, only when the difference is increasing.
Then wrap your rule in this conditional:
IF (Bathroom Humidity >= Lounge Humidity + 20 AND Fan is Off )THEN your current rule
ENDIF
Use the same Fan is Off as a Conditional for the triggers. This makes the current state easier to see than using Private Booleans.
Repeating the trigger conditional in the rule makes the rule act the same if you run it in the RM editor.
You may want to use Hub Variables for the humidity difference (20) and the off delay (5) so you can experiment with different settings until it's the way you want it to operate. Then hard code the values and delete the Hub Variables.
I agree. I used Ernie Miller's app for some time but switched over to @jtp10181's forked app because it included the means to use a second humidity sensor to compare as a baseline, which I believe is what the OP is looking for.
Here is a screenshot of the rule I wrote for a cause very similar to yours. It works fine with no issues. Sorry for the phone screenshot but I am not around my PC
I like that. I've added it to my rule. (Which has worked perfectly for several years.) I'm going to run it with that enabled to compare the activity level in the logs with and without the condition.
Edit: see post 13. I ended up using and then removing the fan off condition.
I kinda do like Bill except I use the furnace fan when the outside temp is colder so I don't have the exhaust fan pulling cold outdoor air in the house.
You will see all the triggers in the log, but the ones when the fan is on will say that the trigger was inhibited (not the right phrase but something like it)
Turns out this doesn't work for my application. My bathroom fan is in the WC. It is set to auto off in ten minutes. For my application I start the HVAC fan when the bathroom humidity increase by x over another humidity sensor. If the bathroom fan is already on the HVAC fan doesn't start until the ten minutes time finishes which turns off the fan, meets the condition and then starts the rule and fan. It has been working well for a few years without the fan off condition.
I use to play around with humidity and good results were a PITA to achieve consistently, I now have the bathroom light stays on for x as the trigger, this eliminates false triggers from w/c only traffic.
I also have another seperate rule if the fan hasn’t ran for 3 hrs to run the fan for 20 mins to keep the bathrooms from going musty / mouldy.