Send alert when it exceeds a temperature value

Hello, I am programming an alert system when the temperature range (17-24) is exceeded. The point is, I need to know two things:

  • The notification has to be sent only once.
  • Have a notification sent again when the values ​​return to the normal range.

The system already warns me when the value exceeds the parameters but I need another alert to be sent when the value is normalized.

Thanks.

Where is normalised, is it between 17 and 24? Does exceed mean above both or above 24 and below 17?

Normalised : between 17 and 24
Exceed: above 24 and below 17

thanks :slight_smile:

Ok try somthing like this

[{"id":"655506d9.9eac5","type":"inject","z":"c74669a0.6a34f8","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"16","payloadType":"num","x":110,"y":3440,"wires":[["28338cb3.a5e4d4"]]},{"id":"28338cb3.a5e4d4","type":"change","z":"c74669a0.6a34f8","name":"","rules":[{"t":"set","p":"inrange","pt":"msg","to":"payload < 24  and payload > 17 ","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":3480,"wires":[["6672f614.aebd1","7c3684ce.ff9434"]]},{"id":"abef4194.f86128","type":"inject","z":"c74669a0.6a34f8","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"25","payloadType":"num","x":110,"y":3520,"wires":[["28338cb3.a5e4d4"]]},{"id":"d54d2614.4e1c8","type":"inject","z":"c74669a0.6a34f8","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","x":110,"y":3480,"wires":[["28338cb3.a5e4d4"]]},{"id":"6672f614.aebd1","type":"rbe","z":"c74669a0.6a34f8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"inrange","x":470,"y":3480,"wires":[["77eb50b7.56b12"]]},{"id":"7c3684ce.ff9434","type":"debug","z":"c74669a0.6a34f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"inrange","statusType":"msg","x":380,"y":3400,"wires":[]},{"id":"77eb50b7.56b12","type":"debug","z":"c74669a0.6a34f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"inrange","statusType":"msg","x":610,"y":3480,"wires":[]}]

update due to error

My flow is like this:

No valuble info there.
Here is an example the 3 injects simulate a payload input of 16 or 20 or 25.
The RBE and template monitor msg.inrange, the template uses mustache sytntax to dynamically change the text.
The flow outputs"Temperature is 20 Normalised" or "Temperature is 25 Exceeded" the 20, 25, normalised and eceeded vary according to input.
The message only outputs on a change of msg.inrange.

[{"id":"d54d2614.4e1c8","type":"inject","z":"c74669a0.6a34f8","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","x":110,"y":3480,"wires":[["28338cb3.a5e4d4"]]},{"id":"28338cb3.a5e4d4","type":"change","z":"c74669a0.6a34f8","name":"","rules":[{"t":"set","p":"inrange","pt":"msg","to":"payload < 24  and payload > 17 ","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":3480,"wires":[["6672f614.aebd1"]]},{"id":"655506d9.9eac5","type":"inject","z":"c74669a0.6a34f8","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"16","payloadType":"num","x":110,"y":3440,"wires":[["28338cb3.a5e4d4"]]},{"id":"abef4194.f86128","type":"inject","z":"c74669a0.6a34f8","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"25","payloadType":"num","x":110,"y":3520,"wires":[["28338cb3.a5e4d4"]]},{"id":"6672f614.aebd1","type":"rbe","z":"c74669a0.6a34f8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"inrange","x":470,"y":3480,"wires":[["99636e13.089b9"]]},{"id":"99636e13.089b9","type":"template","z":"c74669a0.6a34f8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Temperature is {{payload}} {{#inrange}}Normalised{{/inrange}}{{^inrange}}Exceeded{{/inrange}}\n","output":"str","x":610,"y":3480,"wires":[["77eb50b7.56b12"]]},{"id":"77eb50b7.56b12","type":"debug","z":"c74669a0.6a34f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"msg","x":750,"y":3480,"wires":[]}]

https://mustache.github.io/mustache.5.html

Ok! Got it.
Is it going to advertise me only once (when the values change) or every 'x' time....?

As said. May be try it and you will see.

Thank you very much! I appreciate it! :slight_smile:

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