Loxone 2 Conbee HUE

This flow connects Loxone Light Controller version 2 using web socket to HUE bulb connected using Conbee v2 USB stick on RPI

You need to install following contrib to be able to connect NodeRed with Loxone miniserver version 1. Miniserver version 2 is not yet supported, because of HTTPS communication by the node-red-contrib-loxone forked from node-lox-ws-api

In Loxone: just configure a LightControllerV2 and set the outputs to RGB format In Node-RED :

  1. configure Loxone Control-IN to connect to LightControllerV2 you set up
  2. configure Deconz-OUT and set input to JSON object msg.payload

thx to @sstroot on https://gist.github.com/sstroot/a2be61a889a6e6712fa0591ab1a69e35 for inspiration! :)

[{"id":"7be55345.48bebc","type":"subflow","name":"Loxone2HUE","info":"","category":"","in":[{"x":327.5,"y":307,"wires":[{"id":"525c492b.7ab478"}]}],"out":[{"x":1237.5,"y":319,"wires":[{"id":"ebbc239d.76c84","port":0},{"id":"467ba87f.00d8e8","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"ebbc239d.76c84","type":"function","z":"7be55345.48bebc","name":"COLOR","func":"msg.payload = msg.payload.replace(\"hsv(\", \"\").replace(\")\", \"\").split(\",\");\n\nvar hue = Number(msg.payload[0]) * 65500 / 360;\nvar sat = Number(msg.payload[1]) * 255 /100;\nvar bri = Number(msg.payload[2]) * 255 /100 ;\nvar time = 5; \n\nif (bri == '0') {\n  return { payload: { on: false } };\n}\n\nmsg.payload = {\"on\":true,\"bri\":bri,\"hue\":hue,\"sat\":sat,\"transitiontime\":time};\nreturn msg;","outputs":1,"noerr":0,"x":740,"y":220,"wires":[[]]},{"id":"525c492b.7ab478","type":"switch","z":"7be55345.48bebc","name":"White or Color","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"hsv(","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":520,"y":300,"wires":[["ebbc239d.76c84"],["467ba87f.00d8e8"]]},{"id":"467ba87f.00d8e8","type":"function","z":"7be55345.48bebc","name":"WHITE","func":"var bri = msg.payload * 255 /100 ;\nvar time = 5;\n\nif (bri == '0') {\n  return { payload: { on: false } };\n}\n\nmsg.payload = {\"on\":true,\"bri\":bri,\"transitiontime\":time};\nreturn msg;","outputs":1,"noerr":0,"x":740,"y":340,"wires":[[]]},{"id":"8616366c.b009a8","type":"subflow:7be55345.48bebc","z":"a3b8df88.2aea9","name":"","env":[],"x":350,"y":60,"wires":[["2e5982c5.68504e"]]}]

Flow Info

Created 11 months, 2 weeks ago
Updated 2 weeks, 6 days ago
Rating: not yet rated

Owner

Node Types

Core
  • function (x2)
  • subflow (x1)
  • switch (x1)
Other
  • subflow:7be55345.48bebc (x1)

Tags

  • loxone
  • hue
  • websocket
  • conbee
  • deconz
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option