Page 1 of 1

script to supress notifications for period of time

Posted: Wednesday 30 October 2019 10:33
by snuiter
Hi,
anyone has suggestions how to add a piece of code to my dzVents scripts to surpress notifications for a period of time. Trigger should be adjustable either receiving 5(x) notifications within 10 minutes(y), once this occured stop the notifications for 2 hours(z).

Reason behind this that I use a number of scripts for monitoring, scripts can be either triggered via device or timer, there are occassions the monitoring scripts keeps sending notifications and after a few notifications it becomes annoying.

Any suggestion is welcome.

Thank you

Re: script to supress notifications for period of time

Posted: Wednesday 30 October 2019 11:52
by BOverdevest
Maybe using some fuzzy logic?

Use a variable and add 1 to it for every notification send.
Use this variable as a condition to send the notification. So if the value is 10 or higher, do not Sent notification.

In a separate script, every 2 hours, reduce the variable by one.
Make a separate push button to reset the variable to 0. (Can push it from your phone).

The 10 mentioned above you could set in a separate variable or in a counter device, so you can tweak it easier and use the same across all scripts.
Even the period of removing 1 from the variable you could manage via a variable.

So, when the load is high you get 10 messages and then 1 (random) every 2 hours.
Push the reset button when things calm down or you sorted the problem

Tweak the parameters to get the behavior you want.

Hope this helps....


Verzonden vanaf mijn iPhone met Tapatalk

Re: script to supress notifications for period of time

Posted: Wednesday 30 October 2019 22:01
by papoo
a 100% functional waaren script for this
https://www.domoticz.com/forum/viewtopi ... 42#p204958