Improving Color Gamut / Accuracy for RGB Bulbs

Hi all,

My Sengled E11-N1EA Zigbee bulbs can’t display pure red, green or blue when hooked up to Hass.io (via zigbee2mqtt). I’ve come to the conclusion that this is due to their xy_color gamut / conversion being different than Home Assistant’s default.

More specifically, I think it is check_point_in_lamps_reach and get_closest_point_to_point in color_util giving these bulbs trouble. When I call the light.turn_on service with the xy_color value that the Sengled hub uses to turn these bulbs being red ({"x":0.733,"y":0.264}), HA uses get_closest_point_to_point to unnecessarily normalize the values and sends {"x":0.693,"y":0.296} to the bulb, which results in an orange-red.

Might anyone be able to give me some pointers on how to change the allowable gamut for an MQTT Light? For now, my setup only uses these bulbs, so a global change would work – though customizing on an entity by entity basis would be great.

Thanks.