Kasa Bulbs - Transition time

Not sure if this is the right place for this, but I have a number of Kasa bulbs in my setup and was looking to use the recently-added transition time (available through the Kasa app) in HA. I dug through the source code for the bulbs and found that the transition function isn’t supported by the HA integration. Just out of curiosity, I went digging into the Kasa API itself and transition is supported. Here’s where it’s been implemented for HomeBridge (for example) : https://github.com/plasticrake/tplink-smarthome-api/blob/e0a6e8505d98f1db8fa8b33041671d6ebecf69e7/API.md#Bulb+lighting+setLightState.

I would love for this support to be added to the HA integration so I can move the half-hour long morning transition to full brightness into HA rather than have it in the app.

Thanks!

Thats nice that they’ve added transitions to the app, I’d also like to see HA support transitions, I may see if I can do it in NodeRED as that also as a tplink node that works pretty well.

See Add Transition Period to TP-Link Smartbulbs

1 Like

Any update on this?

The latest homeassistant release (2021.10.0) uses the new backend library and has now support for transitions :slight_smile:

1 Like

Sorry to dig out this old thread again. I just purchased some Kasa KL125 bulbs and I tested them with HA transition right away. I swear to god the first time I tested them they worked as expected, so I put them for my bedroom lamps. This morning they just went 100% without any transition. I got an earful from the wife. :frowning:
Now no matter how much I try, the transition doesn’t seem to work anymore.

service: light.turn_on
data:
  transition: 60
  brightness_step: 255
enabled: true
target:
  entity_id: light.master_bedroom_lamps

I even try to set the bulbs at 0 or 1% first before transitioning to 100% but nothing works. Any advice would be appreciated.

Ah, there’s a discrepancy between the what homeassistant expects and what the underlying library expects for the transition value. The library expects milliseconds (Bulbs — python-kasa documentation) whereas homeassistant uses seconds.

So your example would request turning on in 60 milliseconds, which is almost immediate (iirc, the regular turn on/off without defining is 500ms or one second). Try 10000 for ten seconds to see if that helps, note that long transitions may or may not work.

edit: just in case someone stumbles upon this thread, the unit issue was fixed in Fix transition handling for tplink lights by rytilahti · Pull Request #57272 · home-assistant/core · GitHub

1 Like