Skip to content

Color Temperature Conversion issue for Milight #1074

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

Open
TheFou opened this issue Mar 19, 2025 · 1 comment
Open

Color Temperature Conversion issue for Milight #1074

TheFou opened this issue Mar 19, 2025 · 1 comment

Comments

@TheFou
Copy link

TheFou commented Mar 19, 2025

Issue does not already exist?

I have searched and found no existing issue

Select Environment

Docker

Home Assistant related?

No

Description

Hi,

I've added my Milight RGB+CCT GU10 spots (FUT103) to diyHue.
When I adjust the color temperature — whether for a single light or multiple — through the Hue app, I can achieve full warm white.
However, when selecting the coldest white, both warm and cold white LEDs remain on.

It seems impossible to get full cold white using diyHue.
After checking the code, I believe the calculation converting the Hue ecosystem range to the Milight range might be incorrect.

I'm unsure of the exact range used by Hue(153-?), but for Milight, the Milight bridge operates within a range of 153 to 370.

According to ChatGPT, the correct proportional conversion formula for mapping one range [a, b] to another [x, y] is:

f(v) = x + ((v - a) * (y - x)) / (b - a)

Explanation:

  • v is the value to convert.
  • a, b are the bounds of the original range (Hue).
  • x, y are the bounds of the target range (Milight).
  • (v - a) / (b - a) normalizes v to a scale of 0 to 1.
  • Then, we scale this normalized value to the target range by multiplying by (y - x) and adding x.

If Hue also starts at 153 as it seems, your calculation for cold white is 153 / 1.6 + 153 = 249-ish, so much more than the 153 needed.
Could you make the change in diyHue ?

Thanks!
Regards.

Errorlog:

N/A

Steps to reproduce

N/A

Please enter your operating system details here

Hue-Emulator Version: 2025-03-15 14:15:43.000000000
WebUI Version: 2025-03-15 14:15:45.000000000
Architecture: x86_64
OS: Linux
Linux version: #1 SMP PREEMPT_DYNAMIC Mon Mar 17 11:16:31 UTC 2025
Linux release: 6.12.18-haos
Hardware: %Hardware%

Upload debug tar

N/A

What DiyHue version(branch) are you using?

master (latest)

@TheFou
Copy link
Author

TheFou commented Mar 19, 2025

Also, if you need other range values, like their "saturation" which in reality is the intensity of white LEDs, regardless of color LEDs status, or anything else, I can provide them for RGB+CCT bulbs.
Please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant