Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HSB color_temp publish over or under values as documented values #9843

Closed
Wikibear opened this issue Nov 25, 2021 · 7 comments · Fixed by Koenkk/zigbee-herdsman-converters#3426
Labels
problem Something isn't working

Comments

@Wikibear
Copy link

Vers: 1.21.2
Müller Light RGBW
Command you see at debug.
grafik
I get values under 153 or over 556 as documented:
https://www.zigbee2mqtt.io/devices/404000_404005_404012.html#light
grafik
Via Frontend:
grafik
grafik

@Wikibear Wikibear added the problem Something isn't working label Nov 25, 2021
@Koenkk
Copy link
Owner

Koenkk commented Nov 25, 2021

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 25, 2021

@Koenkk I think this is because the color_mode is set to hs, so we're calculating the color_temp based on the hue/saturation values.

Not sure what the correct thing to do here is, do we clamp them to the support colorTemperature range when color_sync=true or do we stick to what we have now which is probably a close approximation of what the actual color is?

I'd be inclined to clamp them to the actual support colorTemperature range, because we do pass this information along using expose.

@Koenkk
Copy link
Owner

Koenkk commented Nov 25, 2021

I'd be inclined to clamp them to the actual support colorTemperature range

Agree

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 25, 2021

I'd be inclined to clamp them to the actual support colorTemperature range

Agree

I'm pretty busy at the moment, but if you don't get to it before weekend after next, I should be able to look at this.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 26, 2021

I had a quick look during my break, looks like we do not have access to 'entity' in https://github.com/Koenkk/zigbee-herdsman-converters/blob/05f0795cbf3742a17d59152bbe2186ec6bc8a48e/lib/color.js#L644

findColorTempRange() which is used to do the range lookup to feed to clampColorTemp() requires it, not sure what a clean way is to get the information, aside from perhaps trying to pass 'entity' to syncColorState().

That should be fine for toZigbee but it doesn't look like we have entity available in fromZigbee? e.g. https://github.com/Koenkk/zigbee-herdsman-converters/blob/19339d14b3dc56a071c62ff322b232cf8081874d/converters/fromZigbee.js#L542

@Wikibear
Copy link
Author

What is the temp range given by the bulb? https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html#_3-adding-converter-s-for-your-device

I don't know how to help here. I don't know the real limitation of bulb.

@Koenkk
Copy link
Owner

Koenkk commented Nov 27, 2021

@sjorge for fromZigbee, the device and endpoint can be accessed through msg.endpoint/msg.device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
3 participants