I recently acquired some TP-Link KL125 bulbs without realizing that they aren’t supported by Home-Assistant. After digging into the rabbit hole, I found they don’t work due to a divide by zero error caused by no definition existing for the color temperature.
File "/usr/src/homeassistant/homeassistant/components/tplink/light.py", line 248, in attempt_update
self._light_features = self._get_light_features()
File "/usr/src/homeassistant/homeassistant/components/tplink/light.py", line 289, in _get_light_features
min_mireds = kelvin_to_mired(min_range)
File "/usr/src/homeassistant/homeassistant/util/color.py", line 515, in color_temperature_kelvin_to_mired
return math.floor(1000000 / kelvin_temperature)
ZeroDivisionError: division by zero
This is of course a bummer. Then I discovered there was actually a PR to fix it submitted here: https://github.com/GadgetReactor/pyHS100/pull/201. It wasn’t merged however though because pyHS100 has been abandoned in favor of the python-kasa fork. Unfortunately though Home Assistant uses pyHS100 at this time, not python-kasa. With a one line change the bulbs work with pyHS100.
I’ve submitted a request to try to get a new release spun for pyHS100 here: https://github.com/GadgetReactor/pyHS100/pull/202
However in the interim, I wanted to share how someone else can use this.
This will have it check out my branch I submitted the PR for and install it to use with the custom component. It isn’t pretty, but it at least works for now.
I have been using modifications to my docker compose file (since that is how I run HA) in order to overwrite dependency folders, that way there is no custom integration to add, and when the dep does get upgraded, all I have to do is remove a single line of code before I update HA
Anything change recently? This worked for me last week and I just did a Home Assistant update and its no longer working. I attempted to remove the custom component and retry but I am unable to get in contact with the KL125 bulbs anymore through Home Assistant. Tried several times.
Thanks, I upgraded and was able to get it working again. I needed to factory/power reset the bulbs and then they showed up again. I could never get them to show up with python-kasa. Wanted to see if that did a better job of not turning the lights blue for a split second when you shut it off.
I’m having an issue where when I toggle the lightbulbs it says call service light turn on failed. But the lights turn on. This is an issue because when I try and use the lights turn on call service in an automation it doesn’t work. Do you have this issue?