I have RGBWW Wifi Controler from MagicHome. I can control these with the app, GoogleHome and openHAB. That works very well !.
For Node Red I installed "node-red-contrib-magic-home-local" and configured the correct device in each node.
But, only the "on / off" node can be switched ON and goes OFF again after a few seconds.
Debug shows the following:
"on/off" Node,
{"payload":true,"input":{"_msgid":"3b7db03f.35101","topic":"","payload":true},"_msgid":"15789ffa.2b289"}
{"payload":true,"input":{"_msgid":"6d9146b4.b5a1d8","topic":"","payload":false},"_msgid":"44f4fade.7ee104"}
"status", only returns "false" when debugging
{"payload":{"type":4,"on":false,"mode":"color","pattern":null,"speed":90,"color":{"red":255,"green":255,"blue":255},"warm_white":0,"cold_white":0},"input":true,"_msgid":"fdd752e2.51652}
{"payload":{"type":4,"on":false,"mode":"color","pattern":null,"speed":90,"color":{"red":255,"green":255,"blue":255},"warm_white":0,"cold_white":0},"input":false,"_msgid":"da81cf32.e9b0}
"rgb/ww/cw" only "true"
{"payload":true,"input":{"_msgid":"f9fc0a6f.177448","topic":"","payload":true},"_msgid":"5609a756.fc2c58"}
{"payload":true,"input":{"_msgid":"d1363d51.22e59","topic":"","payload":false},"_msgid":"d710e093.7827e"}
"pattern" also just "true"
{"payload":true,"input":{"_msgid":"d41cce3c.5d5ac","topic":"","payload":true},"_msgid":"5ab119a7.83f5a8"}
{"payload":true,"input":{"_msgid":"6dd4f02.8f1aa1","topic":"","payload":false},"_msgid":"c8c863ae.6bc7e"}
My first question: how do I have to switch the nodes so that they switch "true" and "false"?
My second question: how can I change RGB, warm_white and cold_white?
If I use a "function" node, I always get an error message:
"SyntaxError: Unexpected token {"
Content of my "function" node:
msg.payload=color {"red":255,"green":0,"blue":0"}
return msg;
Thanks for reading and have a healthy week ...
[{"id":"8033cc2c.3f8c7","type":"tab","label":"magichome_1","disabled":false,"info":""},{"id":"4bfc8913.ddddf8","type":"inject","z":"8033cc2c.3f8c7","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1170,"y":200,"wires":[["a8dc764a.7ca6d8"]]},{"id":"9ea1141d.e14e78","type":"inject","z":"8033cc2c.3f8c7","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1170,"y":280,"wires":[["a8dc764a.7ca6d8"]]},{"id":"99fbaa25.545938","type":"debug","z":"8033cc2c.3f8c7","name":"on/off IPx89 ","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1530,"y":240,"wires":[]},{"id":"a8dc764a.7ca6d8","type":"magic-home-on","z":"8033cc2c.3f8c7","name":"on/off IPx89 ","device":"192.168.178.89","x":1350,"y":240,"wires":[["99fbaa25.545938"]]},{"id":"b51e86cb.a115d8","type":"magic-home-status","z":"8033cc2c.3f8c7","name":"status IPx89 ","device":"192.168.178.89","x":1350,"y":80,"wires":[["3e21b813.654cd8"]]},{"id":"ed3740de.542cc","type":"inject","z":"8033cc2c.3f8c7","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1170,"y":60,"wires":[["b51e86cb.a115d8"]]},{"id":"517f6968.4c3af8","type":"inject","z":"8033cc2c.3f8c7","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1170,"y":120,"wires":[["b51e86cb.a115d8"]]},{"id":"3e21b813.654cd8","type":"debug","z":"8033cc2c.3f8c7","name":"status IPx89 ","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1530,"y":80,"wires":[]},{"id":"8e7b7cc.b5d248","type":"function","z":"8033cc2c.3f8c7","name":"red","func":"msg.payload=color {\"red\":255,\"green\":0,\"blue\":0\"}\nreturn msg;","outputs":1,"noerr":12,"x":930,"y":260,"wires":[[]]},{"id":"c24f6a37.62a128","type":"magic-home-rgbcw","z":"8033cc2c.3f8c7","name":"rgbww IPx89 ","device":"192.168.178.89","x":1350,"y":400,"wires":[["27e35aba.2b7b56"]]},{"id":"27e35aba.2b7b56","type":"debug","z":"8033cc2c.3f8c7","name":"rgbww IPx89 ","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1530,"y":400,"wires":[]},{"id":"90e8f8b4.c80d98","type":"magic-home-pattern","z":"8033cc2c.3f8c7","name":"pattern IPx89","device":"192.168.178.89","pattern":"purple_gradual_change","speed":"100","x":1350,"y":560,"wires":[["35341585.51c57a"]]},{"id":"73cab779.80b598","type":"inject","z":"8033cc2c.3f8c7","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1170,"y":520,"wires":[["90e8f8b4.c80d98"]]},{"id":"84bda5b0.4c78c8","type":"inject","z":"8033cc2c.3f8c7","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1170,"y":600,"wires":[["90e8f8b4.c80d98"]]},{"id":"35341585.51c57a","type":"debug","z":"8033cc2c.3f8c7","name":"pattern IPx89 ","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1530,"y":560,"wires":[]},{"id":"65028c41.2d3a34","type":"inject","z":"8033cc2c.3f8c7","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1170,"y":360,"wires":[["c24f6a37.62a128"]]},{"id":"ae152473.efc998","type":"inject","z":"8033cc2c.3f8c7","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1170,"y":440,"wires":[["c24f6a37.62a128"]]}]