Only output a msg when the payload is in a different temperature range

I have a switch node with different output depending on temperature range. Like 0-5, 5-10 and 10+
Now there is output when the temperature changes from 6 to 7 and 7 to 8. I want outputs only when there is a change in range. When the temperature changes 5 to 6, or 10 to 11. Is this possible?

If you use an RBE you can block messages unless they change.

[{"id":"4849338.82dffcc","type":"switch","z":"ecfe2a67.7f7818","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"5","v2t":"num"},{"t":"btwn","v":"5","vt":"num","v2":"10","v2t":"num"},{"t":"gt","v":"10","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":290,"y":320,"wires":[["988aef0c.844df"],["d874ebb4.bbf288"],["27d46647.35a3ea"]]},{"id":"988aef0c.844df","type":"change","z":"ecfe2a67.7f7818","name":"set msg.range 0-5","rules":[{"t":"set","p":"range","pt":"msg","to":"0-5","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":280,"wires":[["ce4d566a.60aed8"]]},{"id":"d874ebb4.bbf288","type":"change","z":"ecfe2a67.7f7818","name":"set msg.range 5-10","rules":[{"t":"set","p":"range","pt":"msg","to":"5-10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":320,"wires":[["ce4d566a.60aed8"]]},{"id":"27d46647.35a3ea","type":"change","z":"ecfe2a67.7f7818","name":"set msg.range 10+","rules":[{"t":"set","p":"range","pt":"msg","to":"10+","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":360,"wires":[["ce4d566a.60aed8"]]},{"id":"ce4d566a.60aed8","type":"rbe","z":"ecfe2a67.7f7818","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"range","x":700,"y":320,"wires":[["a04035fb.81b718"]]},{"id":"a04035fb.81b718","type":"debug","z":"ecfe2a67.7f7818","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":860,"y":320,"wires":[]},{"id":"b5e826f9.10e908","type":"inject","z":"ecfe2a67.7f7818","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2","payloadType":"num","x":130,"y":240,"wires":[["4849338.82dffcc"]]},{"id":"e603a3bf.79168","type":"inject","z":"ecfe2a67.7f7818","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"4","payloadType":"num","x":130,"y":280,"wires":[["4849338.82dffcc"]]},{"id":"b1cfb9c3.fc71f8","type":"inject","z":"ecfe2a67.7f7818","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"6","payloadType":"num","x":130,"y":320,"wires":[["4849338.82dffcc"]]},{"id":"1bc41639.05b95a","type":"inject","z":"ecfe2a67.7f7818","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"8","payloadType":"num","x":130,"y":360,"wires":[["4849338.82dffcc"]]},{"id":"95e91880.2fdbe8","type":"inject","z":"ecfe2a67.7f7818","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"11","payloadType":"num","x":130,"y":400,"wires":[["4849338.82dffcc"]]},{"id":"799031d4.9c0fc","type":"inject","z":"ecfe2a67.7f7818","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"15","payloadType":"num","x":130,"y":440,"wires":[["4849338.82dffcc"]]}]
1 Like

Perfect! Exactly what I was looking for.Thank you so much.

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