Hi E1cid,
I''m trying to make it work with the switch node. I added the change node behind it but it doesnt seems to work. Can you have a look at my code and see what i did wrong?
[{"id":"8ac9cc28.ef381","type":"ui_button","z":"48518d4f.6375e4","name":"","group":"ddc011ab.654ef","order":1,"width":0,"height":0,"passthru":false,"label":"button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"button1","payloadType":"flow","topic":"","x":770,"y":360,"wires":[["924dfabf.0070a8"]]},{"id":"924dfabf.0070a8","type":"function","z":"48518d4f.6375e4","name":"","func":"let button1 = flow.get(\"button1\");\nmsg.payload = button1 === \"on\" ? \"off\" : \"on\";\nflow.set(\"button1\", msg.payload);\nmsg.topic = \"homie/homey-topic/fireplace\"+msg.payload\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1010,"y":360,"wires":[["cb97940.21f4c7","6d199caf.958224"]]},{"id":"cb97940.21f4c7","type":"debug","z":"48518d4f.6375e4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1210,"y":400,"wires":[]},{"id":"6d199caf.958224","type":"mqtt out","z":"48518d4f.6375e4","name":"MQTT Transmitter","topic":"","qos":"","retain":"","broker":"d094d3b7.a558a8","x":1210,"y":460,"wires":[]},{"id":"d83370d1.cdf99","type":"change","z":"48518d4f.6375e4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"topic","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":960,"y":420,"wires":[["6d199caf.958224","cb97940.21f4c7"]]},{"id":"b8232141.96144","type":"ui_switch","z":"48518d4f.6375e4","name":"","label":"","tooltip":"","group":"ddc011ab.654ef","order":2,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"homie/homey-topic/fireplaceon","onvalueType":"str","onicon":"iconify-ic:baseline-local-fire-department","oncolor":"yellow","offvalue":"homie/homey-topic/fireplaceoff","offvalueType":"str","officon":"iconify-ic:baseline-local-fire-department","offcolor":"orange","x":770,"y":400,"wires":[["d83370d1.cdf99"]]},{"id":"ddc011ab.654ef","type":"ui_group","name":"Group 1","tab":"bcf02f19.c8136","order":1,"disp":false,"width":15,"collapse":false},{"id":"d094d3b7.a558a8","type":"mqtt-broker","name":"Homey MQTT","broker":"192.168.178.83","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"bcf02f19.c8136","type":"ui_tab","name":"Music","icon":"my_library_music","order":5,"disabled":false,"hidden":false}]