Keine Ankündigung bisher.

how can i link loxone to milight v6 via node-red?

  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • how can i link loxone to milight v6 via node-red?

    i have managed to add the loxone-contrib node-red on a Pi 3 and get it all running - i can drop the output of a light controller rgb output onto the node-red desktop, and i can add the milight v6 control as well as an output, but how do i convert the data and link them up in node-red so that a light block output set to rgb will control milight bulbs via the new v6 ibox2?


  • #2
    Hi Duncan,
    can you describe in more detail, which kind of data you want to convert into wich other kind of data?
    Some examples would be helpful.
    Since this seems more like a node-red specific question, you might want to have a look at the node-red forum, if you find no answer here.

    Good luck
    Loxone-Installation mit mehreren Extensions, Dimmer-Extension, DMX, 1-Wire (alles aktuell noch im Auslieferungszustand);
    FritzBox, Netgear Plus Switch mit mehreren VLANs, Intel NUC mit VMWare ESXi 6.5 (pfSense, Loxberry, Kleinkram)


    • #3
      im trying to connect the modern milights v6 ibox2 device to a loxone lighting block (old type 1) - one of the light outputs (lets say AQ1 is set to type rgb in loxone), so loxone can control the milights as part of a lighting scene.

      ive set up mode-red and connected successfully to my loxone, so ive added the AQ1 output of the lighting block into node-red - if i connect it to a UI colour picker in node-red i can see the colour selection and brightness of the loxone output in the node-red ui in real time as i use the loxone app to choose a colour, so all good so far. Node-red ui shows the loxone rgb data as hsv and ive visualised the values as text to see whats coming out of the loxone link. ive also added a hsv to rgb converter but that doesnt seem to work - nothing changes in the node-red ui for the rgb visu

      im wondering why the conversion to rgb doesnt seem to work - the rgb colour wheel in the ui doesnt change, even though the hsv colour wheel shows the correct colours coming from my loxone output.
      ive also added milight to node-red and am trying to work out what conversion if any is needed from the hsv data to feed the milight input
      Zuletzt geändert von duncan; 11.Sep.2018, 12:19.


      • #4
        This is now mainly general node-red troubleshooting.
        Did you try to connect a debug node to the output of the "HSV > RGB" conversion node?
        Usually I would expect some kind of incorrect type conversion or something similar. In my usual cases several debug nodes at critical places work wonders.

        In fact I have absolutely no idea, which types of input / output values are needed for the different colour pickers and systems.
        For me this would be trial and error as it will be probably the same for you.

        Good luck
        Loxone-Installation mit mehreren Extensions, Dimmer-Extension, DMX, 1-Wire (alles aktuell noch im Auslieferungszustand);
        FritzBox, Netgear Plus Switch mit mehreren VLANs, Intel NUC mit VMWare ESXi 6.5 (pfSense, Loxberry, Kleinkram)


        • #5
          thanks - ill try a debug node

          i searched node-red forums but didnt find anything to answer my rather specific question unfortunately


          • #6
            I did some tests with a DIY Milight Bridge with Loxberry and Node-Red.

            DIY Milight Bridge with an ESP8266 and an NRF Module:

            My Node-Red Flow:

            [{"id":"9cc49064.31414","type":"loxone-control-in","z":"50e9357a.2d090c","name":"","miniserver":"6c519746.372168","control":"11c90b5d-0377-2d9d-ffff761d01bc84b4/AI1","state":"11c90b5d-0377-2d86-ffff3b174529246a","x":160,"y":1080,"wires":[["637802f6.3b79ec"]]},{"id":"13d7ed34.071743","type":"loxone-control-out","z":"50e9357a.2d090c","name":"","miniserver":"6c519746.372168","control":"11c90b5d-0377-2d9d-ffff761d01bc84b4/AI1","x":930,"y":860,"wires":[]},{"id":"edc26b5f.43de58","type":"ui_colour_picker","z":"50e9357a.2d090c","name":"","label":"","group":"2b3d2bbe.707d34","format":"hsv","outformat":"object","showSwatch":true,"showPicker":false,"showValue":false,"showAlpha":false,"showLightness":true,"order":0,"width":0,"height":0,"passthru":false,"topic":"","x":460,"y":860,"wires":[["9a6db691.1d67f8"]]},{"id":"9a6db691.1d67f8","type":"function","z":"50e9357a.2d090c","name":"Loxone HSV Converter","func":"var hsvstring =\"\";\n\nvar h = Math.round(msg.payload.h);\nvar s = Math.round(msg.payload.s*100);\nvar v = Math.round(msg.payload.v*100);\n\nhsvstring = \"hsv(\" + h + \",\" + s +\",\" + v + \")\";\nmsg.payload = hsvstring;\n\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":860,"wires":[["13d7ed34.071743"]]},{"id":"582c6835.b29c68","type":"exec","z":"50e9357a.2d090c","command":"curl  -X POST -H \"Content-Type:application/json\" ","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":1200,"y":1060,"wires":[[],[],[]]},{"id":"3bdf56cc.785bea","type":"function","z":"50e9357a.2d090c","name":"Loxone -> HSV Split","func":"var hsv= msg.payload.split(\",\");\n\nhsv[0] = hsv[0].substr(4);\nhsv[2] = hsv[2].substr(0, hsv[2].length-1); \n\nmsg.h = hsv[0];\nmsg.s = hsv[1];\nmsg.v = hsv[2];\n\nmsg.payload =\"\";\n\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":1100,"wires":[["2be5c687.9458fa"]]},{"id":"2be5c687.9458fa","type":"function","z":"50e9357a.2d090c","name":"","func":"var command = \"-d\" + '{\"status\":\"on\",\"hue\":';\n\ncommand = command + msg.h + ',\"saturation\":' + msg.s + ',\"level\":' + msg.v + '}';\n\nmsg.payload = command;\n\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":1100,"wires":[["582c6835.b29c68"]]},{"id":"637802f6.3b79ec","type":"switch","z":"50e9357a.2d090c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"hsv(0,0,0)","vt":"str"},{"t":"cont","v":"hsv","vt":"str"},{"t":"cont","v":"temp","vt":"str"}],"checkall":"false","outputs":3,"x":350,"y":1080,"wires":[["39dcc97e.c8c7f6"],["3bdf56cc.785bea"],["dca6682a.6e3248"]]},{"id":"39dcc97e.c8c7f6","type":"template","z":"50e9357a.2d090c","name":"Off","field":"payload","fieldType":"msg","format":"handlebars","syntax":"plain","template":"-d '{\"status\":\"off\"}'","output":"str","x":550,"y":1060,"wires":[["582c6835.b29c68"]]},{"id":"dca6682a.6e3248","type":"function","z":"50e9357a.2d090c","name":"Loxone -> White Temp Split","func":"var temp= msg.payload.split(\",\");\n\ntemp[0] = temp[0].substr(5);\ntemp[1] = temp[1].substr(0, temp[1].length-1); \n\nmsg.h = temp[0];\n\nmsg.payload = temp[1];\n\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":1160,"wires":[["c8b52947.c84858"]]},{"id":"5f56071a.a43c48","type":"function","z":"50e9357a.2d090c","name":"","func":"var command = \"-d \" + '{\"status\":\"on\",\"color_temp\":';\n\ncommand = command + msg.payload + ',\"level\":' + msg.h + '}';\n\nmsg.payload = command;\n\nreturn msg;","outputs":1,"noerr":0,"x":910,"y":1160,"wires":[["582c6835.b29c68"]]},{"id":"c8b52947.c84858","type":"range","z":"50e9357a.2d090c","minin":"2700","maxin":"6500","minout":"370","maxout":"153","action":"scale","round":true,"name":"Scale MiReds","x":720,"y":1160,"wires":[["5f56071a.a43c48"]]},{"id":"6c519746.372168","type":"loxone-miniserver","z":"","host":"","port":"80","enctype":"0","active":true},{"id":"2b3d2bbe.707d34","type":"ui_group","z":"","name":"Loxone Test","tab":"a05dcf8a.1c58d","disp":true,"width":"6"},{"id":"a05dcf8a.1c58d","type":"ui_tab","z":"","name":"Loxone Test","icon":"dashboard"}]



            • #7
              Somebuddy - thanks thats brilliant, ill make one up and have a play.


              • #8
                I'm just getting my head around Node Red. I've successfully integrated the Loxone and Milight nodes and have control of the white component of the Milight (the light is an RGB WW/CW, aka. "Full Color") using the iBox2.

                The difference with my implementation and Post#6 is that I'm using the published Milight node (rather than a curl command).

                I've got temperature, ON/OFF and brightness control of the white component of the light controlled from the Miniserver.

                I'm struggling with how to convert the HSV output to RGB and reformat them appropriately.

                example -

                The HSV Reformat function outputs "350,74,10"

                The HSV to RGB function needs to accept the input as a JSON array [350,74,10]. If this value is manually injected in the correct format, it successfully outputs the correct RGB value of (26,7,10).

                The format going into the RGB function should be "rgb(26,7,10)"

                I'm keen to view someone else's flows to establish how it's done.

                Klicke auf die Grafik für eine vergrößerte Ansicht  Name: Milight Flow.png Ansichten: 1 Größe: 53,6 KB ID: 186502
                Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.