Making progress, but since the UI switch needs to activate the relay via my python script sending the 433mhz signal the flow goes into a loop of on/off as the rtl_433 sees that 433mhz send when the UI switch is changed. I tried some delays, but that negates the seamless UI update and/or delays the relay on/off. Any ideas?
[{"id":"18e8e789.778a08","type":"tab","label":"Translate 433mhz","disabled":false,"info":""},{"id":"68134d2b.4fc204","type":"debug","z":"18e8e789.778a08","name":"From rtl_433","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":110,"y":80,"wires":[]},{"id":"31e8fc24.42c854","type":"rtl_433","z":"18e8e789.778a08","name":"","device":"","frequency":"","protocols":"","x":90,"y":20,"wires":[["68134d2b.4fc204","a153d738.c85908"]]},{"id":"a153d738.c85908","type":"switch","z":"18e8e789.778a08","name":"","property":"payload.code","propertyType":"msg","rules":[{"t":"eq","v":"450513","vt":"str"},{"t":"eq","v":"8529fb","vt":"str"},{"t":"eq","v":"2529fb","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":290,"y":35.5,"wires":[["98768616.8d5188"],["51f1aacb.c56824"],["6c42780f.3f0e48"]]},{"id":"2f917e27.809da2","type":"mqtt out","z":"18e8e789.778a08","name":"","topic":"Relay_1","qos":"0","retain":"true","broker":"98e43eb6.346e2","x":580,"y":40,"wires":[]},{"id":"38d8e069.8596d","type":"ui_switch","z":"18e8e789.778a08","name":"","label":"Relay #1","tooltip":"","group":"dce9e7a2.d20c78","order":4,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":864,"y":160,"wires":[["306abda4.e31ad2","cd668987.36ce98"]]},{"id":"306abda4.e31ad2","type":"change","z":"18e8e789.778a08","name":"copy msg.payload --> flow.relay1","rules":[{"t":"set","p":"relay1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":804,"y":240,"wires":[[]]},{"id":"cd668987.36ce98","type":"exec","z":"18e8e789.778a08","command":"python3 send.py -p 367 -t 1 13148322","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Relay #1 Send Code","x":1080,"y":160,"wires":[[],[],[]]},{"id":"98768616.8d5188","type":"change","z":"18e8e789.778a08","name":"copy flow.relay1 --> msg.payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"relay1","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":184,"y":160,"wires":[["d81f173e.5ee2b8","afa62b39.2c6098"]]},{"id":"d81f173e.5ee2b8","type":"switch","z":"18e8e789.778a08","name":"is payload true or false?","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":457,"y":160,"wires":[["f5f80e84.274ab"],["b9f164e3.15b8b8"]]},{"id":"b9f164e3.15b8b8","type":"change","z":"18e8e789.778a08","name":"if false, set to true","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":684,"y":180,"wires":[["38d8e069.8596d"]]},{"id":"f5f80e84.274ab","type":"change","z":"18e8e789.778a08","name":"if true, set to false","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":684,"y":140,"wires":[["38d8e069.8596d"]]},{"id":"e424bb0.13bf448","type":"ui_switch","z":"18e8e789.778a08","name":"","label":"Relay #2","tooltip":"","group":"dce9e7a2.d20c78","order":4,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":864,"y":320,"wires":[["3a3857ba.4f26d8"]]},{"id":"3a3857ba.4f26d8","type":"change","z":"18e8e789.778a08","name":"copy msg.payload --> flow.relay2","rules":[{"t":"set","p":"relay2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":804,"y":400,"wires":[[]]},{"id":"51f1aacb.c56824","type":"change","z":"18e8e789.778a08","name":"copy flow.relay2 --> msg.payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"relay2","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":184,"y":320,"wires":[["7fa2de29.568a7"]]},{"id":"7fa2de29.568a7","type":"switch","z":"18e8e789.778a08","name":"is payload true or false?","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":457,"y":320,"wires":[["8b9b6c87.31283"],["b767b732.b24208"]]},{"id":"b767b732.b24208","type":"change","z":"18e8e789.778a08","name":"if false, set to true","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":684,"y":340,"wires":[["e424bb0.13bf448"]]},{"id":"8b9b6c87.31283","type":"change","z":"18e8e789.778a08","name":"if true, set to false","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":684,"y":300,"wires":[["e424bb0.13bf448"]]},{"id":"91ed0081.468b1","type":"ui_switch","z":"18e8e789.778a08","name":"","label":"Relay #3","tooltip":"","group":"dce9e7a2.d20c78","order":4,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":864,"y":480,"wires":[["fafae55a.39ab68"]]},{"id":"fafae55a.39ab68","type":"change","z":"18e8e789.778a08","name":"copy msg.payload --> flow.relay3","rules":[{"t":"set","p":"relay3","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":804,"y":560,"wires":[[]]},{"id":"6c42780f.3f0e48","type":"change","z":"18e8e789.778a08","name":"copy flow.relay3 --> msg.payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"relay3","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":184,"y":480,"wires":[["c748a6a4.1998b8"]]},{"id":"c748a6a4.1998b8","type":"switch","z":"18e8e789.778a08","name":"is payload true or false?","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":457,"y":480,"wires":[["734d2956.3af778"],["1ed2c16c.91c21f"]]},{"id":"1ed2c16c.91c21f","type":"change","z":"18e8e789.778a08","name":"if false, set to true","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":684,"y":500,"wires":[["91ed0081.468b1"]]},{"id":"734d2956.3af778","type":"change","z":"18e8e789.778a08","name":"if true, set to false","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":684,"y":460,"wires":[["91ed0081.468b1"]]},{"id":"afa62b39.2c6098","type":"debug","z":"18e8e789.778a08","name":"relay 1 state","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":350,"y":240,"wires":[]},{"id":"98e43eb6.346e2","type":"mqtt-broker","name":"P-Pi-Gibson","broker":"192.168.1.101","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"dce9e7a2.d20c78","type":"ui_group","name":"Object detection","tab":"5132060d.4cde48","order":1,"disp":true,"width":"7","collapse":false},{"id":"5132060d.4cde48","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]