Hi, I am fairly new to Node Red but have managed to configure a number of Shelly Gen1 Devices to control lighting. I now have a Gen2 device and the MQTT structure is entirly different and I am a bit stuck.
I have my input MQTT subscribed to the topic shellyplus1-a8032abd78a0/events/rpc which seems to work as I can see items appearing in the debug window when I press the switch connected to the shelly. However when I run the below flow it doesnt do anything so there must be somethign wrong with my logic
Any help would be greatly appreciated
cheers
[{"id":"3b526e4b9eaed659","type":"tab","label":"Master Bedroom","disabled":false,"info":""},{"id":"8b6ebd648cdf2ca2","type":"node-lifx-in","z":"3b526e4b9eaed659","server":"396bbcdbf33a4c89","name":"Master Bedroom LifX","lightID":"d073d52d2bb8","x":680,"y":280,"wires":[]},{"id":"2e9c027016b6159e","type":"mqtt in","z":"3b526e4b9eaed659","name":"Input status","topic":"shellyplus1-a8032abd78a0/events/rpc","qos":"2","datatype":"json","broker":"2fd5bebaac766e96","nl":false,"rap":false,"x":130,"y":280,"wires":[["169b43a126bb7e7f"]]},{"id":"d1372af601a04d86","type":"comment","z":"3b526e4b9eaed659","name":"mqtt","info":"","x":110,"y":190,"wires":[]},{"id":"faf0c79fa1570f2a","type":"function","z":"3b526e4b9eaed659","name":"","func":"const Switch = msg.payload.params[\"input:0\"].State\n\nif (Switch =='true')\n{\n msg.payload=true \n}\n if (Switch =='false')\n{\n msg.payload=false \n}\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":280,"wires":[["8b6ebd648cdf2ca2","450888c621532251"]]},{"id":"775b4629a399ca07","type":"comment","z":"3b526e4b9eaed659","name":"Description","info":"uses mqtt from Shelly switch to command the LifX bulb","x":1090,"y":200,"wires":[]},{"id":"169b43a126bb7e7f","type":"rbe","z":"3b526e4b9eaed659","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":310,"y":280,"wires":[["faf0c79fa1570f2a"]]},{"id":"a5937025617e9404","type":"function","z":"3b526e4b9eaed659","name":"","func":"if(msg.payload.params[\"input:0\"].state==true)\n{\n msg.payload=true\n}\n\nif(msg.payload.params[\"input:0\"].state==false)\n{\n msg.payload=false\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":200,"wires":[[]]},{"id":"450888c621532251","type":"debug","z":"3b526e4b9eaed659","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":690,"y":400,"wires":[]},{"id":"396bbcdbf33a4c89","type":"node-lifx-server","name":"Lifx Server","address":"","broadcast":"","lights":"","interval":"10000"},{"id":"2fd5bebaac766e96","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]