npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-kasa-lightstrip

v2.0.2

Published

A simple homebridge plugin to control TP-Link Kasa Lightstrips (ex. KL4005L)

Downloads

37

Readme

GitHub license GitHub last commit GitHub issues Npm package version Npm package total downloads

homebridge-kasa-lightstrip

homebridge-kasa-lightstrip is a Homebridge plugin that exposes tp-link kasa light strip devices to Apple's HomeKit smart home platform.

This plugin was developed as a stop-gap to provide integration of Kasa's light strips, while the [far superior] plugin (homebridge-tplink-smarthome) lacks support!

This plugin creates Lightbulb accessories for you to integrate with your lightstrips. It can also, optionally, create stateless Switch accessories to enable Light Effects.

Prerequisites

The python-kasa library is required for this plugin. Credit to that team and the maintainers! :trophy::clap:

Installation instructions for Homebridge Raspberry Pi Image:

sudo apt install python3-pip
sudo pip3 install python-kasa --pre

Installation instructions for the onzu/homebridge Docker Container:

sudo docker exec -it homebridge sudo pip3 install python-kasa

...where homebridge is your container name. You can get your container name by typing sudo docker ps.

Validation

You can validate that the python-kasa library is installed by executing kasa --help at the command line of your environment:

kasa --help output

You should see something similar the above output. If you do not, and you see something like -bash: kasa: command not found, you will need to install it (instructions above), or find a way to get it into your environment. Review the python-kasa repository for any additional instructions.

Installation Instructions

Option 1: Install via Homebridge Config UI X

Search for "kasa" in homebridge-config-ui-x and install homebridge-kasa-lightstrip.

Option 2: Manually Install

sudo npm install -g homebridge-kasa-lightstrip

Supported Devices

Kasa Light Strips

  • KL400L5 - Brightness, Hue, Saturation, Effects (via stateless switch)
  • KL430 - ""

Configuration

Device names and IP Addresses must be configured manually in current state:

Example

platforms: [
    {
        "platform": "HomebridgeKasaLightstrip",
        "accessories": [
            {
                "name": "Couch Strip",
                "ip": "10.10.10.10",
                "effects": {
                    "Aurora": true,
                    "Hanukkah": true,
                    "CustomEffects": [
                        {
                            "name": "MyCustomEffect1",
                            "json": "{'custom':1,'id':'xqUxDhbAhNLqulcuRMyPBmVGyTOyEMEu','brightness':100,'name':'MyCustomEffect1','segments':[0],'expansion_strategy':1,'enable':1,'type':'sequence','duration':0,'transition':1500,'direction':4,'spread':7,'repeat_times':0,'sequence':[[120,100,100],[240,100,100],[260,100,100],[280,100,100]]}"
                        }
                    ]
                }
            }
        ],
        "name": "KasaLightstrip",
        "debug": false
    }
]
  • platform (mandatory): the name of the plugin
  • accessories (mandatory): array containing the devices and their info:
    • name (mandatory): the name of the accessory to create
    • ip (mandatory): the IP address of the device
    • effects (optional): object containing any effects to create:
      • <effectName> (optional): boolean to enable a specific built-in effect
      • CustomEffects (optional): array containing any custom effects to create:
        • name (optional): the name of the custom effect
        • json (optional): the json for the custom effect*
  • name (optional): platform name to display in logs
  • debug (optional): boolean to enable more verbose logging

Lighting Effects

Stateless Switches (they turn off after 1 second) are created if you include any of the effects object in your config.json. All 14 pre-defined Lighting Effects are available to be created and toggled for any Lightstrip you configure. Additionally, custom Lighting Effects can be created.

*see CustomLightingEffects.md for more information

Characteristic Errors

Erorrs may common due to the nature of the implementation: Flooding your devices with rapid python-kasa calls may result in several dropped connections.

It is most often seen with the Brightness slider -> as you slide, the Home app can send numerous Brightness values, resulting in numerous kasa executions. You'll see the following displayed in the log:

[KasaLightstrip] StripName - Error setting characteristic 'Brightness'

Attempt to slow your inputs! :thinking: Or speed your swipe?! :man_shrugging: