Newb needs RM Advice

New to Hubitat, Loving it so far. Working on my first complex rule. I have a kids bathroom i want to make sure they fan turns on if they are showering, and off when humidity drops. I am in high desert mountain so humidity doesn't vary too much year round. This is the rule i wrote, which is working, but i have some questions / looking for expert help.

I wanted a rule that would accomplish both turning on and turning off in the same rule. Thus triggering it upon change. But this will likey trigger the rule to run every time, is that a bad thing? Better way to set it up?

Doing it this way appears to send "off" commands all the time to the switch. Is that true, or is HE smart enough to know the state of the switch is off, and not send an unnecessary off command?

Same holds true for "on" command. Is this super inefficient? Should i add a conditional statement that looks at the switch state? (on or off)?

Thank you for any help.

edit: sent complete rule

You have to understand Event Model... Hubitat uses an Event Model... every message FROM any device is an event. Therefore, your Humidity sensor could be set to send a message every 5 mins or 1 hour. Equally it could be set to send a message every 1% change or 25% change of humidity... or (worse) both. If you set those values LOW, then you're going to get a 'flood' of messages. Set to High and the Fan won't go on and off at the interval you like.

More about Event processing.. an Event Arrives and if it is identical to the previous for that device it gets discarded. It is easy then to imagine Humidity readings jumping tiny amounts every few minutes. Filter them by increasing your settings ON the humidity sensor.

Your Rule will, with each fractional report, do something.. probably OFF mostly.. which is what you are seeing, I imagine.

1 Like

I just went through this and I came up with the rule below. My Zooz sensor only reports humidity change if it changes by 10% and it only reports every three minutes. So I have mine set to only trigger on a increase. It works well, within a few minutes after turning on my shower the fan will come on. I also don't turn it off with this rule. I have a separate rule that turns the fan off after 30 minutes however it gets turned on.

I added some other stipulations, which may or not be a concern for you. Our vent unit also has a heater unit in it, so I don't want the vent coming on if the heater is on. This bathroom is right next to our bedroom and I don't want the fan coming on at night.

Thank you for reply. That helps a lot to understand HE is event driven. So as i understand it, and as you identify, all day when we arent showering in there, i am sending an off command to the fan switch. Which is what i was wondering. Worse case my inovelli switch is actually trying to run an off command, best case, i am just sending unnecessary commands across my network. So to improve this, it seems i need to add an "AND" line to the second condiiton. If humidity is below 55, "AND" the switch is ON, turn switch off. That would save some network traffic i assume?

Adding a range would reduce the Hub to Switch traffic, yes. Does nothing to the Humidity Sensor to hub traffic, since that's being initiated at the Sensor end. That's where you get control of Sensor message volume.

The sensor to hub is probably where i am in trouble. I ended up using Xiaomi devices. I bought one of those, an aeotec, and a zooz sensor. The Xiaomi is so much smaller, and got WAF for the win. Havent had any issues with it falling off the network, but i dont see away to control checkin time, and the HE event log shows as often as 2 minute checkins and as long as 20. randomly. I love the battery life and size of these things, but might have to go another way.

As a general question. Is the in-efficiency in message traffic i am showing here a problem, or does the protocol accommodate a lot of traffic, and the hub have resources it handle it all? How aggressive to I need to be on limiting traffic?

Hi @kelly1

I also use a Xiaomi (Aqara) humidity sensor and are not experiencing any traffic or load problems..

For inspiration, my rule looks like this:


(Sorry for the weird format - i'm on my phone away from home)

The "Wait for events.." is for avoiding false positives, where the sensor might register a quick drop in humidity.
It has a 20 min. max. run time that is cancelled if the humidity drops before that.
The "Private Boolean" is for preventing the rule from starting over, and resetting the 20 min. runtime.

Most Xiaomi devices will check-in hourly but will report on certain level changes. So if the humidity goes up or down it will then force a message to be sent.