I try to build an events that will send a single messages when temperature drop below 90 degree C. In this examples its start to send message when temperature is under 90 but it’s continue to send until I deactivate the events
How to make this event to send just one message when temperature passes 90 and below and then only send message next time the temperature drops???
Only send notification once when temp changes?
Moderator: leecollings
-
- Posts: 12
- Joined: Tuesday 17 January 2017 11:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Only send notification once when temp changes?
- Attachments
-
- events_tempp.JPG (24.56 KiB) Viewed 3302 times
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Only send notification once when temp changes?
I'd suggest adding a user variable for which you give some desired value (true/false, 0/1, on/off...) when temp passes the notification threshold to either direction. Then for the notification, add additional check for the user variable to send it only when the variable still says temp > 90 but actual temp is < 90. At the same time the user variable updates and with the next check it will not send a message anymore.
Also, add a condition to update the user variable only in case the value needs to change (otherwise it will keep updating the same value).
This might actually be a bit easier to be done with LUA but should be working in Blockly too...
Also, add a condition to update the user variable only in case the value needs to change (otherwise it will keep updating the same value).
This might actually be a bit easier to be done with LUA but should be working in Blockly too...
Last edited by Nautilus on Tuesday 17 January 2017 13:42, edited 2 times in total.
-
- Posts: 12
- Joined: Tuesday 17 January 2017 11:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Only send notification once when temp changes?
ahhh ok so if i have a variable send= 1 or 0
If temp is higher then 90 then send = 1
If temp is lower than 90 and send = 1 then send message and then set send = 0
Nice thanks
If temp is higher then 90 then send = 1
If temp is lower than 90 and send = 1 then send message and then set send = 0
Nice thanks
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Only send notification once when temp changes?
Yes, something along those lines was exactly what I meant 
And possibly also consider:
...and vice versa - if you want to avoid updating the variable when the target value is the same as the current value.

And possibly also consider:
Code: Select all
If temp is higher than 90 and send = 0 then send = 1
-
- Posts: 12
- Joined: Tuesday 17 January 2017 11:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Only send notification once when temp changes?
Thanks This works 

- Attachments
-
- vedpanna_funkar.JPG (39.7 KiB) Viewed 3281 times
Who is online
Users browsing this forum: No registered users and 1 guest