Temp sensor - Trigger activity only when mowing from -1 to 0 , not on any other temp changes

I am really hitting the wall now. I have tried several different methods to figure this out (RBE, Changing values to different ; like zero to 100 to help on calculations) but have failed to find error proof method of triggering a certain event when moving from negative temp (i.e. -1) to zero. No other changes inside negative or positive range should do anything.

I guess there is a simple way to do it but I can not see the forest any more from the trees...or vice versa :slight_smile:

Thank you for your help!

With function node seems to be simplest

[{"id":"a21b81f1.c7666","type":"function","z":"6d08d5ab.a8aa3c","name":"trigger ","func":"var last = context.get(\"last\")||0\nif(last < 0 && msg.payload >= 0){\n    var trigger = {payload:\"what ever is needed to be sent\"}\n    node.send(trigger)\n}\ncontext.set(\"last\",msg.payload)\n","outputs":1,"noerr":0,"x":340,"y":270,"wires":[["166a2580.07a90b"]]},{"id":"cdcf5c96.53b0c","type":"inject","z":"6d08d5ab.a8aa3c","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":190,"wires":[["a21b81f1.c7666"]]},{"id":"6e35e3fb.a5d75c","type":"inject","z":"6d08d5ab.a8aa3c","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":260,"wires":[["a21b81f1.c7666"]]},{"id":"fb4976b1.6be6f8","type":"inject","z":"6d08d5ab.a8aa3c","name":"","topic":"","payload":"-1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":320,"wires":[["a21b81f1.c7666"]]},{"id":"166a2580.07a90b","type":"debug","z":"6d08d5ab.a8aa3c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":500,"y":270,"wires":[]}]
1 Like

Thank you @hotNipi.

Works great !