Knowledge/Integration/Node-RED

GuideM-Center

M-Bus meters with the M-Center in Node-RED

Node-RED is well suited to converting, filtering and distributing meter values to other systems. It fetches the values from the EMU M-Center, either via Modbus TCP or via MQTT.

What you need

  • A configured M-Center with Modbus TCP server licence (210.300.04) or MQTT licence (210.300.03).
  • For Modbus the node-red-contrib-modbus package, installable via «Manage palette».
  • For MQTT a broker that both the M-Center and Node-RED can reach.

Route 1: Modbus TCP

  1. In the M-Center, enter the OBIS code for the required registers. The import tariff 1 reading (1-0:1.8.1) is then at register 1030.
  2. In Node-RED, add a «Modbus Read» node. Server: IP of the M-Center, port 502, type TCP.
  3. Unit ID: the Modbus device address of the meter in the M-Center.
  4. FC 3 (Read Holding Registers), address 1029 for register 1030, quantity 2, poll rate for example 15 minutes.
  5. Attach a function node that combines the two registers into a floating-point number.
// Two 16-bit registers (big endian, high word first) -> float32
const buf = Buffer.alloc(4);
buf.writeUInt16BE(msg.payload[0], 0);
buf.writeUInt16BE(msg.payload[1], 2);
msg.payload = buf.readFloatBE(0);
msg.topic = "apartment1/import_t1";
return msg;

The manual counts registers from 1, node-red-contrib-modbus expects the address from 0. Hence 1029 for register 1030. Compare the first value with the meter reading in the M-Center.

For several meters, create one read node per meter with its own unit ID. The addresses stay the same as long as the OBIS codes are entered.

Route 2: MQTT

With the MQTT licence, the M-Center publishes every value under its own topic. An «mqtt in» node with a wildcard subscription receives all values of an M-Center:

<prefix>/emu/mcenter/<MAC>/meterreading/#

First attach a debug node and look at the topics and the content of the messages. Then separate the values by topic with a switch node, for example by the OBIS code at the end of the path.

Which route?

Modbus TCPMQTT
Addressesfixed, documented in the manualtopic per meter and register
QueryNode-RED polls activelyM-Center sends on its own
Further systemsa separate query for each systemany number of subscribers on the broker
Licence210.300.04210.300.03

Frequently asked questions


Can Node-RED read the status registers?

Yes. From register 11910 (float32) or 11912 (uint64) you find the status code of the last readout: 1 successful, 2 not successful, 3 successful with a message from the meter. Read status registers as uint64.

How do I read uint64?

Read four registers from the uint64 address, for example from 1031 for register 1032, and evaluate them in the function node with buf.readBigUInt64BE(0).

Read more


SEITEM-Bus to Modbus TCPRegister map SEITEM-Bus to MQTTTopic structure SEITEMeter data in GrafanaGuide SEITEMore integrationsOverview

Questions about the integration?


Send us your meter list. We will help with addresses, OBIS codes and licences.

Phone
+41 (0)41 545 03 00

Technical support
helpdesk [at] emuag.ch
Support form →