Knowledge/Integration/Home Assistant

GuideM-Center

M-Bus meters with the M-Center in Home Assistant

Home Assistant has a built-in Modbus integration. With it you read the values of all meters on the EMU M-Center directly and combine electricity, heat and water in the energy dashboard.

What you need

  • A configured M-Center with Modbus TCP server licence (210.300.04) or MQTT licence (210.300.03).
  • The IP address of the M-Center and the Modbus device address of each meter.
  • OBIS codes entered for the registers you want to query.
  • Access to the configuration.yaml of Home Assistant.

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 swap is needed.
  • Key name: depending on the Home Assistant version, the device address is called slave or device_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.

Frequently asked questions


Which licence do I need for Home Assistant?

For Modbus the Modbus TCP server licence 210.300.04, for MQTT the MQTT licence 210.300.03. One is enough.

Why does Home Assistant show a wrong value?

Usually the address is off by one or it is the wrong register. For comparison, read the same value with modpoll or another Modbus tool and compare it with the meter reading in the M-Center.

Can I use float32 or uint64?

Both. float32 is simpler but rounds very large meter readings. For uint64 (register 1032 instead of 1030) set data_type: uint64.

Read more


SEITEM-Bus to Modbus TCPRegister map SEITEM-Bus to MQTTTopic structure SEITECommissioning the M-CenterGuide SEITEMore integrationsOverview

Questions about the integration?


Send us your meter list and the configuration. We will help with addresses and OBIS codes.

Phone
+41 (0)41 545 03 00

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