node-red-iot-mqtt-api
raw JSON → 1.0.1 verified Mon Apr 27 auth: no javascript
A Node-RED custom node that integrates IoT MQTT APIs, enabling easy connection and data handling with MQTT brokers. Version 1.0.1 is the latest stable release, with a low release cadence. It simplifies IoT data flow in Node-RED by providing a dedicated node for MQTT-based IoT APIs, differentiating from generic MQTT nodes by offering pre-configured API integration for common IoT platforms.
Common errors
error TypeError: Cannot read property 'on' of undefined ↓
cause MQTT broker not connected properly.
fix
Check MQTT broker configuration and ensure the broker is running.
error Error: Invalid topic specified ↓
cause Topic field is empty or incorrectly formatted.
fix
Provide a valid MQTT topic string (e.g., 'sensor/temperature').
Warnings
breaking Node-RED version compatibility: Requires Node-RED >=2.0.0. ↓
fix Ensure Node-RED is updated to version 2.0.0 or higher.
gotcha MQTT broker must be configured; node will not work without a valid broker address. ↓
fix Set the broker property to the MQTT broker URL (e.g., mqtt://localhost:1883).
deprecated Node may use deprecated Node-RED APIs; check Node-RED logs for warnings. ↓
fix Consider alternative nodes or wait for update.
Install
npm install node-red-iot-mqtt-api yarn add node-red-iot-mqtt-api pnpm add node-red-iot-mqtt-api Imports
- node-red-iot-mqtt-api
Install via Node-RED palette manager or npm: npm install node-red-iot-mqtt-api
Quickstart
// This package is a Node-RED node, not a library with code imports.
// To use: In your Node-RED instance, install via Manage Palette or npm.
// Then drag 'iot-mqtt-api' node from palette, configure MQTT broker and topic.
// Example flow JSON (deploy to Node-RED):
[{"id":"1","type":"iot-mqtt-api","z":"","name":"","broker":"","topic":"","x":400,"y":200,"wires":[["2"]]},{"id":"2","type":"debug","z":"","name":"","active":true,"console":"false","complete":"true","x":600,"y":200,"wires":[]}]