Hi,
from "link in", I get the result of a cyclic query (every 5 seconds). This result I convert from on/off to true/false. However, the output of the "function node" should only send the value at the output when the state has gchanged.
Example:
off changes to on --> output "function node" true
on changes to off --> output "function node" false
off is detected again --> output "function node" no new output of false
Can someone here give me a hint how this can be intercepted for example with the function node?
[{"id":"8d9be1bc.ac135","type":"link in","z":"1b695a49.dbe296","name":"","links":[],"x":1405,"y":200,"wires":[["7fbe3638.7779e8"]]},{"id":"7fbe3638.7779e8","type":"function","z":"1b695a49.dbe296","name":"true/false","func":"if (msg.payload == \"on\") {\n msg.payload = true;\n} else {\n msg.payload = false;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1560,"y":200,"wires":[["6239b4b3.2b374c"]]},{"id":"6239b4b3.2b374c","type":"debug","z":"1b695a49.dbe296","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1750,"y":200,"wires":[]}]