As a follow-up to the How to sync ui-switch with global.variable, the sync only only works in one direction, from switch to global variable, but note vice versa. Any suggestion of how to make it work in both directions?
[{"id":"85f73f8b.75843","type":"ui_switch","z":"5ce1ba35.e70844","name":"","label":"switch1","tooltip":"","group":"7d6bc9d7.e86ff8","order":0,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"topic","topicType":"msg","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":false,"x":1640,"y":1000,"wires":[["8dfdf81f.377ce8"]]},{"id":"8dfdf81f.377ce8","type":"change","z":"5ce1ba35.e70844","name":"","rules":[{"t":"set","p":"varTest1","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1840,"y":1000,"wires":[["85f73f8b.75843"]]},{"id":"f8cad404.4500f8","type":"change","z":"5ce1ba35.e70844","name":"","rules":[{"t":"set","p":"varTest1","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1850,"y":1080,"wires":[[]]},{"id":"f9e97d99.dabb1","type":"inject","z":"5ce1ba35.e70844","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":1630,"y":1080,"wires":[["f8cad404.4500f8"]]},{"id":"d8ddfdb4.23cb","type":"inject","z":"5ce1ba35.e70844","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":1630,"y":1140,"wires":[["f8cad404.4500f8"]]},{"id":"ec871ba7.2cc968","type":"inject","z":"5ce1ba35.e70844","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":1640,"y":1200,"wires":[["b796a4cd.65bcd8"]]},{"id":"135b7996.cf8706","type":"debug","z":"5ce1ba35.e70844","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":2010,"y":1200,"wires":[]},{"id":"b796a4cd.65bcd8","type":"change","z":"5ce1ba35.e70844","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"varTest1","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1820,"y":1200,"wires":[["135b7996.cf8706"]]},{"id":"7d6bc9d7.e86ff8","type":"ui_group","name":"Group 1","tab":"8375fe35.96f7","order":1,"disp":true,"width":6},{"id":"8375fe35.96f7","type":"ui_tab","name":"Problem","icon":"dashboard","order":14,"disabled":false,"hidden":false}]