Xlights E1.131 to RGB Smart Light Bulbs
Using Xlights to Control Smart RGB Blubs in Home Assistant
Requirements
How to:
Xlights:
Add Ethernet Controller
- Set IP Address of the Node Red Server - Mine is the same as Home Assistant
- Set Protocol to E131
- Set Start Universe - I used 100
Save
Go to Layout in XLights
- Add Candy Cane Model (This will give the visual of a light bulb on your layout)
- Set # Canes to 1
- Set Nodes Per Cane to 1
- Set Start Channel as Universe 100
- Set String Type to 3 Channel RGB
- Set Under Appearance Pixel Size to 15
Save
For Additional lights repeat the above, except set the Start Channel as the End of Model last model you create above.
Node Red:
- Import Flow
- In the Function Node Change the entity_id to match lights you want to control in Home Assistant
[{"id":"2567173b59f28a64","type":"sacn_in","z":"2556402e.c9ba2","name":"Universe 100","universe":"100","interval":100,"x":110,"y":960,"wires":[["7ec58827.67bf78"]]},{"id":"189d52df0f1483c0","type":"comment","z":"2556402e.c9ba2","name":"Set as Xlights Universe","info":"","x":140,"y":900,"wires":[]},{"id":"7ec58827.67bf78","type":"function","z":"2556402e.c9ba2","name":"Function E1.31 Data channels to smart bulb","func":"//Xlights\n//Set Controller to Universe 100\n\n//Set Layout / Model\n// Start Channel Univesre 100, String Type 3 Channel RGB \n\n//Channels 1-3 - Light #1\nchannel1red = msg.payload[0]\nchannel1green = msg.payload[1]\nchannel1blue = msg.payload[2]\nchannel1 = {payload:{topic:\"Channel 1\", service: \"turn_on\", data: { entity_id: \"light.front_porch_light_2\", 'brightness': 255, 'rgb_color': [channel1red,channel1green,channel1blue] }} };\n\n//Set Layout / Model\n// Start Channel End of Channel 1 Model, String Type 3 Channel RGB \n//Channels 4-6 - Light #2\nchannel2red = msg.payload[3]\nchannel2green = msg.payload[4]\nchannel2blue = msg.payload[5]\nchannel2 = {payload:{topic:\"Channel 2\", service: \"turn_on\", data: { entity_id: \"light.garage_door_left_lt\", 'brightness': 255, 'rgb_color': [channel2red,channel2green,channel2blue] }} };\n\n//Set Layout / Model\n// Start Channel End of Channel 2 Model, String Type 3 Channel RGB \n//Channels 7-9 Light #3\nchannel3red = msg.payload[6]\nchannel3green = msg.payload[7]\nchannel3blue = msg.payload[8]\nchannel3 = {payload:{topic:\"Channel 3\", service: \"turn_on\", data: { entity_id: \"light.garage_door_right_lt\", 'brightness': 255, 'rgb_color': [channel3red,channel3green,channel3blue] }} };\n\nreturn [channel1, channel2, channel3]","outputs":3,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":960,"wires":[["5f4ad7c0dd1adee1"],["1b050a82a624d46f"],["caea791fd37024cb"]]},{"id":"ca70242227ea4cf8","type":"comment","z":"2556402e.c9ba2","name":"Change the Enitiy_Id to match your lights","info":"","x":438.6666564941406,"y":894.3333129882812,"wires":[]},{"id":"63a4073c6856585a","type":"comment","z":"2556402e.c9ba2","name":"Blocks Duplicate Messages","info":"","x":820,"y":880,"wires":[]},{"id":"5f4ad7c0dd1adee1","type":"rbe","z":"2556402e.c9ba2","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":810,"y":920,"wires":[["dc0cdd26.8162e"]]},{"id":"1b050a82a624d46f","type":"rbe","z":"2556402e.c9ba2","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":810,"y":960,"wires":[["dc0cdd26.8162e"]]},{"id":"caea791fd37024cb","type":"rbe","z":"2556402e.c9ba2","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":810,"y":1000,"wires":[["dc0cdd26.8162e"]]},{"id":"dc0cdd26.8162e","type":"api-call-service","z":"2556402e.c9ba2","name":"Light Service Node","server":"c33123cf.c144e","version":3,"debugenabled":false,"service_domain":"light","service":"{{payload.service}}","entityId":"{{payload.data.entity_id}}","data":"","dataType":"json","mergecontext":"","mustacheAltTags":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","x":1030,"y":960,"wires":[[]]},{"id":"c33123cf.c144e","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]