TP-Link Integration: Support for KL430 LED Light Strip

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

Confirmed I was able to make backgrounds optional and the command sent correctly without it. Confirmed custom Flicker works.

Also, If somebody wants all the preconfigured effects, I can paste them in here. The problem with calling TP link effects is they call at 100% and even if you send a command immediately behind it, the effect can be blinding. Because there’s only a few of them and we’ve got the data dump, I’m just recreating them at a 25% and slower (I always thought the default effects ran too fast). If anybody wants it, I’ll be happy to share.

I made a pretty good ‘red alert’ script that has a nightrider type effect. Good for doorbell and siren notifications.

Hello,

There is a a limitation in the random seed of 100 but in one of the data dumps, it sends 600 for lightning > throws an error. I dropped it down to 100 and the effect still worked.

1 Like

ok last thing on these lights, I swear. This is a tangential question that I think you might be able to just answer/clarify for me based on your knowledge of the commands.

As far as I know, the transition and flash for the Light: turn off service has never worked for the KL430’s. They just turn off immediately and don’t do the long or short flash.

I was wondering if this was a limitation of the lights/code or is this a bug? All my other TP link lights do it except the KL430’s and was just wondering if it was a KL430 specific thing or if there was a gap in communication. We had a fade off feature for KL430s with HE and I recall it being VERY spotty with the KL430s. I always assumed it was Hubitat’s performance/communication causing it.

I only ask this because I see the transition field for the effect (and I’m sure these two things are different) but it made me suspicious if there was truly already an existing gap in the lights functions.

There is some discussion in the original PR here Add support for lightstrips (KL430) by rytilahti · Pull Request #74 · python-kasa/python-kasa · GitHub

It looks like set_light_state had to be used since there was trouble getting transitions working.

All of this stuff is guess work since we don’t have TPLink’s help so there may be a solution but it would need to be found via trial and error.

1 Like

Confirmed this is in and works. Thanks!

1 Like

Ok, I have the kl430 now and was hoping I could set it up where different segments represented different sensors. However, that doesn’t seem possible. There are sequence_effect and random_effect services, but they aren’t what I want. I want something more like the color painting in the app where I can set each segment to a specific color. Am I just missing that somewhere?

We could probably add support for the color painting if someone can provide dumps of the messages sent using the kasa app.

I’ll try to find time to set that up and capture it.

Hello,

Asking this here because I think I’m in the presence of people who know. I created scripts for each of the built in effects and put them in this handy dandy rotary wheel:
2022-08-01 19_38_05-Greenshot.
Thanks to you, I’ve built some annoying lighting easter eggs in my home.

I’ve learned how to create my own effects with scripted buttons and all of this is 100% rock solid. Here is one for example:

alias: Accent Lights - Aurora
sequence:
  - service: tplink.sequence_effect
    target:
      entity_id:
        - light.kitchen_island_leds
        - light.kitchen_leds
        - light.kitchen_over_cabinet_1_leds
        - light.kitchen_over_cabinet_2_leds
        - light.kitchen_under_cabinet_1_leds
        - light.kitchen_under_cabinet_2_leds
        - light.big_tv_leds
        - light.living_room_end_table_1_leds
        - light.living_room_end_table_2_leds
        - light.living_room_end_table_3_leds
        - light.living_room_end_table_4_leds
        - light.bar_leds
        - light.buffet_leds
        - light.bedroom_bed_leds
        - light.bedroom_bureau_leds
        - light.bedroom_dresser_leds
        - light.bedroom_nightstand_1_leds
        - light.bedroom_nightstand_2_leds
        - light.bedroom_2_bed_leds
        - light.bedroom_2_dresser_leds
        - light.bedroom_2_leds
        - light.bedroom_2_nightstand_1_leds
        - light.bedroom_2_nightstand_2_leds
        - light.office_desk_leds
        - light.office_leds
        - light.bathroom_2_leds
        - light.bathroom_1_leds
        - light.media_room_leds
        - light.media_room_table_leds
        - light.downstairs_bathroom_leds
        - light.downstairs_tv_leds
        - light.downstairs_media_leds
        - light.garage_entryway_leds
        - light.front_entryway_hall_tree_1_leds
        - light.front_entryway_hall_tree_2_leds
        - light.bubble_wall_light
        - light.media_room_fireplace_leds
        - light.sky_butthole
    data:
      sequence:
        - - 120
          - 100
          - 25
        - - 240
          - 100
          - 25
        - - 260
          - 100
          - 25
        - - 280
          - 100
          - 25
      brightness: 25
      transition: 6000
      spread: 7
      direction: 4
mode: single
icon: mdi:weather-night

I have ALL the scripts set up to send to ALL lights. This was a choice to get the entire house to do what I wanted, complete testing, and provide a foundational basis for what’s to come.

I will need to separate these out into rooms or groups of lights…That’s a LOT of buttons. Is there a way that I can just have the contents of this script teed up and somehow tell home assistant on demand which room/groups of lights to send the effect criteria to?

I’m perfectly willing to copy all this out a dozen times and separate it into rooms (even if it creates 1400 buttons) but I’m just wondering if there’s some other way to achieve this that I’m not aware of.

I guess what I envision is the script and then a dropdown or selector for a room or group of devices and firing at that group only. Can I do that somehow?

For one you could start grouping your LED strips to light groups (Group - Home Assistant) to enable controlling specific set of lights using a single entity. On top of that, you can assign “areas” for the entities, enabling you to execute service calls for example only on lights in the living room (Service Calls - Home Assistant).

After grouping the lights, you could create a a dropdown (select) helper that contains the groups (Input Select - Home Assistant) and create a script that gets executed with the value of that select as the target when clicking a button. I haven’t experimented myself much with those helpers, but I hope this will give you some ideas how to approach the problem :slight_smile:

1 Like

Fair on the light groupings. I DO have them all grouped out, I just did the initial one like that so it would make the subsequent copies easy (by removing the ones I didn’t want). So I think I’m good there. All devices assigned to an area, I have that.

Pointing services calls at an area? well no, I haven’t ventured into that yet. I knew it was available but haven’t played with it at all. It sounds like this is the missing piece I need to then point the effect script where ever i want.

Thank you for the tip, I will try to get this cooking.

Oh hey, im new here.
I’ve been looking for the same functionality as @kicker10BOG

I’m really desperate for this feature and im willing to help.
What exactly can i do to help get this done? I would need detailed steps on how to “dump messages from the kasa app”.

Additional to the messages of the kasa app, do you guys also want/need screenshots of the color painting functionality how the kasa app handles the color-setup for the segments?

cheers

Depends on your setup and how you’d be able to monitor/dump the data because you’re basically monitoring traffic between the kasa app and the device.

In my case, I set up Wireshark outside of home assistant and it allowed me to isolate the traffic to the device in question. Then press the buttons in kasa to send the commands and Wireshark will grab them. Then get that info in the hands of a dev and they can map it.

Screenshots may help but they’re probably going to use something standardized (I know govee has color painting). When I get to a computer, I can go over the exact steps. I might still have it set up to do this.

1 Like

Just wanted to throw this in for anyone looking for solutions for the ‘Effects’ list…

I recently picked up a set of the Kasa KL400L5 LED Strips and wanted to find a custom card that auto-magically showed me, and allowed me to control, the ‘Effects List’ without having to create individual scripts for each. Turns out that I already had one setup - enter ljmerza’s “Light Entity Card” (link and screenshot below).

It doesn’t work perfectly, but it does allow me to control a decent amount of the LEDs’ options. As you will see from the screenshot, there are a number of slides to control things like speed, white value, color temp, and brightness - well, I have only been able to get the brightness controls to work as I believe the other options need to be manually called.

Note: I have not added any custom ‘Effects’ in the Kasa App so I can’t confirm or deny if they show up in the “Light Entity Card’s” dropdown menu.

2 Likes

Just wanted to throw this out there as well - while it is NOT a solution for a way to easily select one of the ‘Effects’, it IS a great way to display and select an ‘Effect’.

In this example, I created Scripts to call for each ‘Effect’, then used the ‘RGB Light Card’ to show the icons for each ‘Effect’. The icons were extracted from a screenshot I took on my iPhone and then formatted into icons. I have attached links for all custom cards used, as well as the ‘Effect’ icon files. I am also including the code that I used to create this card.


Screenshot:
Kasa LED Light Strip Effects


Cards Used:


Icons:


Code:

type: custom:vertical-stack-in-card
styles:
  background: none
cards:
  - type: entities
    show_header_toggle: false
    entities:
      - type: custom:text-divider-row
        text: Kasa LED Light Strip Effects
        align: left
      - type: custom:rgb-light-card
        entity: light.[YOUR KASA LED LIGHT STRIP ENTITY ID HERE]
        justify: around
        label_size: 8
        colors:
          - type: call-service
            label: Aurora
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/aurora.png')
          - type: call-service
            label: Bubbling
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/bubbling.png')
          - type: call-service
            label: Candy Cane
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/candycane.png')
          - type: call-service
            label: Christmas
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/christmas.png')
          - type: call-service
            label: Flicker
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/flicker.png')
          - type: call-service
            label: Hannukah
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/hannukah.png')
          - type: call-service
            label: Haunted
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/hauntedmansion.png')
  - type: entities
    show_header_toggle: false
    entities:
      - type: custom:rgb-light-card
        entity: light.[YOUR KASA LED LIGHT STRIP ENTITY ID HERE]
        justify: around
        label_size: 8
        colors:
          - type: call-service
            label: Icicle
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/icicle.png')
          - type: call-service
            label: Lightning
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/lightning.png')
          - type: call-service
            label: Ocean
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/ocean.png')
          - type: call-service
            label: Rainbow
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/rainbow.png')
          - type: call-service
            label: Raindrops
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/raindrops.png')
          - type: call-service
            label: Spring
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/spring.png')
          - type: call-service
            label: Valentines
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/valentines.png')
  - type: entities
    show_header_toggle: false
    entities:
      - type: custom:rgb-light-card
        entity: light.[YOUR KASA LED LIGHT STRIP ENTITY ID HERE]
        justify: around
        size: 50
        colors:
          - type: call-service
            label: Aurora
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/aurora.png')
          - type: call-service
            label: Bubbling
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/bubbling.png')
          - type: call-service
            label: Candy Cane
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/candycane.png')
          - type: call-service
            label: Christmas
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/christmas.png')
          - type: call-service
            label: Flicker
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/flicker.png')
          - type: call-service
            label: Hannukah
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/hannukah.png')
          - type: call-service
            label: Haunted
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/hauntedmansion.png')
  - type: entities
    show_header_toggle: false
    entities:
      - type: custom:rgb-light-card
        entity: light.[YOUR KASA LED LIGHT STRIP ENTITY ID HERE]
        justify: around
        size: 50
        colors:
          - type: call-service
            label: Icicle
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/icicle.png')
          - type: call-service
            label: Lightning
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/lightning.png')
          - type: call-service
            label: Ocean
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/ocean.png')
          - type: call-service
            label: Rainbow
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/rainbow.png')
          - type: call-service
            label: Raindrops
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/raindrops.png')
          - type: call-service
            label: Spring
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/spring.png')
          - type: call-service
            label: Valentines
            service: script.turn_on
            service_data:
              entity_id: script.[YOUR SCRIPT ENTITY ID HERE]
            icon_color: center/100% url('/local/[YOUR IMAGE FOLDER HERE]/[YOUR IMAGE SUB-FOLDER HERE]/valentines.png')
2 Likes