Hi I am trying to detect a particular push button switch being pushed, the payload contains multiple objects. I have used the change node to make a topic sensors/status/index and trying to switch on its value but no matter what I try nothing comes out of the switch.
The code is:
[{"id":"7a8ad30eecd59839","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"5cf054507018f9bd","type":"mqtt out","z":"7a8ad30eecd59839","name":"","topic":"Light0/cmnd/5a205b","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"881ee26fa89baac1","x":420,"y":380,"wires":[]},{"id":"5c6097c9c2c49ef3","type":"inject","z":"7a8ad30eecd59839","name":"Off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Light0\\cmnd\\5a205b","payload":" { \"outputs\": [ { \"index\": 1, \"command\": \"off\" } ] }","payloadType":"str","x":70,"y":380,"wires":[["5cf054507018f9bd"]]},{"id":"5729648dc441074f","type":"mqtt in","z":"7a8ad30eecd59839","name":"","topic":"Button/stat/bd0577","qos":"2","datatype":"auto","broker":"881ee26fa89baac1","nl":false,"rap":true,"rh":0,"inputs":0,"x":130,"y":60,"wires":[["ba0fe1aab6b1fd5d"]]},{"id":"ba0fe1aab6b1fd5d","type":"json","z":"7a8ad30eecd59839","name":"","property":"payload","action":"","pretty":false,"x":310,"y":100,"wires":[["7e4a82028c0799db"]]},{"id":"3f4d99a9d75fb8f1","type":"debug","z":"7a8ad30eecd59839","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":490,"y":240,"wires":[]},{"id":"520856cdb58f1b64","type":"inject","z":"7a8ad30eecd59839","name":"On","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Light0\\cmnd\\5a205b","payload":"","payloadType":"str","x":70,"y":300,"wires":[["7ae8186e29ea686f"]]},{"id":"1fe8bb9a62d32140","type":"sunrise","z":"7a8ad30eecd59839","name":"Warragul Sun Position","lat":"-38","lon":"145","start":"sunrise","end":"sunset","soff":0,"eoff":0,"x":140,"y":500,"wires":[[],[]]},{"id":"592d9e91fa7eeed5","type":"mqtt in","z":"7a8ad30eecd59839","name":"","topic":"Light0/cmnd/5a205b","qos":"2","datatype":"auto","broker":"881ee26fa89baac1","nl":false,"rap":true,"rh":0,"inputs":0,"x":130,"y":440,"wires":[["ae023622b706b61c"]]},{"id":"ae023622b706b61c","type":"debug","z":"7a8ad30eecd59839","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":450,"y":440,"wires":[]},{"id":"7e4a82028c0799db","type":"split","z":"7a8ad30eecd59839","name":"","splt":"","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"key","x":430,"y":100,"wires":[["e8c69bcf951ad7b5"]]},{"id":"e8c69bcf951ad7b5","type":"change","z":"7a8ad30eecd59839","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"\"sensors/status/\" & key","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":100,"wires":[["2a05dd883c5e1160","91b00d18bed26342"]]},{"id":"0f8e85923da5fd55","type":"switch","z":"7a8ad30eecd59839","name":"sensors/status/index","property":"sensors/status/index","propertyType":"msg","rules":[{"t":"eq","v":"113","vt":"num"},{"t":"eq","v":"112","vt":"num"},{"t":"eq","v":"114","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":320,"y":240,"wires":[["7ae8186e29ea686f","3f4d99a9d75fb8f1"],[],[]]},{"id":"7ae8186e29ea686f","type":"change","z":"7a8ad30eecd59839","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":" { \"outputs\": [ { \"index\": 1, \"command\": \"on\" } ] }","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":300,"wires":[["5cf054507018f9bd"]]},{"id":"5b56e9ad21dbe562","type":"inject","z":"7a8ad30eecd59839","name":"On","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Button/stat/bd0577","payload":"{\"port\":29,\"channel\":1,\"index\":113,\"type\":\"switch\",\"event\":\"on\"}","payloadType":"str","x":90,"y":120,"wires":[["ba0fe1aab6b1fd5d"]]},{"id":"91b00d18bed26342","type":"debug","z":"7a8ad30eecd59839","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":490,"y":200,"wires":[]},{"id":"2a05dd883c5e1160","type":"change","z":"7a8ad30eecd59839","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"sensors/status/index","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":120,"y":260,"wires":[["0f8e85923da5fd55"]]},{"id":"881ee26fa89baac1","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]
Thanks in advance.
Rustyv