Temperature sensor SMS sending with delay if

I'm new to Node Red and I'm having a little problem with my flow.

I want to monitor a cold storage facility with a temperature sensor. The temperature is -20° degrees. The temperature is allowed to rise to -10° degrees for 1 hour before an SMS is sent. If the temperature returns to -20° degrees, no SMS should be sent. I have a flow that delays the SMS for 600 seconds, but that's wrong because the cold storage door can be opened... then the temperature just drops. Anyone have an idea??

Best regards !

did you try a trigger node ? with either a switch or a simple gate node


Maybe like this?

The first trigger node filter the door-open-events. When the temperatur raise fast enough during the grace period, no msg ist send. The second delay node send the actual sms an blocks further sms-sending, until the temperture ist greater than the threshold.

[{"id":"ec60fc5d6e3be275","type":"inject","z":"4fe2154e6505c4c9","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-11","payloadType":"num","x":190,"y":140,"wires":[["152da39463e56613"]]},{"id":"a532d4c0eadc3217","type":"inject","z":"4fe2154e6505c4c9","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-10","payloadType":"num","x":190,"y":180,"wires":[["152da39463e56613"]]},{"id":"d23dc16cc9eb8750","type":"inject","z":"4fe2154e6505c4c9","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-9","payloadType":"num","x":190,"y":220,"wires":[["152da39463e56613"]]},{"id":"b31641981cd47204","type":"trigger","z":"4fe2154e6505c4c9","name":"","op1":"it's hot in here!","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1060,"y":180,"wires":[["d0f5892cea242033"]]},{"id":"0d2f7b054e79e8a2","type":"switch","z":"4fe2154e6505c4c9","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"-10","vt":"str"},{"t":"lt","v":"-10","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":470,"y":180,"wires":[["b48d9df5cd738b8f"],["5faee6f83e49a95d"]]},{"id":"d0f5892cea242033","type":"debug","z":"4fe2154e6505c4c9","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1280,"y":180,"wires":[]},{"id":"5faee6f83e49a95d","type":"change","z":"4fe2154e6505c4c9","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":260,"wires":[["b31641981cd47204","b48d9df5cd738b8f"]]},{"id":"b48d9df5cd738b8f","type":"trigger","z":"4fe2154e6505c4c9","name":"","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"6","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":840,"y":180,"wires":[["b31641981cd47204"]]},{"id":"152da39463e56613","type":"junction","z":"4fe2154e6505c4c9","x":380,"y":180,"wires":[["0d2f7b054e79e8a2"]]}]
1 Like

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