Node Red - Philips HUE Ambiance

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • Dave Charman
    Azubi
    • 24.12.2019
    • 5

    #1

    Node Red - Philips HUE Ambiance

    I'm using the node-red-contrib-loxone 0.10.11 along with the node-red-contrib-huemagic (node)

    to control HUE lamps from Loxone which works great when using Philips HUE RGB bulbs

    But I've recently tried to control some Philips HUE Ambiance lamps (warm,natural,cool) lamps

    I've setup my output of my Loxone lighting controller as RGB and when using the warm / natural / cool colour picker in the loxone app
    I get the following information in node red:

    Pendant : msg.payload : string[14]
    "temp(100,2700)"

    100 being the brightness - 2700 being the colour temperature

    However the Philips Hue Ambianc lamps requires colour temperature in a different format:

    on: true
    brightness: 100
    brightnessLevel: 254
    reachable: true
    colorTemp: 454

    From what I have researched the Hue lamps require the colour temperature in Mired format



    All we need to know is that M = 1000000 / T where M is Mired and T is the light temperature in degrees Kelvin.

    So for our 2700K equivalent ct value we get:

    M = 1000000 / 2700 M = 370.37037037

    Does anyone have a flow they can share that will convert the Loxone values to the Philips HUE required values ?

    Thanks in advance :-)

  • Dave Charman
    Azubi
    • 24.12.2019
    • 5

    #2
    Also posted this on the Node Red forum and a quick reply was received,

    So have shared the reply here for anyone else wanting to do the same

    ( I have tested this and it works 100%)



    Flow:

    [{"id":"0fad9fb9a5973506","type":"inject","z":"7351 324319c98582","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay" :0.1,"topic":"","payload":"temp(100,2700)","payloa dType":"str","x":250,"y":300,"wires":[["b33b52d374958461"]]},{"id":"b33b52d374958461","type":"change","z":"73 51324319c98582","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"( \t $c:= $match(payload,/\\((\\d+),(\\d+)\\)/).groups; \t { \t "brightness":$number($c[0]),\t "colorTemp":$round(1000000/$number($c[1]),0) \t }\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg" :false,"x":480,"y":300,"wires":[["5e5a58324f26fd0c"]]},{"id":"5e5a58324f26fd0c","type":"debug","z":"735 1324319c98582","name":"","active":true,"tosidebar" :true,"console":false,"tostatus":false,"complete": "true","targetType":"full","statusVal":"","statusT ype":"auto","x":660,"y":300,"wires":[]}]

    Kommentar

    Lädt...