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 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-red-contrib-openbeken-subflow

v1.3.1

Published

Optimized OpenBeken support for Node-RED with Dashboard 2.0 dynamic UI updates

Readme

node-red-contrib-openbeken-subflow

A high-performance Node-RED subflow designed specifically for OpenBeken flashed hardware. This node simplifies the integration of devices using Flag 10 and Flag 2 (immediate MQTT state feedback), provides built-in watchdog monitoring, and supports Cross-Device Synchronization for 3-way switch configurations.

Features

  • Closed-Loop Feedback: Automatically synchronizes with the device state using the .../1/get topic.

  • Watchdog Timer: Monitors device activity and updates the node status to "Offline" if no heartbeat is detected within 5 minutes.

  • State-Sync Groups: Support for multi-way (3-way/4-way) switching. Link multiple devices via a Global context to ensure states match even if UDP packets are dropped or firewalled.

  • Smart Sanitization: Accepts Booleans (true/false), Strings ("on"/"off"), or Numbers (1/0) and converts them to the correct format for OpenBeken.

  • Dashboard 2.0 Ready: Native support for UI updates including icon/color changes based on device connectivity.

Hardware Requirements

For the best experience, ensure your OpenBeken device has Flag 10 and Flag 2 enabled. Open your device's web console and run:Backlog Flag 10 1; Flag 2 1; restart

Configuration

  1. Broker: Select your MQTT Broker configuration node.

  2. Topic Base: Enter the base MQTT topic of your device (e.g., KitchenLights). Do not include trailing slashes.

  3. Sync Group (Optional): Enter a unique string (e.g., Kitchen3Way) to link multiple nodes together. Nodes sharing the same group name will stay synchronized automatically.

Anti-Chatter & Hybrid Sync (3-Way Switching)

This subflow uses a State-Locking mechanism to prevent "Relay Chattering" (rapid oscillations) often caused by the race condition between OpenBeken UDP Groups and MQTT feedback loops.

How it Works:

  1. Physical Trigger: When a physical switch is flipped, the hardware sends a 1/get message.

  2. Lockout Window: Upon receiving a hardware state change, the subflow "locks" the Sync Group for 400ms.

  3. Loop Prevention: The subflow tags the outgoing synchronization message with source: "from_hw".

  4. Logic Gate: Any node receiving a message tagged from_hw will update its local relay but will not echo that change back out to the network. This breaks the infinite loop.

Recommended Wiring for UDP Backup:

If you want MQTT to act as a fail-safe for dropped UDP packets:

  • Wire Output 1 of Node A to Input 1 of Node B.

  • Wire Output 1 of Node B to Input 1 of Node A.

  • Connect your Dashboard UI switch to the inputs of both nodes.

Input/Output

  • Input: Send a boolean true/false or string "on"/"off" to toggle the device.

  • Output 1: Returns a clean boolean true/false based on the hardware's actual state. Perfect for updating Dashboard switches.

  • Output 2: MQTT output (Internal use, wire to MQTT Out node).

  • Output 3: Status output for custom logging or dashboard indicators.

Tips for Success

  • Dashboard 2.0: Wire a Dashboard "Switch" node to the input of any node in a Sync Group. To ensure the UI reflects changes from all physical switches, wire Output 1 of all grouped nodes back to the Dashboard Switch input.

  • LWT: This node relies on the device being "connected" to show online status. Ensure your MQTT Broker is configured to handle the device's Last Will and Testament (LWT).