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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-red-contrib-xiaomi-devices

v1.0.14

Published

A set of nodes to control some of the popular Xiaomi sensors which are connected to the Xiaomi Gateway.

Downloads

110

Readme

node-red-contrib-xiaomi-devices

This module contains the following nodes to provide easy integration of the Xiaomi devices into node-red.

The following devices are currently supported:

  • Temperature/humidity sensor
  • Magnet switch
  • Button switch
  • Motion sensor
  • Power plug (zigbee)
  • Power plug (wifi)

Preperation

To receive the gateway json messages on your network you need to enable the developer mode, aka LAN mode in the gateway.

A UDP input node is needed to receive the json messages. An UDP output node to send command's to the gateway.

To control the Wifi-Plug, extensive use is made of the miio library created by Andreas Holstenson. Make sure to check his page for compatible devices.

Install

cd ~\.node-red
npm install node-red-contrib-xiaomi-devices

Usage

From the Xiaomi configurator screen add your different devices by selecting the type of device and a readable description. The readable discription is used on the different edit screen of the nodes to easily select the device you associate to the node.

Note that the Wifi power plug is not configured through the configurator as it is not connected to the gateway.

The Xiaomi configurator screen with ease of use to configure your different devices.

Xiaomi configurator in node-red

Tip: use the configurator from the side-panel (hamburger menu, configuration nodes) to manage your devices. Node-red doesn't update underlying edit screens if the configuration panel is opened / closed from the edit node screen. (If you do, you need to first close the edit node screen and reopen it by double-clicking the node you want to edit the properties for.)

To receive/send json UDP messages from/to the gateway you need to enable the local LAN mode on the gateway. To receive the json UDP messages in node-red you need to add an udp-node with the correct configuration:

Listen for: multicast messages
Group: 224.0.0.50
Local ip: <empty>
On port: 9898 ipv4
Output: String

If you want to sent messages to the gateway you need to add an UDP sender, here an example configuration:

Send a: UDP message to port: 9898
Address: <ip_of_your_gateway> ipv4

This configuration worked for me however I have seen people using different configuration to make UDP work.

Here an example of how to use the different nodes.

Xiaomi devices example in node-red

Roadmap

  • ~~Support for other devices like the smart-socket WiFi~~ Done!
  • Import (new) devices directly from the gateway