claytonjn / hass-circadian_lighting

Circadian Lighting custom component for Home Assistant
Apache License 2.0
771 stars 89 forks source link

Incorrect temperature setting for LIFX Day and Dusk bulbs #162

Open dheera opened 3 years ago

dheera commented 3 years ago

For LIFX multi colored lamps it sets the circadian temperature correctly. For LIFX Day and Dusk lamps it sets it incorrectly. These are two lamps at the exact same time

2021-06-11_06-42_1 (Scale goes from 111 to 400, CL set it to 400)

2021-06-11_06-42 (Scale goes from 250 to 666, CL set it to 400)

claytonjn commented 3 years ago

Circadian Lighting sets all lights to the same value at the same time; that's one of the main tenants of the component. The issue is almost definitely in how CL is configured or in the LIFX integration. What values do you have set for min_colortemp and max_colortemp? Also, what do debug log entries show CL was trying set each bulb to?

dheera commented 3 years ago

It's trying to set each bulb to the same value (400), but it seems that 500 on one bulb looks like 400 on the other bulb, they seem to have a slightly different mired to Kelvin conversion ... Perhaps it might be useful to have min_colortemp and max_colortemp per-bulb?

claytonjn commented 3 years ago

Perhaps it might be useful to have min_colortemp and max_colortemp per-bulb?

That's the most-requested feature of this component and I really don't want to add that functionality (although I'll probably give in at some point). The main purpose of the component is to keep lights in sync throughout a location and adjust them together throughout the day to maintain circadian rhythms. Having different lights at different values would nullify that purpose, and having different min/max colortemps would set lights to different values at a given time. It's highly likely that the inconsistency you're seeing is non-linear, so the lights would still be off from each other.

Mireds are not a percentage, whatever value is set in mireds should be the same visual color on all lights. There's obviously some variation in accuracy between models and brands but they should look generally similar. In terms of the frontend, that color gradient is fixed and the slider is a percentage so the large difference in range between the bulbs (289 vs 416) is why they look so different on the frontend - that's more an indication of relative appearance of the lights capability (more blue vs more orange) rather than what the lights actually will look like.

How much do the lights actually differ from each other in appearance?