diff --git a/homeassistant/components/zha/core/channels/lighting.py b/homeassistant/components/zha/core/channels/lighting.py index 696a15b483b..c7cbdc67db9 100644 --- a/homeassistant/components/zha/core/channels/lighting.py +++ b/homeassistant/components/zha/core/channels/lighting.py @@ -33,6 +33,10 @@ class ColorChannel(ZigbeeChannel): async def async_initialize(self, from_cache): """Initialize channel.""" await self.fetch_color_capabilities(True) + await self.get_attribute_value( + 'color_temperature', from_cache=from_cache) + await self.get_attribute_value('current_x', from_cache=from_cache) + await self.get_attribute_value('current_y', from_cache=from_cache) async def fetch_color_capabilities(self, from_cache): """Get the color configuration.""" diff --git a/homeassistant/components/zha/light.py b/homeassistant/components/zha/light.py index cebc18e6a3e..eadc9e03af0 100644 --- a/homeassistant/components/zha/light.py +++ b/homeassistant/components/zha/light.py @@ -253,6 +253,20 @@ class Light(ZhaEntity, light.Light): if self._level_channel: self._brightness = await self._level_channel.get_attribute_value( 'current_level', from_cache=from_cache) + if self._color_channel: + color_capabilities = self._color_channel.get_color_capabilities() + if color_capabilities is not None and\ + color_capabilities & CAPABILITIES_COLOR_TEMP: + self._color_temp = await\ + self._color_channel.get_attribute_value( + 'color_temperature', from_cache=from_cache) + if color_capabilities is not None and\ + color_capabilities & CAPABILITIES_COLOR_XY: + color_x = await self._color_channel.get_attribute_value( + 'current_x', from_cache=from_cache) + color_y = await self._color_channel.get_attribute_value( + 'current_y', from_cache=from_cache) + self._hs_color = color_util.color_xy_to_hs(color_x, color_y) async def refresh(self, time): """Call async_get_state at an interval."""