1.4.0: MQTT with Home Assistant, German SML, Belgian and Luxembourg P1, water and thermal subdevices - #8
Merged
Merged
Conversation
The writer divided power by 1000 and max power by 100, assuming the milliwatt units of the M-Bus library used before the gombus migration. The domain values have been plain watts since then, so QuestDB heat power readings were three orders of magnitude off. The other sinks already stored watts.
Publishes every reading as JSON under a configurable topic prefix and announces retained Home Assistant discovery configs, so each meter shows up as a device with typed sensors and the energy and gas sensors slot into the Energy dashboard without any YAML. Availability rides a last-will status topic; the broker connection registers as a health check. One shared client per process, created lazily by the first enabled sink builder.
A new sml grid reader for the meters common in Germany (EMH, ISKRA MT681, EasyMeter Q3A/Q3B, eBZ DD3 SM, Holley DTZ541), selected with Grid.Reader: sml. The meters push SML frames unsolicited at 9600 8N1; the reader validates transport frames (CRC-16/X-25, with the Kermit fallback Holley firmware needs) and extracts OBIS values by scanning value-list entries instead of parsing the full SML tree, which keeps it robust against the vendor quirks the reference implementations document. Only the total energy counter is required: factory-state meters hide everything else until the owner enters the meter PIN and enables the extended info mode. Signed power maps to usage or output by sign, and both vendor conventions for per-phase registers are accepted. Gas over M-Bus is a DSMR feature, so Grid.Gas requires the dsmr reader.
Belgium (Fluvius eMUCS) works without configuration: the version line moved, subdevice gas publishes non-temperature-corrected volume on a different code, water meters are dispatched by device type and skipped, currents carry decimals the old parser silently dropped to zero, and the capacity tariff demand values (current average and running-month maximum) are parsed into three new grid columns added as a second schema migration. Luxembourg Smarty meters and the Austrian DSOs using the same Sagemcom construction encrypt the telegram with AES-128-GCM. The reader detects encrypted frames per frame, decrypts with Grid.DecryptionKey (Grid.AuthenticationKey defaults to the fixed Luxembourg value; Austrians supply their own), verifies the tag, and feeds the plaintext through the normal DSMR path. Telegrams with plain totals instead of tariff registers are now accepted. Verified against the published Fluvius and Smarty test telegrams and a real captured encrypted frame with its key.
The fixed Luxembourg authentication key is printed in the Luxmetering specification and the test decryption key was published by NEXXTLAB for exactly this purpose; neither is a secret.
Water meters (common on Belgian P1) and thermal meters follow the same path as gas: identified by device type, deduplicated on the meter's capture time, stored to their own table in every sink in the units the telegram carries (m3 and GJ). Slave electricity meters are skipped; they are better read from their own P1 port.
# Conflicts: # CHANGELOG.md # README.md # cmd/meterlogger/source_grid.go # documentation/README.md # documentation/configuration.md # internal/config/config.go
# Conflicts: # CHANGELOG.md # internal/config/load_test.go
Merging the three feature branches left one real gap: the MQTT sink predates the water and thermal subdevice support, so it gains writers and Home Assistant discovery for both (water as a water device class total, thermal energy in GJ). Also resolves the merge seams: the grid reader factory now applies decryption in the dsmr case and rejects keys with sml, config validation extracts the grid subdevice checks, and the changelog gains the 1.4.0 section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rollup of the three reviewed feature branches plus their integration, replacing #5, #6, and #7.
Contents
MQTT.Enabled): every source appears in HA as a device with typed sensors; grid, gas, water, and solar slot into the Energy dashboard. Includes the QuestDB heat power unit fix (readings were 1000x too small since the gombus migration; expect a step change in that history).Grid.Reader: sml): EMH, ISKRA MT681, EasyMeter Q3A/B, eBZ DD3 SM, Holley DTZ541 over an IR head, with both CRC variants and factory-state tolerance.Grid.DecryptionKey, validated against a real published frame.Grid.Water,Grid.Thermal): same capture-time dedup and per-sink tables as gas; slave e-meters documented as skipped.Integration work in this rollup
Coverage 82.7%, lint 0 issues, race suite green, gitleaks clean. The databases job exercises the v2 grid migration and all new subdevice tables against real databases.