TapHome

solvimus MBUS-GEM – M-Bus Water Meter

Modbus TCP
Submitted by
Last updated: 11. 2026
solvimus MBUS-GEM – M-Bus Water Meter

TapHome has no M-Bus interface of its own. A wired M-Bus water meter is connected through an M-Bus to Modbus gateway, and TapHome reads it as a Modbus TCP device. This template uses the solvimus MBUS-GEM gateway (MBUS-GE20M, MBUS-GE80M, MBUS-GE125M, MBUS-GE250M, MBUS-GE500M): the gateway reads the meters on its M-Bus and offers their data as a Modbus TCP server on port 502. One imported module represents one water meter; for further meters the template is imported again.

The template reads the water volume in m³, the flow rate reported by the meter itself and the average flow between two gateway readouts in l/h. The average flow is meant for leak detection: smart rules in TapHome can compare it with limits, for example to raise an alarm when water keeps flowing at night.

Community template — not yet tested on hardware. The template was created in the TapHome portal from the solvimus MBUS-GEM user manual (version 1.31). It has not run on a real gateway and meter, nor on a simulator. Its register numbers (RegMeter, RegVolume, RegFlow) are placeholders: after the import, the installer sets them from the Register column of the gateway’s Meter tab. Check the connection with the test mode of the gateway (see Configuration) before relying on the values, and feedback from the field is welcome. Download the XML on this page, or get it from the TapHome portal: solvimus MBUS-GEM – M-Bus water meter — community template, and import it as a new module.

What you need

  • A solvimus MBUS-GEM gateway for wired M-Bus with Modbus TCP: MBUS-GE20M, MBUS-GE80M, MBUS-GE125M, MBUS-GE250M or MBUS-GE500M. The MBUS-GEWM is the wireless M-Bus variant and is not covered by this template.
  • A wired M-Bus water meter (EN 13757) that the gateway can read. Ultrasonic water meters typically also report the flow rate.
  • The gateway and the TapHome Core in the same local network.

Hardware connection

The MBUS-GEM mounts on a 35 mm DIN rail and has screw terminals for the M-Bus and the power supply and an RJ45 Ethernet port (10/100 Mbit/s).

ModelM-Bus unit loadsWidthPower supplyM-Bus baud rate
MBUS-GE20M202 modules21.6–24.5 VDCmax. 19200 bps
MBUS-GE80M802 modules21.6–24.5 VDCmax. 19200 bps
MBUS-GE125M1253 modules12–36 VDCmax. 9600 bps
MBUS-GE250M2503 modules12–36 VDCmax. 9600 bps
MBUS-GE500M5003 modules12–36 VDCmax. 9600 bps

One unit load (UL) mostly corresponds to one meter.

  1. Connect the M-Bus line of the water meter to the M-Bus terminals of the gateway.
  2. Connect the gateway to the local network with an Ethernet cable.
  3. Connect an external 24 VDC power supply. The gateway starts by itself.

Configuration

Network and meter list

The gateway ships with the static IP address 192.168.1.101 (subnet mask 255.255.255.0, gateway 192.168.1.254); its web interface opens at http://192.168.1.101/. On the first login the administrator has to change the password. The solvimus tool Netdiscover finds the gateway in the network and can switch it to another static address or to DHCP; with DHCP, find the assigned address in the DHCP server by the MAC address of the gateway. Without a DHCP server the gateway picks an address from 169.254.x.x. The template addresses the gateway by IP address, so give it a fixed address or a DHCP reservation.

In the web interface, search the M-Bus for meters so that the water meter appears in the meter list of the Meter tab, together with its values (volume and, if the meter reports it, flow).

Modbus settings in the Server tab

  1. Set Modbus mode to Modbus TCP and keep Modbus port at 502.
  2. Keep Modbus float only off. That mode removes the type and unit fields the template checks.
  3. Keep Modbus swap off. The template expects the default word order (most significant word first).
  4. Modbus multi slave on is recommended. Every meter then becomes its own virtual Modbus slave with its own address (1–247), and the register numbering restarts for each meter, so meters of the same type have the same register numbers.

After switching multi slave on or off, the addresses in the Meter tab must be assigned again (context menu Allocate).

Readout cycle

The gateway reads the meters independently of the Modbus requests: at the Readout cycle in the Configuration tab, or at the per-meter Cycle (in seconds) in the Meter tab. These settings decide how fresh the values in TapHome are. Some battery-powered M-Bus meters allow only a limited number of readouts per day; check the datasheet of the meter before you choose a short cycle.

Template settings after import

The gateway has no fixed register table. Every meter entry and every meter value gets its own block of 10 holding registers, and the start of each block is shown in the Register column of the Meter tab. The order of the values follows the order in which the meter sends its M-Bus records, so it differs between meter models. The template therefore keeps the start of each block in a module variable and computes every register address from it.

SettingWhereValue
IP addressImport parameterAddress of the gateway (the import dialog suggests 192.168.1.100; the gateway ships with 192.168.1.101)
SlaveIdImport parameter (default 1)With multi slave: the number in the Register column of the meter row. Without multi slave: 255
RegMeterModule variable (default 10)With multi slave: 10 (the meter entry starts at 10 in every virtual slave). Without multi slave: the number in the Register column of the meter row
RegVolumeModule variable (default 20)The number in the Register column of the volume row of the meter (unit m³)
RegFlowModule variable (default 30)The number in the Register column of the flow row of the meter (unit m³/h, m³/min or m³/s)

The defaults 10, 20 and 30 match the layout of the gateway test mode only; overwrite them with the numbers of the real meter.

Every device checks the entry type and the unit of its block. A wrong number shows an error on the device that names the module variable, for example RegVolume does not point to a volume value in m³ … copy the Register number of this value from the gateway Meter tab.

Connection check with Modbus test

With Modbus test switched on in the Server tab, the gateway serves static test data: a meter entry at register 10 and an energy value (unit Wh, 1234.5678 Wh) at register 20. With the default module variables, Water Volume then accepts register 10 as a meter entry (with a warning that the medium of the test meter, code 2, is not water) and reports that register 20 is not a volume value (unit code 5). Seeing exactly these messages proves that the IP address, port, slave address and register numbers reach the gateway as expected. Switch the test mode off afterwards and set the module variables of the real meter.

Device capabilities

All three devices are read only and read every 15 s. Their values change only when the gateway reads the meter, at its readout cycle.

Water volume

Water Volume is the meter reading in m³ to three decimals, read as the scaled floating-point value of the volume block. The device also checks the meter entry:

MessageTypeMeaning
RegMeter does not point to a meter entry …ErrorRegMeter points to a block that is not a meter entry
RegMeter points to a meter with medium code …, which is not a water meter …WarningThe meter is not a water meter (accepted medium codes: water, cold water, warm water, hot water and dual register water) — check RegMeter and SlaveId
The gateway could not read the meter in its last readout …ErrorCheck the M-Bus wiring, the meter address and the meter list of the gateway
Not all meter values were updated in the last gateway readoutWarningThe last readout was incomplete

The service attribute Meter serial number shows the serial number of the M-Bus meter and helps confirm that the template reads the right meter. A serial number that contains letters is shown as 0.

Average water flow

Average Water Flow is the volume increase between the two most recent gateway readouts, divided by the time between their readout timestamps, in l/h. It is recalculated only when the readout timestamp of the meter changes, so it is the average over one readout cycle.

  • After the first readout, after a restart of the TapHome Core and after a meter reset (volume lower than before) the value is 0 until the next readout.
  • If the gateway stops reading the meter, the last average stays; Water Volume then shows the read error.

The device reads the same volume block as Water Volume. Leak detection itself — limits, opening hours, alarms — is set up with smart rules in TapHome; the template provides the value.

Water flow rate

Water Flow Rate is the flow rate the meter reports itself, converted to m³/h (from m³/h, m³/min or m³/s). Not every M-Bus water meter reports a flow rate; ultrasonic meters typically do.

Troubleshooting

No communication

  • Check that the gateway and the TapHome Core are in the same network and that the gateway answers a ping.
  • Check that Modbus is on in the Server tab, that the port is 502 and that no firewall blocks it.
  • Use the test mode described above.
  • The gateway accepts up to five Modbus TCP connections at the same time in its standard configuration; beyond that limit, a new connection closes the oldest one.

An error names a module variable

The number in that variable points to a block of another type or unit. Copy the number again from the Register column of the Meter tab; with multi slave also check SlaveId. After switching multi slave on or off, assign the addresses again (Allocate) and copy the new numbers.

Values do not change

Check the readout cycle of the gateway and the readout limit of the meter. The system time of the gateway must be correct (set manually or via SNTP), otherwise the readout timestamps and the average flow are wrong.

Small deviation from the gateway website

The floating-point value has about 7 significant digits, so the last digits can differ slightly from the value on the web interface of the gateway.

Available devices

solvimus MBUS-GEM – water meter Module
Custom Variables
RegMeter (numeric) = 10Start of the meter entry (serial number, readout time, read status) — 10 with Modbus multi slave, otherwise the Register number of the meter row in the Meter tab
RegVolume (numeric) = 20Start of the volume value (unit m³) — the Register number of the volume row in the Meter tab
RegFlow (numeric) = 30Start of the flow rate value (unit m³/h, m³/min or m³/s) — the Register number of the flow row in the Meter tab
Water Volume Variable Read-only

Meter reading in m³ to three decimals; shows an error when the gateway could not read the meter

Register: H:RegVolume+4 Float Unit: m³ numeric
Service Attributes
Meter serial numberSerial number of the M-Bus meter — confirms that the template reads the right meter

Water Volume

Read
VAR info := MODBUSR(H, RegVolume+7, UInt16);
VAR unit := GETBITS(info, 0, 8);
VAR factor := SWITCH(unit, 7, 1, 0);
IF GETBITS(info, 8, 8) != 0 OR factor = 0
    ADDERROR(1, "RegVolume does not point to a volume value in m³ (entry type " + TOSTRING(GETBITS(info, 8, 8)) + ", unit code " + TOSTRING(unit) + ") – copy the Register number of this value from the gateway Meter tab");
    RETURN(NaN);
END
RETURN(ROUND(MODBUSR(H, RegVolume+4, Float) * factor * 1000) / 1000);
Read (module)
VAR meterInfo := MODBUSR(H, RegMeter+7, UInt16);
VAR medium := 0;
VAR flags := 0;
IF GETBITS(meterInfo, 8, 8) != 2
    ADDERROR(1, "RegMeter does not point to a meter entry (entry type " + TOSTRING(GETBITS(meterInfo, 8, 8)) + ") – set RegMeter to the start of the meter entry (10 with Modbus multi slave, otherwise the Register number of the meter row in the gateway Meter tab)");
ELSE
    medium := GETBITS(MODBUSR(H, RegMeter+3, UInt16), 0, 8);
    IF medium != 6 AND medium != 7 AND medium != 21 AND medium != 22 AND medium != 23
        ADDWARNING(2, "RegMeter points to a meter with medium code " + TOSTRING(medium) + ", which is not a water meter – check that RegMeter and SlaveId belong to the water meter");
    END
    flags := MODBUSR(H, RegMeter+8, UInt16);
    IF GETBIT(flags, 0)
        ADDERROR(3, "The gateway could not read the meter in its last readout – check the M-Bus wiring, the meter address and the meter list of the gateway");
    ELSEIF GETBIT(flags, 1)
        ADDWARNING(4, "Not all meter values were updated in the last gateway readout");
    END
END
Service Attributes
Meter serial number
TOSTRING(MODBUSR(H, RegMeter+0, UInt32))
Average Water Flow Variable Read-only

Average flow between the two most recent gateway readouts, in l/h — for leak detection, for example water flowing at night

Register: H:RegVolume+4, H:RegMeter+4 Float, UInt32 Unit: l/h numeric

Average Water Flow

Read
VAR info := MODBUSR(H, RegVolume+7, UInt16);
VAR ts := 0;
VAR vol := 0;
IF GETBITS(info, 8, 8) != 0 OR GETBITS(info, 0, 8) != 7
    ADDERROR(1, "RegVolume does not point to a volume value in m³ (entry type " + TOSTRING(GETBITS(info, 8, 8)) + ", unit code " + TOSTRING(GETBITS(info, 0, 8)) + ") – copy the Register number of the volume value from the gateway Meter tab");
    RETURN(NaN);
END
ts := MODBUSR(H, RegMeter+4, UInt32);
IF ts = 0
    RETURN(NaN);
END
IF ts != PrevTime
    vol := MODBUSR(H, RegVolume+4, Float);
    IF PrevTime > 0 AND ts > PrevTime AND vol >= PrevVolume
        AvgFlow := (vol - PrevVolume) * 1000 * 3600 / (ts - PrevTime);
    ELSE
        AvgFlow := 0;
    END
    PrevVolume := vol;
    PrevTime := ts;
END
RETURN(AvgFlow);
Water Flow Rate Variable Read-only

Flow rate reported by the meter itself, in m³/h; it changes only at each gateway readout

Register: H:RegFlow+4 Float Unit: m³/h numeric

Water Flow Rate

Read
VAR info := MODBUSR(H, RegFlow+7, UInt16);
VAR unit := GETBITS(info, 0, 8);
VAR factor := SWITCH(unit, 15, 1, 16, 60, 17, 3600, 0);
IF GETBITS(info, 8, 8) != 0 OR factor = 0
    ADDERROR(1, "RegFlow does not point to a volume flow value (entry type " + TOSTRING(GETBITS(info, 8, 8)) + ", unit code " + TOSTRING(unit) + ") – copy the Register number of this value from the gateway Meter tab");
    RETURN(NaN);
END
RETURN(MODBUSR(H, RegFlow+4, Float) * factor);
Connection: Modbus TCP • Slave ID: $[SlaveId]
Possible improvements (3)
  • H:RegVolume+0 Unscaled meter value (64-bit integer) with scaling factor — Int64 at offset 0–3 with the power-of-ten scaling factor at offset 6; preferred by the manual for exact billing, 0 when the meter sends a floating-point value. The template reads the scaled Float at offset 4.
  • H:RegVolume+8 Timestamp of the value from the meter — UNIX time provided by the meter for the value, 0 if the meter provides none. The template uses the readout time of the meter entry (H:RegMeter+4) instead.
  • H:RegMeter+2 Manufacturer code of the meter — Three letters encoded in 5-bit groups.

Sources

  • solvimus MBUS-GEM User manual v1.31 (Modbus TCP server, network configuration)
  • solvimus MBUS-GEM datasheets (MBUS-GE20M/80M and MBUS-GE125M/250M/500M)

Found a problem with this device template?

Tell us what's wrong, what's missing, or how the template should behave. We rely on your feedback to keep the catalog accurate.

Community — unreviewed

Want to use this in your TapHome Core?

Open this template in the Customer Portal to apply it to one of your homes, or to draft a refinement and submit it back to the catalog.

Open in portal