TP-Link Integration: Support for KL430 LED Light Strip

having the ability to use custom effects from home-assistant is something I’ve been looking for in a non-diy lightstrip for a while. I’m excited for this. It’ll be cool to have this in the kitchen or wherever and be able to look at it and ascertain the status of doors or any other sensor.

Looks like custom effects should make 2022.4 after all

2 Likes

I’m unreasonably excited

They are available in beta now if anyone feels like testing

1 Like

I just saw that and tested. This works amazing! I’m going to put it through some more rigorous testing tonight but sending effect commands to 1 and many devices simultaneously is working well. Thank you so much for your work on these; I am thrilled.

Tested on KL430:

I will keep editing my notes here as I run through testing.

2 Likes

I found a bug that’s significant enough I’m going to branch off of my own reply.

Effects are getting hung up persistently and I know why:
When you go into the light, select the effect, it calls no problem there or calling other effects from the same window. But now I want to change to white, so I select the color temp and it changes, great! But then turn off the light either manually or by automation and when it comes back on, it will come on with the effect selected. If I have a light that I have NEVER selected an effect on, the effect dropdown just says effect which is effectively telling the light no effect. But if you’ve ever selected an effect, it persistently remains in the drop down even when you switch to CT or color, so when the light comes on again, it says “turn on the effect”. There’s not a “no effect” selection nor can you ‘unselect’ an effect.

Naturally the first thing I did was tie all 38 LED’s together in a group and smashed that effect button, so now they all have an effect and acting wacky.

Here’s how you get out of the loop: Lights being controlled by persistent effects via HA. Swap all the lights to CT via the Kasa app and reboot HA. When it comes back up, the integration will re-pull all the current states of the KL430s which should now be in a CT. It’s not a 100% effective workaround but it at least made less like a disco.

The effect is still selected in HA on a few of them but as long as the lights are on and not getting triggered, they’re stable until we can get HA to recognize “when KL430 changes to CT or RGB, then turn off or unselect effect”

edit I just found another way to fix it. Run a script to call all the light effects to blank. I figured it’d throw an error but it actually worked and all my lights are now set to effect blank.

I hope this is clear. If you need me to help explain the problem or provide logs, I can. My observations were consistent and reproduceable. I will need to pause on testing further until we can get around this :slight_smile:

Please open a GitHub issue with very specific reproduction steps along with exact settings, what you clicked, and extract calls / values entered. If you do a video as well it will be much easier to reproduce.

Selecting any color should disable the effect.

I will gladly do that today. To be clear, setting it to a color does bring it out of the effect. But the next time the light is turned on, because there’s still an effect in the drop down, it calls the effect.

I’m hosting sprint review for a few hours but I have time available immediately after that.

edit This has something to do with firmware. I have confirmed that the behavior was consistent on the same physical devices. When I checked the firmware of every device, each device that is not getting stuck in effect is on firmware version 1.0.9. Every light that seems to NOT have the issue is on firmware version 1.0.10. I looked at 15 devices and it was consistent with all of them. The KASA app is not telling me there is a firmware update available for the others.

If I had to guess, this is a chronological device ordered in time because all the ones with the problem are upstairs and they were all the first ones I purchased and I know there’s differences in firmware between the KL430 V1 and KL430 V2 and I think that’s what I’m seeing here.

So the obvious answer here is: Get on 1.0.10 firmware and the problem doesn’t exist, in which case there’s no defect for me to report. I know Kasa will give you beta firmware if you ask for it (requesting now). But I’m SURE I’m not going to be the only one with lights on 1.0.9. @bdraco Would you still like me to submit an issue on Github indicating that this issue is specific to 1.0.9 or is everyone getting on 1.0.10 firmware truly the way, here?

I have 1.0.8 on both of my test devices. Go ahead and open the issue. I’ll try to replicate it. If I can I’ll try to come up with a workaround when I get home on Monday. If I can’t we may close it with the solution is to upgrade to 1.0.10

1 Like

TPLink Kasa Integration: KL430 - Persistent Effect Behavior

I confirmed in my repro steps that it’s happening for both firmware versions but adaptive lighting was masking the symptoms in version 1.0.10.

I got HA core-2022.4.0b6 and it contains the bug fix. I can confirm that the effect is not getting hung up and I can also confirm that changing to CT from effect works. Confirmed off/on behavior works as expected in each scenario. This works great and I’m overjoyed!

I thought custom effects were unlocked as part of this? Whenever I run a script for a custom effect, I get a “not a built in effect” message. Additionally when I look in dev tools at the device when a custom effect is selected, I don’t see the custom effect listed anywhere in the current status. Can you point me to how custom effects can be accessed?

1 Like

You’ll likely want to build them using automations or scripts. Check the two services at the bottom of this page.

Custom effects won’t be shown in the predefined effects list since they aren’t stored on the device and Home Assistant doesn’t have access to your Kasa account to see which ones you have configured.

I was definitely not expecting it in the drop down but a service call to turn on light by ‘custom’ effect name is where I had expected it to work.

I see the instructions, and while they are slightly more complex than I expected (but allows maximum flexibility) for calling the lights however you want but one point of clarification.

You can create custom effects in tp link kasa app and name them whatever. They will remain as part of the 25 effect allotment on the device. Are we saying we cannot call those custom named effects in kasa app by using light: on 》custom effect name?

Just want to make sure we’re understanding eachother when I reference a custom effect.

If I have to recreate my custom effects in HA, its certainly not the end of the world. Just want to make sure I’m not missing something. I see HA has a profile in the light:on. In HE we basically made the hub copy the state the device was in and then it could be recalled over and over as a light profile. Is that what you’d recommend here?

You’ll have to recreate them in Home Assistant as the device doesn’t actually know any about the custom effects that exist in the Kasa app/cloud service.

I’d probably write a script that calls the custom effect service with specific data

1 Like

perfect, thank you for the clarification. I will put the devices through their paces and report any anomalies. I’ll report back either way; super excited.

edit I have beat on this for several hours and put it through every scenario I could think of. I built some scripts to handle custom effects and it’s working better than I could’ve imagined. Once I found TP-Link Kasa Smart: sequence_effect things got easy, real quick. This is an elegant solution that works amazingly well. This is the first time I’ve ever been able to get all 38 KL430’s to do something in unison and it’s incredible. Great work, Thanks!

1 Like

I’ve found a persistent and reproduceable error that I can’t overcome in the TP-Link Kasa Smart: random_effect

It doesn’t matter what I enter in the background field, it throws an error. I tried two different examples from the original effects data dump and I can’t get the random effects to work.


This one takes a list of sequences. Try

- [130, 100, 40]
- [100, 40, 30]

etc

so, I was about to buy this and Amazon said there’s a newer version called KL420L5. It’s a much longer strip with many more zones at a lower price, but apparently is nowhere near as bright. Should this work with that as well? It’d be cool for hallway lights down near the floor just to provide enough light for moving around at night.

that worked thanks. leaving background blank seems to throw an error. Flicker doesn’t send any background commands so I sent - [0, 0, 0] instead and it worked. Not sure if that’s the correct approach but it will be something for users to note. I have not been able to trip up the devices yet. Obscenely responsive.

Looks like backgrounds is optional.

Fixed here

1 Like