question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Colors slightly off for !Hue and scene_add vs direct set differences

See original GitHub issue

So I was messing with the RB 250 C as this is seems to be an odd bulb in the bunch that does not do enhancedHue… It also needs redfix.

#FF0000 -> with redfix applied = dark red hue:0, sat:100 -> off red, so I guess it also needs the red fix applied somehow… but… I noticed the following

Zigbee2MQTT:debug 2021-01-03 18:43:56: Received MQTT message on 'zigbee2mqtt/office/light/desk/bulb/set/color' with data '{"hue": 0, "saturation": 107}'
Zigbee2MQTT:debug 2021-01-03 18:43:56: Publishing 'set' 'color' to 'office/light/desk/bulb'                                                                                                                                                   Zigbee2MQTT:info  2021-01-03 18:43:56: MQTT publish: topic 'zigbee2mqtt/office/light/desk/bulb', payload '{"brightness":254,"color":{"hue":0,"saturation":107,"x":0.7006,"y":0.2993},"color_mode":1,"color_temp":37,"linkquality":63,"state":"
ON"}'

Zigbee2MQTT:debug 2021-01-03 18:44:21: Received MQTT message on 'zigbee2mqtt/office/light/desk/bulb/set/color' with data '{"hue": 0, "saturation": 108}'
Zigbee2MQTT:debug 2021-01-03 18:44:21: Publishing 'set' 'color' to 'office/light/desk/bulb'
Zigbee2MQTT:error 2021-01-03 18:44:21: Publish 'set' 'color' to 'office/light/desk/bulb' failed: 'RangeError [ERR_OUT_OF_RANGE]: Command 0x14b457fffe2bd760/1 lightingColorCtrl.moveToHueAndSaturation({"transtime":0,"hue":0,"saturation":255.99136000000001,"direction":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null}) failed (The value of "value" is out of range. It must be >= 0 and <= 255. Received 255.99136000000001)'
Zigbee2MQTT:debug 2021-01-03 18:44:21: RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= 0 and <= 255. Received 255.99136000000001
    at writeU_Int8 (internal/buffer.js:735:11)
    at Buffer.writeUInt8 (internal/buffer.js:745:10)
    at BuffaloZcl.writeUInt8 (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/dist/buffalo/buffalo.js:30:21)
    at BuffaloZcl.write (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/dist/buffalo/buffalo.js:206:18)
    at BuffaloZcl.write (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/dist/zcl/buffaloZcl.js:303:26)
    at ZclFrame.writePayloadCluster (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/dist/zcl/zclFrame.js:144:21)
    at ZclFrame.toBuffer (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/dist/zcl/zclFrame.js:74:18)
    at ZStackAdapter.<anonymous> (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/dist/adapter/z-stack/adapter/zStackAdapter.js:317:163)
    at Generator.next (<anonymous>)
    at /opt/zigbee2mqtt/node_modules/zigbee-herdsman/dist/adapter/z-stack/adapter/zStackAdapter.js:27:71

Running the following…

mosquitto_pub -t zigbee2mqtt/office/light/desk/bulb/set/color -m '{"hue": 0, "saturation": 100}' ; sleep 3 ; mosquitto_pub -t zigbee2mqtt/office/light/desk/bulb/set/color -m '{"hue": 0, "saturation": 107}' ; sleep 3; mosquitto_pub -t zigbee2mqtt/office/light/desk/bulb/set/color -m '#FF0000'

Makes it go from off red, nearly dark red, dark red

The difference between the last 2 is very very tiny and I usually don’t even notice it… I wonder if some how our saturation calculation is wrong for non enhancedHue ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
sjorgecommented, Jan 22, 2021

I’ll try to clarify later, but it stated with me noticing it with hue/sat.

But it ended up being for both hue/sat, xy, hex,… with any way to set it. Then I got confused as sometimes they looked good. Then I did covered it was because scene_add does not have the gamma correction so colors looked correct when using scenes.

It’s one of those goos chases that leads you down one bit rabbit hole. I’ll close this issues when I am on my computer and file a newer one… or well maybe 2 as I think there are two parts to this.

~ sjorge

On 22 Jan 2021, at 16:36, Koen Kanters notifications@github.com wrote:

TBH I’m a bit confused by this issue. The issue started with off colours when setting via hue/saturation but in #2017 (comment) you mentioned x/y. Also gamma correction is only applied to hue/saturation not x/y. Note that the red fix does not fix off red colors, but fixes setting {x: 0.701, y: 0.299} doing nothing at all (https://github.com/Koenkk/zigbee-herdsman-converters/blob/4f4679631bbef485ccbb6132365a69837e13d4d0/converters/toZigbee.js#L976).

Could you summarise what the problem is here?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

0reactions
sjorgecommented, Jan 22, 2021

Perhaps splitting 2128 into two seperate issues would be better even still. I did a bit more retesting and I don’t think either solutioned mentioned here are OK so just ignore this entire issue now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hue lights slightly different color than others? And ideas ...
All of my bulbs are the same type (B22 Bayonet) and I noticed in my bedroom that one bulb was fine, the other...
Read more >
Philips Hue dynamic lighting scenes are missing two key ...
Philips Hue's new dynamic lighting scenes are missing two key features. Dynamic scenes for color Hue lights are here, but you can't change...
Read more >
CS307: Reading on Color, part b
HSL: Hue, Saturation, and Lightness. Very similar to HSV, except that instead of a cone you get a double-cone. Cross-sections are still color...
Read more >
F.A.Q. - Hue Lights
"Hue Lights" lights the way! Share your scenes with all of your iOS devices. Create multiple "On" and "Off" schedules per scene. Tap...
Read more >
Ambient Lighting: Illumination from Every Direction
Indirect lighting : light rays that have bounced off the walls and other objects in the room before hitting an object, changing color...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found