jdomeij / node-red-contrib-node-hue

Node RED nodes for controlling Philips Hue lights
Apache License 2.0
17 stars 8 forks source link

100% Brightness - 39% Brightness? #21

Closed TerryLansdown closed 6 years ago

TerryLansdown commented 6 years ago

Hi,

Thanks for the code, working well so far. One problem I’ve noticed, if I inject the following JSON via MQTT, my hue lights switch on, but don’t seem to set the brightness correctly to 100%, I’ve tried with both 255 or “100%”, but either seems to set the brightness to 39% (in the Home app).

{
    "on": [
        true
    ],
    "transitiontime": [
        0
    ],
    "bri": [
        "100%"
    ]
}

Thanks for any help you can offer.

jdomeij commented 6 years ago

The problem most likely is because you pass the values in an array, and also the brightness should be an number not an string

Try changing the JSON to something like this

{
  "on": true,
  "duration": 0,
  "bri": 100
}
TerryLansdown commented 6 years ago

Figured it out, I had a function elsewhere that was setting the msg.payload to 100 not 254. I needed to pass the values as my post above to avoid a 'TypeError: CreateListFromArrayLike called on non-object ' error.

Thanks and apologies for the dumb error.