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

node-red-contrib-yeelight-compat-hue

v1.2.1

Published

A collection of Node-RED nodes for controlling and observing Yeelight lighting devices, compatible with node-red-contrib-node-hue flows.

Downloads

55

Readme

npm version Travis build status GitHub last commit npm downloads

nodeyeelight-compat-hue semantic-release

node-red-contrib-yeelight-compat-hue

Node-RED nodes to control MiHome/Xiaomi Yeelights from your smart home, somewhat API compatible with node-red-contrib-node-hue nodes.

Install

Run the following command in your Node-RED user directory – typically ~/.node-red:

npm i node-red-contrib-yeelight-compat-hue -S

Usage

Provides two palette nodes – one to send control commands to a Yeelight, and one to receive messages when a Yeelight's state changes.

Output node

Sets the state of the selected Yeelight device.

msg.payload must be an object containing the new state's properties of the selected Yeelight device.

| Property | Details | | :---| :---| | on | Sets the on state where the value is true or false| | bri | Sets the brightness value from 0 to 255 | | ct | Sets the color temperature value in Kelvin from 1700 to 6500 | | hue | Sets the hue value from 0 to 65535 | | sat | Sets the saturation value from 0 to 255 | | hex | Sets the rgb value from #00000 to #FFFFFF | | duration | Sets a transition time in milliseconds, e.g. 4500 means 4.5 seconds. Defaults to 500 |

Example payloads

 {
    "on": true,
    "bri": 255,
    "hue": 913,
    "sat": 255,
    "duration": 5000
}
{
    "on": true,
    "bri": 120,
    "hex": "#AA00CC",
}
{
    "ct": 2200,
}

The node supports sending color temperature values, hex values and HSV values.
The brightness value will always have to be provided separately and will not be deducted from e.g. a hex value's brightness component.

References

This node's input payload structure is based on node-red-contrib-node-hue, which is based on Node Hue API.

Input node

Returns the current state of the selected Yeelight device.

msg.payload is an object containing the current state of the selected Yeelight device.

The node will listen to changes of the connected Yeelight and send a message whenever a change is detected. The payload property of the message will be set to the new state of the Yeelight.

Additionally, a fresh state can be requested from the connected Yeelight by sending a message to the node. The payload property of the message will be overwritten with the state of the Yeelight. All other properties of the msg are preserved.

Example payload

{
    "state": {
        "on": false,
        "bri": 255,
        "colormode": "rgb",
        "hex": "#ff1500",
        "hue": 913,
        "sat": 255
    },
    "name": "Closet",
    "raw": {
        "name": "Closet",
        "power": "off",
        "bright": "100",
        "rgb": "16717056",
        "ct": "4244",
        "hue": "0",
        "sat": "100",
        "color_mode": "1",
        "delayoff": "0",
        "flowing": "0",
        "flow_params": "0,1,10000,1,16711680,69,33000,1,16711882,34,39000,1,16744704,17,34000,1,16711680,61",
        "music_on": "0"
    }
}

The raw property of msg.payload contains the raw state information retrieved from the Yeelight for advanced usage.
Note that value scales are not compatible with node-red-contrib-node-hue, and that hue value and rgb value will not match since only the correct color per color_mode is returned by the lamp.

Configuration node

Configures a Yeelight connection to one light in the local network.

Options

| Property | Details | | :--- | :--- | | Hostname | An IP address or other hostname that points to a Yeelight on the network | | Port number | Port number the Yeelight is accessible over, default being 55443 |

Details

Developer mode/LAN control has to be activated (usually from within the Yeelight app) to allow local control of the Yeelight through Node-RED. You can learn more about Yeelight developer options here.

Support

If something is not working as expected, if you think there is a feature missing, or if you think this node could be improved in other ways, please create an issue on GitHub.

Links

Hello bear