Step 1: enter OBIS codes in the M-Center
In the M-Center, enter the OBIS code for every register that Home Assistant should receive. The value then sits at a fixed address, for example the import tariff 1 reading (1-0:1.8.1) at register 1030. Note the «Modbus TCP Server device number» of each meter. In Home Assistant this is the device address.
Also check the unit of the register in the M-Center. Home Assistant takes the numerical value; you define the unit yourself. If the M-Center shows Wh, enter Wh in Home Assistant.
Step 2: set up Modbus in Home Assistant
Extend the configuration.yaml. The example reads import tariff 1 and tariff 2 of a meter with device address 9 and the water meter with address 12:
modbus:
- name: m_center
type: tcp
host: 192.168.1.50 # IP of the M-Center
port: 502
sensors:
- name: "Apartment 1 import tariff 1"
slave: 9 # device address in the M-Center
address: 1029 # register 1030, counted from 0
input_type: holding
data_type: float32
unit_of_measurement: Wh
device_class: energy
state_class: total_increasing
scan_interval: 900
- name: "Apartment 1 import tariff 2"
slave: 9
address: 1059 # register 1060
input_type: holding
data_type: float32
unit_of_measurement: Wh
device_class: energy
state_class: total_increasing
scan_interval: 900
- name: "Apartment 1 cold water"
slave: 12
address: 2999 # register 3000
input_type: holding
data_type: float32
unit_of_measurement: m³ # unit as in the M-Center
device_class: water
state_class: total_increasing
scan_interval: 900
Three points where things often go wrong:
- Address: the manual counts registers from 1, Home Assistant from 0. That is why the example uses 1029 for register 1030. Check this once against a known meter reading.
- Byte order: the M-Center delivers big endian with the high word first. This matches the default setting of Home Assistant, no
swapis needed. - Key name: depending on the Home Assistant version, the device address is called
slaveordevice_address. The documentation of your version applies.
The scan_interval of 900 seconds corresponds to the M-Center’s readout interval of 15 minutes. Querying more often does not bring newer values.
Step 3: energy dashboard
After the restart, the sensors appear in Home Assistant. Because they carry device_class: energy or water and state_class: total_increasing, they can be selected under Settings → Dashboards → Energy as grid consumption, device or water consumption.
Alternative: MQTT
If the M-Center has the MQTT licence, it can publish its values to the Home Assistant broker, for example to the Mosquitto add-on. The topics follow the pattern <prefix>/emu/mcenter/<MAC>/meterreading/<serial number>/byobis/<OBIS code>.
Look at the messages before setting up, for example with MQTT Explorer or in the Home Assistant MQTT integration under «Listen to a topic». Then create an MQTT sensor for each topic and read the value according to the message content.
Modbus is the simpler route if only Home Assistant needs the values. MQTT pays off if other systems should read along.