Sorry, your browser does not support JavaScript!
Sign In

Energy Meter for Node-RED: MQTT, Modbus TCP and Local API

Energy Meter Integration with Node-RED

An energy meter for Node-RED should do more than display electricity data in a vendor app. It should provide an open interface that Node-RED can read locally, transform and use in dashboards, databases, alerts and automation flows.

IAMMETER Wi-Fi energy meters support several Node-RED integration paths:

  • a ready-made IAMMETER node for quick local or cloud access;
  • MQTT for event-driven data flows;
  • Modbus TCP for standard local register polling;
  • a local HTTP API for simple LAN-based requests.

These options cover single-phase home energy monitoring, home solar monitoring and three-phase commercial or industrial projects.

Single-phase or three-phase energy meter
                    │
       ┌────────────┼────────────┐
       │            │            │
     MQTT       Modbus TCP    Local API
       │            │            │
       └────────────┼────────────┘
                    ▼
                 Node-RED
                    │
       ┌────────────┼────────────┐
       ▼            ▼            ▼
   Dashboard     Database    Automation

1. What Makes an Energy Meter Suitable for Node-RED?

When selecting an energy meter for Node-RED, check whether it provides:

  • local access without requiring every request to pass through a cloud service;
  • MQTT, Modbus TCP or a documented local API;
  • bidirectional power and energy values for grid import and export;
  • separate measurements for each phase or channel;
  • stable data fields that can be used in reusable Node-RED flows;
  • a suitable measurement structure for the electrical system.

All current IAMMETER energy meters can be integrated with Node-RED. The main product choice depends on whether the project is residential or commercial/industrial, and how many phases or measurement channels are required.

2. Choose an Energy Meter for Node-RED

2.1 Home energy monitoring

Model Best fit Measurement structure Typical Node-RED use
WEM3080 Single-phase household electricity One channel Whole-home consumption, power alerts and appliance schedules
WEM2067 Single-phase home solar or split-phase residential monitoring Two channels Measure grid exchange and solar inverter output with one meter
WEM3050T Three-phase homes or projects requiring three measurement channels Three channels Per-phase monitoring, home solar and flexible multi-channel flows

For a single-phase home solar system, WEM2067 can measure both the solar inverter output and grid import/export. Node-RED can then use those values for dashboards, surplus-solar automation and load control.

2.2 Commercial and industrial energy monitoring

Model Best fit Measurement structure Typical Node-RED use
WEM3080T Standard three-phase power monitoring Three phases Per-phase monitoring, demand alerts, logging and control logic
WEM3046T / WEM3046TE Higher-current systems using external current transformers Three 5 A CT inputs Distribution panels, commercial buildings and industrial monitoring

WEM3046T and WEM3046TE measure the 5 A secondary output of external CTs. Apply the configured CT ratio when interpreting the primary-system values. This is a characteristic of the meter and CT installation, not a Node-RED limitation.

3. Choose a Node-RED Integration Method

Method Data direction Internet required Best for Main consideration
IAMMETER node / local API Node-RED requests the meter No, for local access Fast setup and custom HTTP flows Node-RED must reach the meter on the LAN
MQTT Meter publishes to a broker No, when using a local broker Decoupled flows and multiple subscribers Configure the broker in the meter WebUI
Modbus TCP Node-RED polls meter registers No Standard local and industrial integration Decode registers and scaling correctly

Choose MQTT when the broker should distribute measurements to Node-RED and other applications. Choose Modbus TCP when the project already uses industrial register polling. Choose the local API or IAMMETER node for the shortest route from the meter to a Node-RED flow.

For a wider comparison of local integration options, see Local API, Modbus TCP, MQTT and HTTPS.

4. Quick Start with the IAMMETER Node

IAMMETER provides the open-source node-red-contrib-iammeter package. It supports local real-time access to an IAMMETER energy meter and cloud real-time access through an IAMMETER-Cloud account.

4.1 Install the node

In Node-RED:

  1. Open Manage palette.
  2. Select Install.
  3. Search for node-red-contrib-iammeter.
  4. Install the package and add the IAMMETER node to a flow.

The source code is available in the IAMMETER Node-RED GitHub repository.

4.2 Read the meter locally

Use the local real-time node and enter the meter's LAN IP address. Connect its output to a Debug node first so that you can inspect the returned data structure before building calculations or dashboards.

IAMMETER energy meter data in Node-RED

A single-phase meter returns one set of measurements. A dual-channel or three-phase meter returns data for each channel or phase. Build the flow around the actual array length instead of assuming that every meter has the same number of sensors.

5. Connect an MQTT Energy Meter to Node-RED

MQTT is useful when the energy meter should publish data to a broker and one or more applications need to subscribe.

Meter side

Use the meter's current WebUI to configure:

  • broker hostname or IP address;
  • broker port;
  • username and password when required;
  • MQTT topic and upload settings.

Home Assistant MQTT Discovery is only needed when Home Assistant should automatically discover the meter. It is not required for an ordinary Node-RED MQTT flow.

Node-RED side

  1. Add an MQTT in node.
  2. Configure the same broker used by the meter.
  3. Subscribe to the meter's topic.
  4. Connect a JSON node if the payload needs parsing.
  5. Route the values to a dashboard, database or automation flow.

See Configure IAMMETER for an MQTT broker for the current meter-side setup.

6. Connect a Modbus TCP Energy Meter to Node-RED

Modbus TCP is a good fit for three-phase energy monitoring, commercial projects and systems that already use Modbus devices.

A typical Node-RED flow uses a Modbus client node to poll the meter over the local network. For IAMMETER meters, start with:

  • protocol: Modbus TCP;
  • TCP port: 502;
  • unit/device ID: 1;
  • function: read holding registers (03).

Use the official Modbus TCP register and testing guide for register addresses, data types and scaling. Test one small register range first, verify the decoded result against the meter, and only then expand the flow.

Practical examples:

7. Use the Local HTTP API in a Node-RED Flow

For a simple LAN integration, an HTTP Request node can request the meter's local API directly. This is useful when you want full control over polling and parsing without installing a device-specific Node-RED package.

Before creating the complete flow:

  1. confirm that Node-RED can reach the meter's IP address;
  2. test the selected endpoint in the IAMMETER Local API Explorer;
  3. inspect the response from the actual meter model;
  4. set a polling interval appropriate for the automation rather than creating unnecessary requests;
  5. handle timeouts so that a temporary Wi-Fi interruption does not stop the flow.

The API Explorer must be opened from a device that can access the meter on the same LAN.

8. Data Available to Node-RED

Depending on the meter model and interface, a Node-RED flow can work with values such as:

  • voltage;
  • current;
  • active power;
  • reactive power;
  • power factor;
  • frequency;
  • imported energy;
  • exported energy;
  • individual phase or channel measurements.

Keep raw meter data separate from calculated fields. For example, a home solar flow may calculate household load from grid exchange and inverter output, while the original measurements remain available for troubleshooting.

9. Node-RED Energy Monitoring Use Cases

Home electricity monitoring

  • show current household demand;
  • store hourly and daily consumption;
  • notify when power exceeds a threshold;
  • change appliance schedules using real measurements.

Solar monitoring and surplus automation

  • measure solar generation and grid import/export;
  • identify when solar power is being exported;
  • switch discretionary loads when surplus exceeds a safe threshold;
  • send measurements to InfluxDB, SQL or Grafana.

See the home solar wiring diagrams before deciding where each CT or meter channel should be installed.

Examples:

Three-phase commercial monitoring

  • compare current and power across phases;
  • identify phase imbalance or abnormal demand;
  • log energy by panel or load;
  • trigger alerts or downstream control logic;
  • integrate the readings with a local EMS, BMS or reporting database.

10. Store and Visualize Energy Data

Node-RED is primarily a flow and automation tool. For longer-term analysis, send normalized measurements to a database or dashboard system.

A common architecture is:

Energy meter → Node-RED → InfluxDB / SQL → Grafana
                         └→ alerts and control

Use consistent field names, units and timestamps. For a three-phase meter, retain both per-phase values and any totals calculated by the flow.

11. Reliability Checklist

  • Assign the meter a stable LAN address or DHCP reservation.
  • Verify the sign convention for bidirectional active power.
  • Do not assume single-phase and three-phase payloads have the same length.
  • Apply the external CT ratio correctly for WEM3046T/WEM3046TE installations.
  • Add timeout, reconnect and invalid-payload handling.
  • Avoid high-frequency duplicate polling from several clients.
  • Test automation with safe thresholds and delays before controlling a real load.
  • Keep electrical installation and CT orientation consistent with the wiring diagram.

12. Node-RED or Home Assistant?

Choose Node-RED when the project needs flexible data transformation, routing, custom control logic or integration with databases and industrial protocols.

Choose Home Assistant when the priority is ready-made entities, household dashboards and smart-home device management. The two platforms can also be used together: Home Assistant can provide the user interface while Node-RED handles more complex automation.

13. Next Steps

  1. Choose a home or commercial energy meter.
  2. Select MQTT, Modbus TCP or local API according to the system architecture.
  3. Test the first measurement in a Debug node.
  4. Normalize values and units before adding calculations.
  5. Add storage, visualization and automation only after the input data is verified.

Last updated: July 17, 2026.

Top