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-wled-ws

v0.0.14

Published

WLED strips plugin for Homebridge

Downloads

220

Readme

Homebridge WLED plugin

npm npm npm GitHub last commit GitHub build verified-by-homebridge

This is a Homebridge dynamic platform plugin for controlling LED strips connected to a WLED controller. It is based on the fantastic wled-client library, which provides access to WLED's JSON API using websockets.

Description

The plugin adds a Lightbulb to Homekit for every configured WLED controller. The Lightbulb can be switched on and off and it's dimmable. Depending on the LED configuration additional services will be made available (e.g. color selection). For each configured preset a switch is created that can be used in for automation. Unlike other plugins the preset selection is not implemented as a Homekit Television service.

Configuration

The plugin supports schema based configuration. All settings can be entered using the plugin's configuration dialog. There is a basic input data validation included, however this needs to be improved in future versions.

Using Homebridge's integrated JSON Editor requires the following configuration entries:

{
    "name": "Homebridge-Wled-WS",
    "platform": "wled-ws",
    "controllers": [
        {
            "name": "My WLED Controller",
            "address": "192.168.1.100",
            "presets": "DoorClosed,DoorOpen",
            "showRealTimeModeButton": false,
            "resetRealTimeModeAfterStream": true
        }
    ],
    "logging": false
}

Settings

| Setting | Value | Comment | | :----------| :-------------------------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | name | Name of the WLED controller | This name is used for the acessory in Homekit and for the Homebridge logs | | address | IP address or host name | Enter the address of the controller - make sure it is the same which is shown as Client IP in the WLED Wifi settings | | presets | list of presets | Enter a comma separated list of presets. A switch will be created in Homekit for each preset | | logging | True or False | If enabled (=True) WLED's JSON data will be logged. Leave it disabled if everything works as expected. If you want to file an issue on Github turn it on for later analysis | | showRealTimeModeButton | True or False | If enabled (=True) a switch will be created in Homekit to enable/disable real-time mode. This is useful if you sometimes want to disable the real time mode. | | resetRealTimeModeAfterStream | True or False | If disabled (=True) the showRealTimeModeButton Switch controls the state of the realtime mode. If enabled realtime mode always turns back on, after finising a real time mode session. |

[!IMPORTANT] WLED organizes presets by id. This plugin uses names for configuration. When starting, it checks whether the name exists. If not, an error message is generated. In such a case please check the preset name for typos.

Why using websockets instead of MQTT or HTTP?

Before starting the implementation of this plugin I intended to use WLED's MQTT feature to control my LED strips. While sending data in JSON format to the WLED controller is straightforward, it was difficult for me to parse the answer, which is in XML format. I am not aware of an existing MQTT Homebridge plugin to handle such a device. The HTTP interface is more consistent in that sense, but requires polling to get state updates when the WLED state is modified outside Homekit/Homebridge (e.g. by mobile apps or other smart home automation systems). The websocket approach allows real-time state updates for all connected clients.

Limitations

  1. WLED supports segments, however the created Homekit accessory only controls the first (main) segment
  2. The brightness is set for the whole strip, brightness per segment is ignored

WLED Compatibility Notes

| Firmware | Tested | Comment | | :----------| :-------------------------- | :------ | | 0.14.1 | ✅ | | 0.14.2 | 🔥 | The websocket interface is broken. Using this plugin will most likely trigger a reboot of your WLED, hence the connection will fail. | | 0.14.3 | ✅ | |

Thanks to the contributors

  • @LeLunZ for adding live mode support