Color correction and transition time
Laxilef opened this issue · 3 comments
Hello.
Is it possible to add color correction? Not all lamps have the same color with the same (x, y or hue). Z2M supports correction, but only for hue format:
zigbee2mqtt/FRIENDLY_NAME/set with payload {"color": {"hue": HUE, "saturation": SATURATION}}
I tried to forcibly add in the z2m config (devices.yaml) hs in supported_color_modes, but hass-emulated-hue sends x, y to the service.
'0x...':
friendly_name: livingroom_lamp_left
optimistic: true
transition: 0
hue_correction:
- in: 240
out: 150
- in: 265
out: 285
- in: 71
out: 90
device_options:
supported_color_modes:
- "xy"
- "color_temp"
- "hs"
color_mode: "hs"
qos: 0
debounce: 0
Log:
2021-06-07 07:33:51,987 DEBUG emulated_hue.api -- {'transitiontime': 8, 'xy': [0.4090004861354828, 0.5180078148841858]}
And another question. How can I make the transitiontime shorter? Colors change very slooowly :(
On dynamic scenes in movies, it does not look very good.
Thanks.
This will not be implemented here as this simply relays the information to home assistant which handles color conversation. In other words, ask the home assistant devs about this. Transition are fine. Its the latency/rate limiting that the protocols have. If you want the best experience, try esphome lights.
But there is work with hue in the code:
Line 631 in 6c82f7c
Because of what emulated hue can send the service not hue, but x + y?
Maybe can make a forced conversion of x + y color to hue for some devices (set in the config)?
As far as transition is concerned, I noticed that it is large when using the "throttle" parameter. In the code, I also see that transition is tied to throttle.
We're simply not doing any sort of color conversion here. All we do is simply send the request from the app as is directly to home assistant. If you think there is something wrong with color conversion, open an issue at home assistant.
Throttle is used to avoid the ratelimiter present in many protocols. Specifically it's used with entertainment to skip certain frames allowing for smoother entertainment.