
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).
| Model | M-Bus unit loads | Width | Power supply | M-Bus baud rate |
|---|---|---|---|---|
| MBUS-GE20M | 20 | 2 modules | 21.6–24.5 VDC | max. 19200 bps |
| MBUS-GE80M | 80 | 2 modules | 21.6–24.5 VDC | max. 19200 bps |
| MBUS-GE125M | 125 | 3 modules | 12–36 VDC | max. 9600 bps |
| MBUS-GE250M | 250 | 3 modules | 12–36 VDC | max. 9600 bps |
| MBUS-GE500M | 500 | 3 modules | 12–36 VDC | max. 9600 bps |
One unit load (UL) mostly corresponds to one meter.
- Connect the M-Bus line of the water meter to the M-Bus terminals of the gateway.
- Connect the gateway to the local network with an Ethernet cable.
- 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
- Set Modbus mode to Modbus TCP and keep Modbus port at 502.
- Keep Modbus float only off. That mode removes the type and unit fields the template checks.
- Keep Modbus swap off. The template expects the default word order (most significant word first).
- 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.
| Setting | Where | Value |
|---|---|---|
| IP address | Import parameter | Address of the gateway (the import dialog suggests 192.168.1.100; the gateway ships with 192.168.1.101) |
SlaveId | Import parameter (default 1) | With multi slave: the number in the Register column of the meter row. Without multi slave: 255 |
RegMeter | Module 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 |
RegVolume | Module variable (default 20) | The number in the Register column of the volume row of the meter (unit m³) |
RegFlow | Module 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:
| Message | Type | Meaning |
|---|---|---|
RegMeter does not point to a meter entry … | Error | RegMeter points to a block that is not a meter entry |
RegMeter points to a meter with medium code …, which is not a water meter … | Warning | The 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 … | Error | Check the M-Bus wiring, the meter address and the meter list of the gateway |
Not all meter values were updated in the last gateway readout | Warning | The 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.
