Alright. I should provide some details about the implementation: Do you know the mDNS name / device_type of your yeelight? If you use auto-discovery we need to make sure your device doesn’t produce a UNKNOWN error at the moment. This error is fixed in a recent version of netdisco which isn’t part of Home Assistant yet. If you have configured your yeelight by a static entry in your configuration.yaml you must add a configuration parameter called “model”. The configuration must look like this:
Hey @syssi that pastebin was for manual config entry using model ceiling1. Still showed unknown initially and then switched to color. Will experiment with other models as well.
It seems to me that manual config entry is not working and the auto-discovery light is detected and has the bug you mentioned.
Update: Turned off auto-discovery and got the manual entry to work. Tried ceiling and ceiling1. Ceiling had the same result. Ceiling1 was weird because the temp slider became unresponsive completely. Could not drag it at all.
Found something! The mired range seems to be in kelvin instead.
I guess the mired range setting needs to convert the spec from kelvin to mired.
Tested this change successfully. It works proper now. Slider goes all the way to max and sets the temp correctly. No more errors in log.
if self._model is not None and self._model in YEELIGHT_SPECS:
self._min_mireds = YEELIGHT_SPECS[self._model]['max_kelvin']
self._max_mireds = YEELIGHT_SPECS[self._model]['min_kelvin']
should be
if self._model is not None and self._model in YEELIGHT_SPECS:
self._min_mireds = kelvin_to_mired(YEELIGHT_SPECS[self._model]['max_kelvin'])
self._max_mireds = kelvin_to_mired(YEELIGHT_SPECS[self._model]['min_kelvin'])
Super! I noticed that the list of effects don’t work with ceiling1. The yeelight app has a different list (eg. flash notify, candle flicker). Maybe effects need to be model-specific too.
Cool. I will have a look. Could you confirm the color temperature range is working fine now? Please use the yeelight app to check the upper and lower limits. Do we use the full (supported) range of your device?
The different modes/scenes/effects (I don’t know how to label the feature properly) are a set of parameters (configuration). I found this github repo with some details: https://github.com/revil-O/Yeelight-Bulb-scenes
May be we should extract the current set of scenes again.
I can also do some testing, I also have the big 650 ceiling light.
Currently there seems to be no support for the RGB ambient light within HA.
Would it maybe be a good idea, to split the rgb into a own light entity within HA? Because it’s actually completely independent from the main light.
So just have a light entity for the main light and one for the ambient light. That way you can hide the RGB picker for the main light and show it in the ambient light.
Also is there any way to get the current mode? I try to add a touggle button to my ha dashboard that allows me to toggle between moonlight and normal mode and therefore I need to know, in which mode the lamp currently is.
Yes. A the second light (ambient) should be represented as a second light entity. I’m doing the same for the ambient light of the Philips Eyecare Lamp (light.xiaomi_miio).
@syssi Would be awesome, if you could implement that
Also is there any way to get the current mode? I try to add a touggle button to my ha dashboard that allows me to toggle between moonlight and normal mode and therefore I need to know, in which mode the lamp currently is.
This will need some time and an experienced tester. The underlying library (yeelight) needs to be extended. If the library works fine the Home Assistant Component can be updated.