Docs · Protocols
M-Bus: reading meters
OTDeck is a wired M-Bus master (EN 13757-2 and -3). It finds the meters on a bus, reads them and decodes every record: heat, cooling, water, gas and electricity meters, heat cost allocators and others. Everything here works against the built-in simulator, so you can try it without a bus.
Connecting
M-Bus needs a level converter between your computer and the two-wire bus.
- M-Bus to Ethernet gateway: add an M-Bus connection with the gateway’s address and TCP port (10001 by default). Set the gateway to transparent (raw) mode: OTDeck sends the M-Bus frames itself and the gateway only passes the bytes through.
- USB or RS-232 level converter: pick the serial port. The default is
2400 baud, 8 data bits, even parity, as most meters expect; 300 and 9600
baud (up to 38400) and parity N or O can be set. On Linux your user needs
the
dialoutgroup (uucpon Arch).
The answer timeout is 500 ms on a serial port and 1500 ms through a gateway; raise it in the connection dialog for slow gateways or long buses.
Simulator. Welcome → M-Bus meters starts a gateway on
127.0.0.1:10001 with five meters: a heat meter (primary address 1), a cold
water meter (2), an electricity meter whose readings take two telegrams (3)
and two heat cost allocators that share primary address 0.
Finding meters
Find meters offers two scans. Both are free.
- Primary scan: pings addresses 0–250 (or the range you set) and reads every meter that answers. Two meters on one address answer together and show as a collision instead of a wrong reading. 0–250 takes a few minutes.
- Secondary search: selects identification numbers digit by digit with wildcards and goes deeper wherever several meters answer together. It finds every meter, also several on one primary address (common with factory address 0). Each silent selection waits for the answer timeout, so a bus takes one to a few minutes, longer through a gateway.
Tick the meters to add and click Add. Meters already in the list are marked. Add meter adds one by hand, by identification number or by primary address.
A meter with an identification number is always read by it (secondary addressing: select, then read), so its primary address does not matter. A meter without one is read by its primary address.
Readings
Each meter shows its header (identification number, manufacturer, medium, version, status) and a table of records:
- Quantity and value: energy, volume, power, flow, flow and return temperature, temperature difference, on-time, dates and more, with the value scaled to its unit. Energy is shown in kWh (MWh from a million), power in W or kW.
- Storage, tariff: storage 0 is the current value; 1 and above are stored values such as the last due date or month end. Tariff and subunit when the meter sends them; maximum, minimum and error values are marked.
- Coding: the DIF/VIF bytes of the record, to compare with the meter’s documentation.
A value the meter marks as an error (BCD digits A–F), or that cannot be decoded, is shown as invalid rather than as a number. Telegrams whose records are encrypted show their header only. Readings that take several telegrams are read to the end (at most 16).
Polling and trends
Meters with Poll ticked are read every 30 seconds by default; set Read every from 1 second to 24 hours, Pause stops polling and Read now reads at once. Battery-powered meters count every readout, so poll them slowly or only on demand.
The chart button on a numeric record puts it on the trend panel, next to values from the other protocols (Trends). M-Bus meters also appear in the command palette search.
New primary address (Pro)
Address… on a meter gives it a new primary address.
- A meter with an identification number is selected by it and only that meter takes the new address; other meters on the old address are not touched. OTDeck then reads the meter back and says so if it does not answer on the new address (for example when another master on the bus selected a different meter in between).
- A meter without one is addressed by its primary address: every meter on that address takes the new one.
- An address another meter in the list is read by is refused.
Like every write it needs Pro, read-only connections refuse it, production connections need the connection name typed, and every change is in the write log (Connection roles and safety). Scans on a production connection also need the name typed.
Another master on the bus
A gateway or serial port usually serves one client. When another program, or an AI agent through the MCP server, selects meters on the same bus at the same moment, a reading could come from a different meter. OTDeck checks the identification number of every answer to a selection and refuses one from the wrong meter.
AI agents
read_meters reads the meters of an M-Bus connection for an agent: by key,
identification number or primary address, current values or with the stored
ones, at most 20 meters per call (5 on production). It opens the bus for the
call and closes it again, so disconnect the connection in OTDeck first when
the gateway or port takes only one client (AI agents (MCP)).
Not in this version
Wireless M-Bus (wM-Bus, OMS) and decryption of encrypted telegrams; meter writes other than the primary address (no time setting, no resets).