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

@felipejfc/homebridge-xiaomi-yeelight-x

v2.0.4

Published

Control Xiaomi branded Yeelight in HomeBridge

Downloads

10

Readme

Xiaomi branded Yeelight support for Homebridge: https://github.com/nfarina/homebridge.

There are several plugins for Yeelights already, for example https://github.com/cellcortex/homebridge-yeelighter. If you have a Yeelight branded Yeelight that still supports LAN control, my plugin isn't for you.

This plugin focuses on Xiaomi branded Yeelights that were stripped of the ability to control them via LAN, rendering the above and similar plugins useless for their control. I got very frustrated by that, considering that these lamps are almost identical to Yeelight lamps. This, combined with the fact that my Xiaomi Yeelight lamps are extremely unreliable in Homekit, motivated me to create my first plugin for Homebridge to alleviate these issues.

I'm happy to report that for me this plugin is incomparably more reliable than their own HomeKit integration. The lights have not gone into a "Not Responding" state since, while previously they went into such state several times per day.

This particular fork improved night light (aka moonlight) support in yeelink.light.ceiling22 by adding an independent light service with its own brightness control to take full advantage of the API offered by Yeelight.

Caveats

  • Obtaining a device encryption token is required. Althought inconvenient, it's still possible. See "Setting up the lights" section at the bottom.
  • Currently I've implemented support only for the yeelink.light.ceiling22 (the round ceiling LED light) model, since that's the only one available to me. Underlying dependencies (miio) had to be adjusted to support this light as well, since it's not out of the box. You can use miiocli yeelight --ip 192.168.0.100 --token <secret> info CLI command to see the model of your device. If it's not yeelink.light.ceiling22 you can let me know and if it doesn't have any special API requirements I can add that in rather quickly.

Installation

You might want to update npm through: $ sudo npm -g i npm@latest

Install this plugin through: $ sudo npm -g i homebridge-xiaomi-yeelight

Add this plugin to your HomeBridge platform list, see Configuration section.

Configuration

"platforms": [
  {
    "name": "XiaomiYeelightSupport",
    "debugLogging": false,
    "platform": "XiaomiYeelightSupport"
  }
]

The plugin supports setting the configuration through homebridge-config-ui-x. You'll be able to configure the device details there, or you can add them as a parameter in the JSON config:

"lights": [
    {
        "ipAddress": "192.168.0.100", // local ip address of the light
        "token": "<secret token>", // light encryption token, see Token section for more info
        "name": "Dresser Light" // friendly name for the light
    },
    {
        ...
    }
],

Setting up the lights

Since Xiaomi/Yeelight has removed the option to control Xiaomi branded Yeelights via LAN, this process is more convoluted than it should be.

First of all, you have to obtain the encryption token of the light after adding it to one of the control applications (Xiaomi Home or Yeelight). To do so is left as an excercise to the user. Personally I used an Android phone to set up the lights in the Yeelight app, then I downloaded app backup over ADB and extracted the token using Miio CLI from the backup. There are many possible approaches described to extract the token, choose one that fits you best.

⚠️ After setting up the lights, I would suggest considering blocking their access to the Internet. I wouldn't want my lamps to be forced some OTA update that restricts them even further to Xiaomi's own home management app.

🤝 Contributing

Contributions, issues and feature requests are welcome!

Show your support

Give a ⭐️ if this project helped you!