RGB Lights (specifically TP-Link LB130)

I’m having some weird behavior concerning the TP-Link LB130 lights. Whenever I call a service to change the rgb_color, it appears to reset the brightness of the light to around 50%. Even if I specify the brightness in that same call, the brightness flashes up for a second (and it doesn’t always go down again). Is there a way to get around that? Is there a default behavior that I can override? I’m trying to do a gradual brightening and color shift to simulate sunrise in the morning.

Looks like the brightness value for hsv is taken from rgb value. You could try to exchange the two last if blocks in homeassistant/components/light/tplink.py to set the color first, and adjust the brightness afterwards.

Could you try that out and report back?

how do I do that? I can’t seem to find that file. I’m fairly new to the whole home assistant thing (although I have worked with python before).

It depends on where and how you have installed your homeassistant, in my case (installed with pip -e <source directory>) it’s located in <source directory>/homeassistant/components/light/tplink.py. If you have installed it inside a virtualenv, then it’s somewhere underneath lib/python3.5/site-packages/ inside that env.

I’ve got it installed as Hassio on a raspberry pi

In that case I don’t know how to do it. Maybe this thread has some answers? Editing Component Files in Hassio