Keep switch UI switch state in sync with external triggers

Back again...this is a continuation of a topic from over a year ago...for reference: (https://discourse.nodered.org/t/have-objects-in-msg-need-to-take-actions-based-on-one-of-the-payload-codes/37451)

I stepped away from this part of my project to work on other items as I never really was able to make it reliable. Need is upon me now, thus the resurrection.

Short story is that the UI switch does not respond to UI activation...and the state of the switch is unreliable in reset to match the actual state of the 433mhz controlled relay. Here is the flow:

[{"id":"fe93b018b2b9d692","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"ff6761b0aaece246","type":"switch","z":"fe93b018b2b9d692","name":"","property":"payload.code","propertyType":"msg","rules":[{"t":"eq","v":"2513048","vt":"str"},{"t":"eq","v":"8529fb","vt":"str"},{"t":"eq","v":"2529fb","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":260,"y":110,"wires":[["8b42f15fdd01ccee","50cfb7fdbc9503c8"],[],[]],"outputLabels":["relay 1","relay 2","relay 3"]},{"id":"8b42f15fdd01ccee","type":"debug","z":"fe93b018b2b9d692","name":"from switch node","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":460,"y":90,"wires":[]},{"id":"50cfb7fdbc9503c8","type":"change","z":"fe93b018b2b9d692","name":"remove flow.switch2 --> reset","rules":[{"t":"set","p":"payload","pt":"msg","to":"switch2","tot":"flow"},{"t":"set","p":"switch2","pt":"flow","to":"$not(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":210,"wires":[["46122a637156923a","01e62b0f01af71da"]]},{"id":"46122a637156923a","type":"ui_switch","z":"fe93b018b2b9d692","name":"","label":"switch2","tooltip":"","group":"bc31878d1a223849","order":4,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"switch2","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"className":"","x":930,"y":210,"wires":[["38f08a67e36964d5","c6902f0c006adcdc","bce93aa4b3a7d097"]]},{"id":"c6902f0c006adcdc","type":"change","z":"fe93b018b2b9d692","name":"copy msg.payload --> flow.switch2","rules":[{"t":"set","p":"switch2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1230,"y":250,"wires":[["68d18854d09e1e11"]]},{"id":"38f08a67e36964d5","type":"debug","z":"fe93b018b2b9d692","name":"Out of switch","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1130,"y":90,"wires":[]},{"id":"adfaabc84c86d5ae","type":"inject","z":"fe93b018b2b9d692","name":"Reset switch state on boot","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":".1","topic":"","payload":"switch2","payloadType":"flow","x":690,"y":150,"wires":[["52b20a55b48bcc78","46122a637156923a"]]},{"id":"01e62b0f01af71da","type":"debug","z":"fe93b018b2b9d692","name":"out of switch2 reset","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":340,"wires":[]},{"id":"52b20a55b48bcc78","type":"debug","z":"fe93b018b2b9d692","name":"out of boot reset","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":870,"y":90,"wires":[]},{"id":"bce93aa4b3a7d097","type":"rpi-433-emitter","z":"fe93b018b2b9d692","pin":"0","pulseLength":"0","protocol":"0","x":1200,"y":170,"wires":[]},{"id":"0f91292ccb242826","type":"rpi-433-sniffer","z":"fe93b018b2b9d692","pin":"3","pulseLength":0,"debounceDelay":500,"x":100,"y":110,"wires":[["ff6761b0aaece246","7ee1a528a0422b82"]]},{"id":"7ee1a528a0422b82","type":"debug","z":"fe93b018b2b9d692","name":"from sniffer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":110,"y":200,"wires":[]},{"id":"68d18854d09e1e11","type":"debug","z":"fe93b018b2b9d692","name":"copy value after switch","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1190,"y":310,"wires":[]},{"id":"bc31878d1a223849","type":"ui_group","name":"Testing","tab":"70cd76099d731fa7","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"70cd76099d731fa7","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Currently the UI switch node responds to external 433mhz inputs and transitions on/off, however UI activation of the switch does not work. @Colin and @Steve-Mcl have offered assistance previously that was very helpful (should have a way to pay you both a retainer!). I have a hunch that this may be due to the context storage on my Pi which is currently configured as such storing to file:
nr1

And configured in NR setting.js as:

contextStorage: {
   default: { module:"localfilesystem" },
   storeInMemory: { module: "memory" }
   },

However when I check the pi/.node-red/context folder it is unreliable to see the flow context stored...sometimes I see the context stored...other times not:

nr2

nr3

BTW...no debug output when attempting to alter the state of the UI switch.

Unlike most devices the RF433 devices don't offten send back any kind of message to confirm the state.
So whatever you do there may be no way of knowing the true state of the device.

The way you have your switch setup it needs to see an input from the 433 node when you click it in the ui.

As I don't have your nodes can you tell me what happens when you click the switch does it send out 2513048 and does this then arrive at the 433 input node ?

@smcgann99 Yes...when I trigger the 433Mhz switch, the output from the split node captures 2513048. You could mimic that by an inject node in place of the rpi-433 sniffer which would be identical to the payload received from the external switch.

I am not very concerned about missed 433Mhz signal receipts as this is going into a camper and my 433Mhz receiver has a great antenna in a very small space. In my testing I have yet to not have the external switch capture by the sniffer be missed. I believe at one time I actually was able to get this to work...but not now.

This seems to work as you wanted

[{"id":"fe93b018b2b9d692","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"ff6761b0aaece246","type":"switch","z":"fe93b018b2b9d692","name":"","property":"payload.code","propertyType":"msg","rules":[{"t":"eq","v":"2513048","vt":"str"},{"t":"eq","v":"8529fb","vt":"str"},{"t":"eq","v":"2529fb","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":330,"y":120,"wires":[["8b42f15fdd01ccee","50cfb7fdbc9503c8"],[],[]],"outputLabels":["relay 1","relay 2","relay 3"]},{"id":"8b42f15fdd01ccee","type":"debug","z":"fe93b018b2b9d692","name":"from switch node","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":550,"y":60,"wires":[]},{"id":"50cfb7fdbc9503c8","type":"change","z":"fe93b018b2b9d692","name":"remove flow.switch2 --> reset","rules":[{"t":"set","p":"payload","pt":"msg","to":"switch2","tot":"flow"},{"t":"set","p":"switch2","pt":"flow","to":"$not(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":200,"wires":[["46122a637156923a","01e62b0f01af71da"]]},{"id":"46122a637156923a","type":"ui_switch","z":"fe93b018b2b9d692","name":"","label":"switch2","tooltip":"","group":"bc31878d1a223849","order":4,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"switch2","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"className":"","x":960,"y":200,"wires":[["c6902f0c006adcdc","38f08a67e36964d5","50cfb7fdbc9503c8"]]},{"id":"c6902f0c006adcdc","type":"change","z":"fe93b018b2b9d692","name":"copy msg.payload --> flow.switch2","rules":[{"t":"set","p":"switch2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":260,"wires":[["68d18854d09e1e11"]]},{"id":"adfaabc84c86d5ae","type":"inject","z":"fe93b018b2b9d692","name":"Reset switch state on boot","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":".1","topic":"","payload":"switch2","payloadType":"flow","x":640,"y":140,"wires":[["52b20a55b48bcc78","46122a637156923a"]]},{"id":"01e62b0f01af71da","type":"debug","z":"fe93b018b2b9d692","name":"out of switch2 reset","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":260,"wires":[]},{"id":"52b20a55b48bcc78","type":"debug","z":"fe93b018b2b9d692","name":"out of boot reset","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":930,"y":140,"wires":[]},{"id":"68d18854d09e1e11","type":"debug","z":"fe93b018b2b9d692","name":"copy value after switch","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1500,"y":240,"wires":[]},{"id":"6479cfcb594a19da","type":"inject","z":"fe93b018b2b9d692","name":"","props":[{"p":"payload.code","v":"2513048","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":170,"y":120,"wires":[["ff6761b0aaece246"]]},{"id":"38f08a67e36964d5","type":"debug","z":"fe93b018b2b9d692","name":"Out of switch","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1170,"y":180,"wires":[]},{"id":"bc31878d1a223849","type":"ui_group","name":"Testing","tab":"70cd76099d731fa7","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"70cd76099d731fa7","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

That is the same flow that I posted...so unfortunately it is not working. Sometimes, the UI switch is responsive to inputs...but even on the occasions that it responds, the 433Mhz signal is not being sent out of the switch.

I think I may have figured it out. The message coming out of the UI switch node was delivering a Boolean true/false which I had to switch to the actual 433Mhz code to be transmitted prior to the 433 emitter node. I will continue testing to check stability and also (importantly) ensuring the UI state of the controlled relay stays in sync with the physical device.

[{"id":"fe93b018b2b9d692","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"ff6761b0aaece246","type":"switch","z":"fe93b018b2b9d692","name":"","property":"payload.code","propertyType":"msg","rules":[{"t":"eq","v":"2513048","vt":"str"},{"t":"eq","v":"8529fb","vt":"str"},{"t":"eq","v":"2529fb","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":260,"y":110,"wires":[["8b42f15fdd01ccee","50cfb7fdbc9503c8"],[],[]],"outputLabels":["relay 1","relay 2","relay 3"]},{"id":"8b42f15fdd01ccee","type":"debug","z":"fe93b018b2b9d692","name":"from switch node","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":460,"y":90,"wires":[]},{"id":"50cfb7fdbc9503c8","type":"change","z":"fe93b018b2b9d692","name":"remove flow.switch2 --> reset","rules":[{"t":"set","p":"payload","pt":"msg","to":"switcha","tot":"flow"},{"t":"set","p":"switcha","pt":"flow","to":"$not(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":210,"wires":[["46122a637156923a","01e62b0f01af71da"]]},{"id":"46122a637156923a","type":"ui_switch","z":"fe93b018b2b9d692","name":"","label":"switcha","tooltip":"","group":"78c14ac3.283354","order":4,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"switcha","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"className":"","x":930,"y":210,"wires":[["38f08a67e36964d5","c6902f0c006adcdc","eb980499a5e08cf9"]]},{"id":"c6902f0c006adcdc","type":"change","z":"fe93b018b2b9d692","name":"copy msg.payload --> flow.switch2","rules":[{"t":"set","p":"switcha","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1230,"y":250,"wires":[["68d18854d09e1e11"]]},{"id":"38f08a67e36964d5","type":"debug","z":"fe93b018b2b9d692","name":"Out of switcha","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1140,"y":90,"wires":[]},{"id":"adfaabc84c86d5ae","type":"inject","z":"fe93b018b2b9d692","name":"Reset switch state on boot","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":".1","topic":"","payload":"switch2","payloadType":"flow","x":690,"y":150,"wires":[["52b20a55b48bcc78","46122a637156923a"]]},{"id":"01e62b0f01af71da","type":"debug","z":"fe93b018b2b9d692","name":"out of switcha reset","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":340,"wires":[]},{"id":"52b20a55b48bcc78","type":"debug","z":"fe93b018b2b9d692","name":"out of boot reset","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":870,"y":90,"wires":[]},{"id":"bce93aa4b3a7d097","type":"rpi-433-emitter","z":"fe93b018b2b9d692","pin":"0","pulseLength":"0","protocol":"0","x":1320,"y":130,"wires":[]},{"id":"0f91292ccb242826","type":"rpi-433-sniffer","z":"fe93b018b2b9d692","pin":"3","pulseLength":0,"debounceDelay":500,"x":100,"y":110,"wires":[["ff6761b0aaece246","7ee1a528a0422b82"]]},{"id":"7ee1a528a0422b82","type":"debug","z":"fe93b018b2b9d692","name":"from sniffer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":110,"y":200,"wires":[]},{"id":"68d18854d09e1e11","type":"debug","z":"fe93b018b2b9d692","name":"copy value after switcha","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1200,"y":310,"wires":[]},{"id":"b2fb1464a0903e76","type":"inject","z":"fe93b018b2b9d692","name":"","props":[{"p":"payload.code","v":"2513048","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":120,"y":40,"wires":[["ff6761b0aaece246"]]},{"id":"eb980499a5e08cf9","type":"change","z":"fe93b018b2b9d692","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"2513048","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":180,"wires":[["bce93aa4b3a7d097"]]},{"id":"179bb17b2b306b30","type":"inject","z":"fe93b018b2b9d692","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2513048","payloadType":"str","x":1290,"y":30,"wires":[["bce93aa4b3a7d097"]]},{"id":"78c14ac3.283354","type":"ui_group","name":"Remote relay","tab":"225049e7.1f19a6","order":1,"disp":true,"width":"4","collapse":false},{"id":"225049e7.1f19a6","type":"ui_tab","name":"ESP devices","icon":"dashboard","order":10}]```

Well its based on that flow but it its not the same :wink:

I looped the ui switch output back to the preceeding node, so that the ui switch will always update when the switch is clicked - regardless of the 433 nodes.

Testing with the inject and ui switch that flow never misses any operations.

If you are having issues then it is most likley to do with the 433 nodes (which I can't test)
Of course if you weren't sending the correct payload to the 433 node then you would never see it arrive back at the start of the flow anyway. but with the loop the switch would still update.

I see that I had payload.code rather than payload going out. However, I still have issues with the context being properly accessed. I think I am going to change gears here. I purchased a few programmable relays that support latching mode, this allows for a separate signal for on/off. Flow below and so far, testing looks good. Thank you for all of your feedback!!

[{"id":"8119ef26.286b7","type":"exec","z":"c101bca7.599e8","command":"python3 send.py -p 327 -t 1 2489288","addpay":false,"append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"Relay #2 On","x":826,"y":540,"wires":[[],[],[]]},{"id":"51073368.3f4bec","type":"ui_button","z":"c101bca7.599e8","name":"All Off","group":"bd2b5b03.d10418","order":3,"width":2,"height":1,"passthru":false,"label":"All Off","tooltip":"","color":"red","bgcolor":"#2A2A2A","icon":"","payload":"false","payloadType":"bool","topic":"ext_lights/all","x":266,"y":650,"wires":[["d089d5d606f7e5ad","336149a0b7500d66"]]},{"id":"e6007915.0529d8","type":"ui_button","z":"c101bca7.599e8","name":"All On","group":"bd2b5b03.d10418","order":5,"width":2,"height":1,"passthru":false,"label":"All On","tooltip":"","color":"yellow","bgcolor":"#2A2A2A","icon":"","payload":"true","payloadType":"bool","topic":"relayboard/all","x":266,"y":590,"wires":[["27a484ad51fa5cc3","b6ff10be17c556fa"]]},{"id":"1ae312c0.4f306d","type":"ui_switch","z":"c101bca7.599e8","name":"","label":"Relay #1","tooltip":"","group":"bd2b5b03.d10418","order":11,"width":5,"height":2,"passthru":true,"decouple":"false","topic":"relay1","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"fa-power-off fa-3x","oncolor":"yellow","offvalue":"false","offvalueType":"bool","officon":"fa-power-off fa-3x","offcolor":"red","animate":true,"className":"","x":746,"y":410,"wires":[["988753404774948a"]]},{"id":"1a2a590a.f3c637","type":"rpi-433-sniffer","z":"c101bca7.599e8","pin":"3","pulseLength":0,"debounceDelay":500,"x":126,"y":400,"wires":[["1122becc.087531","ff92f9ab.a0e438"]]},{"id":"1122becc.087531","type":"switch","z":"c101bca7.599e8","name":"Direct on/off codes to outputs","property":"payload.code","propertyType":"msg","rules":[{"t":"eq","v":"2513048","vt":"num"},{"t":"eq","v":"2513044","vt":"num"},{"t":"eq","v":"2489288","vt":"num"},{"t":"eq","v":"2489284","vt":"num"}],"checkall":"false","repair":false,"outputs":4,"x":236,"y":480,"wires":[["27a484ad51fa5cc3"],["d089d5d606f7e5ad"],["b6ff10be17c556fa"],["336149a0b7500d66"]],"outputLabels":["Relay #1 ON","Relay #1 OFF","Relay #2 ON","Relay #2 OFF"]},{"id":"ff92f9ab.a0e438","type":"debug","z":"c101bca7.599e8","name":"From 433 Sniffer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":240,"y":350,"wires":[]},{"id":"27a484ad51fa5cc3","type":"change","z":"c101bca7.599e8","name":"Set Boolean = true","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":536,"y":370,"wires":[["1ae312c0.4f306d","dc018f1a629b13c5"]]},{"id":"d089d5d606f7e5ad","type":"change","z":"c101bca7.599e8","name":"Set Boolean = false","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":536,"y":420,"wires":[["1ae312c0.4f306d","d41f3b5d7447af11"]]},{"id":"95b5f7a8ce8c814c","type":"change","z":"c101bca7.599e8","name":"Change true payload to on code","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"2513048","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":380,"wires":[[]]},{"id":"d8b70704d8141ec7","type":"change","z":"c101bca7.599e8","name":"Change false payload to off code","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"2513044","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":420,"wires":[[]]},{"id":"c64410888385de12","type":"change","z":"c101bca7.599e8","name":"Change true/false to codes","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"2513048","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"false","fromt":"bool","to":"2513044","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1230,"y":500,"wires":[[]]},{"id":"e9d94c90e95b8da6","type":"ui_switch","z":"c101bca7.599e8","name":"","label":"Relay #2","tooltip":"","group":"bd2b5b03.d10418","order":11,"width":5,"height":2,"passthru":true,"decouple":"false","topic":"relay2","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"fa-power-off fa-3x","oncolor":"yellow","offvalue":"false","offvalueType":"bool","officon":"fa-power-off fa-3x","offcolor":"red","animate":true,"className":"","x":736,"y":600,"wires":[["c3e9cdb556b5c059"]]},{"id":"b6ff10be17c556fa","type":"change","z":"c101bca7.599e8","name":"Set Boolean = true","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":536,"y":570,"wires":[["e9d94c90e95b8da6","8119ef26.286b7"]]},{"id":"336149a0b7500d66","type":"change","z":"c101bca7.599e8","name":"Set Boolean = false","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":536,"y":610,"wires":[["e9d94c90e95b8da6","aaeb6699adc097d9"]]},{"id":"aaeb6699adc097d9","type":"exec","z":"c101bca7.599e8","command":"python3 send.py -p 327 -t 1 2489284","addpay":false,"append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"Relay #2 Off","x":826,"y":660,"wires":[[],[],[]]},{"id":"dc018f1a629b13c5","type":"exec","z":"c101bca7.599e8","command":"python3 send.py -p 322 -t 1 2513048","addpay":false,"append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"Relay #1 On","x":826,"y":350,"wires":[[],[],[]]},{"id":"d41f3b5d7447af11","type":"exec","z":"c101bca7.599e8","command":"python3 send.py -p 322 -t 1 2513044","addpay":false,"append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"Relay #1 Off","x":826,"y":470,"wires":[[],[],[]]},{"id":"cd348e41.c1ecf","type":"rpi-433-emitter","z":"c101bca7.599e8","pin":"0","pulseLength":"321","protocol":"0","x":1200,"y":460,"wires":[]},{"id":"6809c84c9a66e2c9","type":"mqtt out","z":"c101bca7.599e8","name":"","topic":"relay1","qos":"","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"2794b5e1.11f17a","x":1096,"y":650,"wires":[]},{"id":"bed29a59ed3f253a","type":"mqtt in","z":"c101bca7.599e8","name":"","topic":"relay1","qos":"2","datatype":"auto","broker":"2794b5e1.11f17a","nl":false,"rap":true,"rh":0,"inputs":0,"x":1206,"y":650,"wires":[[]]},{"id":"988753404774948a","type":"switch","z":"c101bca7.599e8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":876,"y":410,"wires":[["dc018f1a629b13c5"],["d41f3b5d7447af11"]]},{"id":"c3e9cdb556b5c059","type":"switch","z":"c101bca7.599e8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":876,"y":600,"wires":[["8119ef26.286b7"],["aaeb6699adc097d9"]]},{"id":"bd2b5b03.d10418","type":"ui_group","name":"Outside Lights","tab":"d6a000ae.859cc","order":1,"disp":true,"width":18,"collapse":false},{"id":"2794b5e1.11f17a","type":"mqtt-broker","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":4,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"d6a000ae.859cc","type":"ui_tab","name":"Lights-Exterior","icon":"lightbulb_outline","order":5,"disabled":false,"hidden":false}]

Still trying to decide which code send method is more reliable, calling my Python script, or using the rpi-433 emitter.

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