I have just installed this node:
I also have a 3 point power board.
With brute force I can control all three points, but this node looks nicer as it gives feedback better than what I can do.
Alas I can only get it working on the first power point. How do I get the second and third ones controlled?
I was trying with the msg.topic
but that doesn't seem to work.
This is the flow which I use to control all three.
[{"id":"89f68b43.91be9","type":"mqtt out","z":"9245b569.9f881","name":"","topic":"","qos":"","retain":"","broker":"8a2e80be.f7c928","x":620,"y":1730,"wires":[]},{"id":"5e0ef4a2.9acb64","type":"inject","z":"9245b569.9f881","name":"Relay 1 on","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1570,"wires":[["411e6b81.f9b094"]]},{"id":"7c8fe55b.5f0014","type":"mqtt in","z":"9245b569.9f881","name":"","topic":"stat/BAUHN-1/RESULT/#","qos":"2","datatype":"auto","broker":"8a2e80be.f7c928","x":240,"y":1990,"wires":[["cf12eaa8.eeb75"]]},{"id":"cf12eaa8.eeb75","type":"debug","z":"9245b569.9f881","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":470,"y":1990,"wires":[]},{"id":"411e6b81.f9b094","type":"change","z":"9245b569.9f881","name":"Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"cmnd/BAUHN-1/power1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1570,"wires":[["89f68b43.91be9"]]},{"id":"95e63238.856a18","type":"inject","z":"9245b569.9f881","name":"Relay 1 off","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1530,"wires":[["411e6b81.f9b094"]]},{"id":"4a405b28.1f358c","type":"change","z":"9245b569.9f881","name":"Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"cmnd/BAUHN-1/power2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1730,"wires":[["89f68b43.91be9"]]},{"id":"5b52550a.e1cda4","type":"inject","z":"9245b569.9f881","name":"Relay 1 toggle","topic":"","payload":"toggle","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":1490,"wires":[["411e6b81.f9b094"]]},{"id":"e93f9b85.3be278","type":"comment","z":"9245b569.9f881","name":"Power point 1","info":"","x":400,"y":1530,"wires":[]},{"id":"31ed400a.bb1cc","type":"comment","z":"9245b569.9f881","name":"Power point 2","info":"","x":400,"y":1690,"wires":[]},{"id":"b0db65c.9540998","type":"inject","z":"9245b569.9f881","name":"Relay 2 on","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1730,"wires":[["4a405b28.1f358c"]]},{"id":"27a89635.8ac80a","type":"inject","z":"9245b569.9f881","name":"Relay 2 off","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1690,"wires":[["4a405b28.1f358c"]]},{"id":"4c0f966a.29b3d","type":"inject","z":"9245b569.9f881","name":"Relay 2 toggle","topic":"","payload":"toggle","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":1650,"wires":[["4a405b28.1f358c"]]},{"id":"7651561e.93b0e","type":"change","z":"9245b569.9f881","name":"Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"cmnd/BAUHN-1/power3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1890,"wires":[["89f68b43.91be9"]]},{"id":"f810191a.c6888","type":"comment","z":"9245b569.9f881","name":"Power point 3","info":"","x":400,"y":1850,"wires":[]},{"id":"7610c78f.a7dca8","type":"inject","z":"9245b569.9f881","name":"Relay 3 on","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1890,"wires":[["7651561e.93b0e"]]},{"id":"bb3c97b.fdfde68","type":"inject","z":"9245b569.9f881","name":"Relay 3 off","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1850,"wires":[["7651561e.93b0e"]]},{"id":"bd7ed733.28ee18","type":"inject","z":"9245b569.9f881","name":"Relay 3 toggle","topic":"","payload":"toggle","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":1810,"wires":[["7651561e.93b0e"]]},{"id":"a8832b05.3c548","type":"comment","z":"9245b569.9f881","name":"","info":"","x":440,"y":1480,"wires":[]},{"id":"fc2b0448.9f6db","type":"inject","z":"9245b569.9f881","name":"Relay 1 status","topic":"","payload":"status","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":1610,"wires":[["411e6b81.f9b094"]]},{"id":"4044e30f.21fe14","type":"inject","z":"9245b569.9f881","name":"Relay 2 status","topic":"","payload":"status","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":1770,"wires":[["4a405b28.1f358c"]]},{"id":"82462faa.bef36","type":"inject","z":"9245b569.9f881","name":"Relay 3 status","topic":"","payload":"status","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":1930,"wires":[["7651561e.93b0e"]]},{"id":"8a2e80be.f7c928","type":"mqtt-broker","z":"","name":"MQTT host","broker":"192.168.0.99","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"ARDUINO_STATUS","birthQos":"2","birthPayload":"connected","willTopic":"ARDUINO_STATUS","willQos":"0","willPayload":"disconnected"}]
Given that works, I wrote this:
[{"id":"7c474bc5.7fe634","type":"Sonoff device","z":"9245b569.9f881","mode":"0","broker":"8a2e80be.f7c928","device":"BAUHN-1","name":"","onValue":"ON","offValue":"OFF","cmdPrefix":"cmnd","statPrefix":"stat","telePrefix":"tele","x":360,"y":2860,"wires":[["ed31c6ad.8176f8"]]},{"id":"c3382a43.b13c38","type":"inject","z":"9245b569.9f881","name":"On","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":2840,"wires":[["7c474bc5.7fe634"]]},{"id":"92ba4105.786ec8","type":"inject","z":"9245b569.9f881","name":"Off","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":2890,"wires":[["7c474bc5.7fe634"]]},{"id":"ddf086d3.c5de4","type":"Sonoff device","z":"9245b569.9f881","mode":"0","broker":"8a2e80be.f7c928","device":"BAUHN-1","name":"","onValue":"ON","offValue":"OFF","cmdPrefix":"cmnd","statPrefix":"stat","telePrefix":"tele","x":360,"y":2960,"wires":[["7d6012a1.bf44d4"]]},{"id":"8d846d95.00538","type":"inject","z":"9245b569.9f881","name":"On","topic":"power2","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":2940,"wires":[["ddf086d3.c5de4"]]},{"id":"2133f537.f9a58a","type":"inject","z":"9245b569.9f881","name":"Off","topic":"power2","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":2990,"wires":[["ddf086d3.c5de4"]]},{"id":"ed31c6ad.8176f8","type":"debug","z":"9245b569.9f881","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":520,"y":2860,"wires":[]},{"id":"7d6012a1.bf44d4","type":"debug","z":"9245b569.9f881","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":520,"y":2960,"wires":[]},{"id":"8a2e80be.f7c928","type":"mqtt-broker","z":"","name":"MQTT host","broker":"192.168.0.99","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"ARDUINO_STATUS","birthQos":"2","birthPayload":"connected","willTopic":"ARDUINO_STATUS","willQos":"0","willPayload":"disconnected"}]
But it only controls output #1.