Avoid repeated notifications - snooze script?  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
doh
Posts: 82
Joined: Monday 01 December 2014 13:28
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: London, UK
Contact:

Avoid repeated notifications - snooze script?

Post by doh »

I've used this guide to create some devices that indicate if rain is likely in the coming 1/2/4/6 hours - https://pon.fr/dzvents-darksky-et-probabilite-de-pluie/

It's working great, and I want to use it to add the ability to create a notification if rain is imminent.

That's all fine and I can do that no problem by detecting a change in the 1h device and seeing if it's over a specified percentage and then sending a notification.

What I want to do though is to avoid repeated notifications - e.g. if I've already sent a notification this hour, then don't send another one for the next hour or two.

I guess I could use a data variable to say when the last notification was sent, but is this the best way or is there some trick that I'm missing?

Thanks
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Avoid repeated notifications - snooze script?  [Solved]

Post by waaren »

doh wrote: Saturday 04 May 2019 11:57 .... and then sending a notification.
What I want to do though is to avoid repeated notifications - e.g. if I've already sent a notification this hour, then don't send another one for the next hour or two.
Please have a look at this It might be an answer to your requirement.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
doh
Posts: 82
Joined: Monday 01 December 2014 13:28
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: London, UK
Contact:

Re: Avoid repeated notifications - snooze script?

Post by doh »

[/quote]
Please have a look at this It might be an answer to your requirement.
[/quote]

That looks perfect! Thank you.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest