node-red-contrib-universal-mqtt-switch 1.1.0

A universal MQTT switch subflow for Shelly, OpenBeken, and legacy devices

npm install node-red-contrib-universal-mqtt-switch

node-red-contrib-universal-mqtt-switch

A robust, "set-and-forget" Node-RED subflow for controlling nearly any MQTT-enabled switch. Perfect for mixing old Shelly Gen 1 hardware with newer OpenBeken or Tasmota devices in Dashboard 2.0.

Why use this?

MQTT devices are notorious for having inconsistent topic structures. This node abstracts that away:

  • Input: Accepts simple true/false booleans.
  • Output: Sends the correct string (on/off) or integer (1/0) based on your config.
  • Feedback: Converts device responses back into booleans for UI switches.
  • Safety: Built-in 5-minute watchdog warns you via node status if the device drops off the network.

Installation

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

npm install node-red-contrib-universal-mqtt-switch

## Getting Started
1. **Drag** the 'Universal MQTT Switch' node onto your workspace.
2. **Double-click** to configure.
3. **Select your Broker** from the dropdown (or create a new one).
4. **Enter your topics** (Tip: Copy/Paste exactly from your device's web UI).
5. **Connect** a Dashboard 2.0 Switch to the input and output.

REMEMBER: if you wire a Dashboard 2.0 Switch to this node - to prevent command loops wire the first output of this node to the input of your Dashboard 2.0 Switch to keep its state synchronized, but ENSURE the Dashboard Switch node does pass input messages to its output (that checkbox is off by default usually and should stay that way.)

### Payload Compatibility Guide
| Device Type | Use Strings Setting | Expected MQTT Payload |
| :--- | :--- | :--- |
| **Shelly (Gen 1)** | Checked (True) | `"on"` / `"off"` |
| **Tasmota** | Checked (True) | `"ON"` / `"OFF"` |
| **OpenBeken** | Unchecked (False) | `1` / `0` |
| **Home Assistant** | Unchecked (False) | `1` / `0` |

Node Info

Version: 1.1.0
Updated 1 day ago
License: MIT
Rating: not yet rated

Categories

Actions

Rate:

Downloads

0 in the last week

Keywords

  • node-red
  • mqtt
  • shelly
  • openbeken
  • home-automation

Maintainers