Skip to content

Diehl IZAR: fix MVT order, Diehl address swap and decode_ex dispatch - #7

Open
divomen wants to merge 1 commit into
i12bp8:mainfrom
divomen:fix/diehl-izar-decode
Open

divomen wants to merge 1 commit into
i12bp8:mainfrom
divomen:fix/diehl-izar-decode

Conversation

@divomen

@divomen divomen commented Dec 3, 2026 •

Copy link
Copy Markdown

Hi, and thank you for wM-Buster! It made it really easy to start listening to my own water meter.

The meter is a Diehl unit with an IZAR radio module. wM-Buster received it fine, but it showed up as DME Unknown v0x60 with a hex dump instead of a reading. I traced it to three small issues and tried to keep each fix as close as possible to how wmbusmeters handles it.

What was wrong

  1. IZAR MVT order. k_mvt_izar was copied from wmbusmeters' addMVT(), which takes (type, version), but WmbusMVT is (version, medium). Because of that, the IZAR driver could never match a meter.
  2. Diehl A-field order. PRIOS frames send the A field as Ver, Type, ID. wmbusmeters reorders it in transformDiehlAddress() before doing anything else. wM-Buster read it as a standard field, so it showed the wrong ID, version and medium.
  3. Hex-dump branch in wmbus_app.c. Frames with a proprietary CI went to the hex dump whenever the driver had no plain decode, even if it had decode_ex. IZAR only has decode_ex.

What changed

  • protocol/wmbus_link.c: a small diehl_normalise() step that follows transformDiehlAddress() (the same CI and C-field rules, including the SAP PRIOS case). WmbusLinkFrame and WmbusDecodeCtx gain a hdr pointer to the raw header, because the PRIOS seed and the SAP prefix need the bytes as they were sent.
  • drivers/europe/diehl/izar.c: fixed MVT order. The seed and the SAP prefix now read the raw header, with a fallback to the parsed fields when hdr is NULL.
  • wmbus_app.c: the hex-dump branch also checks decode_ex.
  • tests/test_izar.c: tests now go through wmbus_engine_find() / wmbus_engine_decode_ctx() like the app does, check the meter ID against wmbusmeters, and include the IzarWater2 telegram from driver_izar.cc.
  • The CHANGELOG [Unreleased] entry and the Diehl driver README, which still said the IZAR decoder was a TODO.

Testing

  • make -C tests check passes. All six wmbusmeters IZAR telegrams give the same ID and total as wmbusmeters.
  • Builds with ufbt against official firmware 1.5.1 (API 88.2).
  • Tested on hardware: Flipper Zero on official firmware 1.5.1, internal CC1101, with my own IZAR meter. It now shows the total, the last-month reading and date, and the alarms. Offline, 29 distinct captured frames gave the same totals as wmbusmeters ... izarv2 ... NOKEY. I left the real telegram and ID out of the PR, as the disclaimer asks.

One side effect: Diehl frames with CI 0x7A and the "real data" bit in the configuration word now also get the reordered address, as in wmbusmeters. I don't have such a meter, so that path is covered only by following the upstream logic.

I'm happy to split this into smaller PRs or change anything you'd prefer done differently. Thanks for taking a look!

Diehl IZAR frames reached the scan list but never showed a reading.
Three issues stacked up:

- The IZAR MVT table was copied from wmbusmeters' addMVT(), which takes
  (type, version), into WmbusMVT, which is (version, medium).
- PRIOS frames send the A field as Ver, Type, ID. The link parser now
  reorders it like wmbusmeters' transformDiehlAddress() and keeps the
  raw header in `hdr`, which the PRIOS seed and SAP prefix still need.
- Proprietary-CI frames went to the hex dump whenever a driver had no
  plain `decode`, even if it had `decode_ex`.

IZAR tests now dispatch through the engine, check the meter ID, and
include wmbusmeters' IzarWater2 telegram.
@divomen
divomen force-pushed the fix/diehl-izar-decode branch from 0c0b369 to d613953 Compare December 3, 2026 18:12

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant