Notification but not more then once every X minutes


#1

1) Give a description of the problem
I’m having trouble figuring out how to make notifications only send once every 10 minutes regardless of how many times the status changes of device

2) What is the expected behaviour?
I have a automation in ST for notification once a contact sensor opens. Well its driving me crazy when people go in and out numerous times within 10-20 mins. I’d like to have it only notify me once every 10 minutes regardless of how many times someone goes in and out.

3) What is happening/not happening?
Don’t know where to start. Tried searching through the forum but can’t find a solution or piston resembling this.


#2

There are many ways to do this. One method would be to use a time variable and an IF statement with that variable to limit your notifications.

Notify you of what? How many times it opened? Open or closed? Motion?

You could use :
Every 10 minutes
Do stuff
END every

Realize with this method that you might get notifications every 10 minutes.


#3

So right now it notifies me every single time someone opens the contact sensor. I just want to limit the notifications to once every 10 minutes. Even if the contact sensor was opened numerous times within the 10 minutes. If it notified me the first time it opened. Don’t notify me again until 10 minutes has passed.


#4

I would record the “something has happend” by setting a global variable or virtual switch, then use a separate piston to notify periodically. You need to remember to clear the condition at some point.

As an example, I have a piston that checks when the bins should be put out for collection. A separate piston is triggered when movement is detected and announces, but only if there hasn’t been an announcement in the last hour. I then use an alexa voice prompt to turn the virtual switch off again, when I tell alexa I’ve put the bin out.


#5

Did you set it up to do that?


#6

This is a simple automation in new ST app. I’d like to transfer it to webcore for it to be more tailored to my needs. But I’m new to all of this, so i was hoping someone can guide me as to how to add a condition to not repeat if 10 minuted hasn’t passed before restarting it.


#7

This may give you an idea


#8

Thanks, I’ll try to modify it to my needs and see if it will work. Will report back.


#9

I have something similar to your situation and I use 2 pistons for it.

Piston #1
controls the door actions

IF door changes to open
And
IF @globaldoor = true
     do this do that
     Set @globaldoor to = false 

the second piston controls the variable

piston #2

IF @globaldoor changes to FALSE
wait 10 minutes
Set @globaldoor to TRUE

#10

Do I leave the global variable (@gloabldoor) to not set in piston 1 and 2? On the right side.


#11

Start with it “true”, and it should keep itself in sync from there on in.


#12

Alright. I went with @ike2018’s method. Can someone confirm if this looks correct. Can’t test it for several hours, physically.

DoorSensorNotify-gb


#13

The only change I would do is in piston “453w”.
The “Set variable” should be the very last command.


Edit:
I might also add a 2 second wait before the reset, such as:

Send PUSH
Make a POST request
Wait 2 seconds
Set variable

#14

Thank you for your continued assistance. Everyone else, thanks for your time and contribution.


#15

let us know if any other questions…