Set a window of time to count notifications and trigger a switch

In a Rule, I would like be able to set a specific window of time in which I could count a number of notifications and if the number of notifications exceeded a threshold it would trigger an event. Ex Set a 10 minute window of time; set notifications from a humidity sensor to notify every 3% rise in humidity, If three notifications come in during the 10 minute window, then send a trigger to turn on the ceiling fan.

I'm curious to see what @LibraSun came up with as something like this has been asked for before but it wasn't really do-able without some shortfalls. More specifically, the 10 minute windows wouldn't be floating, but would be static cycles; e.g., 5:00-5:10, 5:10-5:20, etc. So you'd possibly miss events. If you had five come in between 5:05-5:10 and five more 5:10-5:15, it wouldn't trigger.

More on point to what you're trying to do, there's a community app that I think would fit the bill. It was meant for bathrooms, but I don't see why it wouldn't fit your need.

1 Like

Thank you for your replies. This is for a bathroom fan rule. I have the humidity sensor set to send a notification everytime the humidity changes by 3%. I had it at 1% and 2% but it ended up turning on the fan at odd times vs when the shower was on. 3% seemed to stabilize that problem. The humidty will only go up rapidly when the shower is on. Maybe the interval should be 4 or 5 minutes and two 3% change notifications. I would have to test the rule with different parameters. The interval would have to work 24/7 it could not be a time of day setting. The problem of not having any time interval is that increasing the humidity notification interval to 6% or more might trigger the fan if the humidty went up by 6% over a several day period. Also, if it is too large an humidity notification interval, the steam would have really built up before the fan triggers. That is kind of like setting the fan to turn on when the humidity increases to 75%.

I will look at the Bath Fan Automating Apps.

1 Like

That app will do exactly what you want. I use it for all my bathrooms. Below is my setup for the master bath. The fan is usually on by the time the water finishes warming up. Dialing in the range may take some trial and error to get right. Factors like what your normal humidity is and where your humidity sensor is placed will come into play. I think the hardest part was getting it adjusted so that the fan doesn't run for forever after a shower.

1 Like

Thanks. My Humidity sensor (Zooz ZSE44) only sends notifications on a set % humodity change. It has to be pretty low in order to trigger the fan before the steam fills the bathroom. But setting it at 1% will kill the battery quickly. It is not able tp send a notification when it hits a certain humidity level. The On Humidity Level and Off Humidity Level is being done in the Hubitat Simple Automation Tool which is where the fan switch triggers. The trick if to have it turn on the fan when the humidity rises quickly over a cewrtain level, but not when it rises slowly to that level because of rising ambient humidity. Maybe I should just set the fan to come on when the light switch over the shower is turned on.

1 Like

I'm using the same humidity sensors in all my bathrooms. I have the sensors themselves set to report on 5% humidity changes.

There's an expander arrow in the app that explains what each setting does. To use my screenshot as an example:

The fan will turn on any time there's a report of humidity over at or over 70%. It will also turn on if the rate of change is greater than 1%/minute (the rate of change is more or less what you were trying to do with your rule) and the humidity level is at least 60%. It will automatically turn the fan off whenever the runtime hits 60 minutes.

These app settings do not change anything with the device reporting. The device will continue to report based on what is set in the device page.

1 Like