Preventing multiple contact sensor opens/close in time period

Hello,

This has probably been addressed in a forum, but for the life of me I can't find it. Probably because I'm not using the right search terms.

I have a "normally open" contact sensor I'm using within HE. Works great. I have a Basic Rule app that monitors for it to "close" and then send me a notification as well as turn on a light. Works great.

What doesn't work great, is that after the contact sensor "closes" and the notification is sent and the light is turned on I'd like HE to wait 20 seconds before recognizing another "close" event. Right now I get like three or four notifications because HE is recognizing the sensor "closing" repeatedly in a short period of time.

I don't see any way to do this in the Basic Rule. I do, however, see that maybe I need to let the Basic Rule just manage turning on the light, and then setup a notifier to send me the notification. Because in the notifier, I see this thing called "For how long (minutes)" which may do what I want it to do.

Any help?

Wouldn't a wait on the inactive for 30 seconds do the trick? Like this:

When it closes have that turn on a virtual switch. Then have that switch turn off after 20 secs.

Hi, thanks for the reply. I'm very new with Hubitat, and not understanding your response. Are you saying add code to the Apps Code in the GUI for the sensors?

Thanks for the reply. The issue I'm having is that the sensors are reading multiple closes in a short period of time. They're doing their job properly: they're actually being triggered multiple times in a short period of time. I just only want to be alerted to one of them, say within 20 seconds for example. Could a virtual switch be useful in some way?

No you don't need to add any code. In devices make a virtual switch name it whatever you want. Then Write a rule that if the contact closes "that would be your trigger". it turns on the virtual switch you created . Then have the same virtual switch turn off with a delay of 20 secs. Then in another rule you want to use to monitor your contact use your virtual switch for the rule instead of the contact sensor. Hope that helps.

The built in Notifications app has notification limit settings.

1 Like

Okay so you only want the one alert I'd do something like this:

Obviously I'm using my devices but you get the idea here. We are going to use the Private Boolean to keep you from getting multiple triggers. So if the PB for the rule is true then it will look for the trigger. If any motion sensor sees movement the actions will fire.

The first thing the actions will do is set the PB to false so that the rule will not fire again until reset.
Then we send the notification and then wait for all motion to stop. Then we wait 20 seconds and reset the boolean.

Hope that does the trick for you and that I understood what you were looking for.

Thanks everyone... I'll give things a try.

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