Skip to content

DS100: line voltages, neutral current, reactive energy and register fixes - #411

Open
isarrider wants to merge 13 commits into
volkszaehler:masterfrom
isarrider:ds100
Open

isarrider wants to merge 13 commits into
volkszaehler:masterfrom
isarrider:ds100

Conversation

@isarrider

@isarrider isarrider commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Brings the DS100 driver in line with the register map in the B+G e-tech manual (section 3, Modbus RTU).

Fixes

  • Export (total reverse active energy) read 0x118A, which is not in the register map. The manual lists it at 0x0118, and the WS100 driver uses the same address. This has been wrong since the driver was added in Add B+G e-tech BS100 #358.
  • Sum and SumL1–SumL3 are now read signed. Total energy follows the meter's combination code, and with Import − Export the manual marks the highest bit as a sign bit. Read unsigned, a total of −1.00 kWh showed up as 42,949,671.96 kWh.

New values

  • Line-to-line voltages L1-L2, L2-L3, L3-L1 (0x0406–0x040A) and the average L-L voltage (0x040E)
  • Per-phase frequency L1/L2/L3 (0x0432–0x0434)
  • Neutral current, as a new CurrentN measurement (0x0416). Current stays at 0x0418 (three-phase vector current)
  • Reactive energy: forward, reverse and total, in total and per phase (0x012C/0x0136/0x0140, plus the per-phase blocks), 0.01 kvarh. The reactive total is read signed, like Sum

Tests (meters/rs485/ds100_test.go)

  • All 24 energy register addresses pinned to the manual
  • Signed totals and unsigned counters
  • Opcode table and Produce() agree: every value read has an address, every address is read, none is used twice, and read lengths match the manual

Docs
The README explains what Sum means for each combination code, and that currents follow the direction of active power, so they read negative while exporting.

This adds 25 Modbus reads per cycle (57 instead of 32). The tariff registers are left out because only the DS100-30B has them, and an unsupported register would stall the device in mbmd's read loop.

isarrider and others added 8 commits October 28, 2026 15:43
Corrected a comment regarding the potential delay in readout.
Co-authored-by: premultiply <4681172+premultiply@users.noreply.github.com>
The opcode table was aligned with tabs, which fails the Porcelain step
of the Clean CI job. Whitespace only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D3FK111BpSpYmto2BsT3Ea
- restore Voltage at 0x040C (average L-N). Renaming it to VoltageL_N_avg
  left Voltage without an opcode, so Probe and Produce read register 0
- keep Current at 0x0418 (three phase vector current). 0x0416 is the
  neutral current, not the total
- read the new L-L voltages, average L-L voltage and per-phase
  frequencies in Produce. Opcodes alone are never queried
- drop the commented-out THD registers, which are not in the manual

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D3FK111BpSpYmto2BsT3Ea
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D3FK111BpSpYmto2BsT3Ea
Add a CurrentN measurement ("Neutral Current", A) and read it from
register 0x0416 on the DS100. Regenerated measurement_enumer.go.

Depends on volkszaehler#385.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D3FK111BpSpYmto2BsT3Ea
@isarrider isarrider changed the title Supersedes #385, now from a dedicated branch so it only contains the DS100 changes. Add new voltage and frequency opcodes to DS100 - Supersedes #385, now from a dedicated branch so it only contains the DS100 changes. Oct 28, 2026
The total energy registers follow the meter's combination code. With
Import - Export the manual marks the highest bit as sign bit, so a
meter that exported more than it imported reported about 42.9 million
kWh instead of a negative value. Read Sum and SumL1-3 as signed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmuA1dQ8QTTW8pao9KcJS2
Export pointed at 0x118A, which is not in the DS100 register map. The
manual lists total reverse active energy at 0x0118, which the WS100
driver also uses. Add a test pinning all energy register addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmuA1dQ8QTTW8pao9KcJS2
Read forward, reverse and total reactive energy, in total and per
phase, from the DS100 register map (0.01 kvarh). Total reactive energy
follows the combination code like active total and is read signed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmuA1dQ8QTTW8pao9KcJS2
Every value read in Produce needs an opcode (otherwise register 0 is
read), every opcode needs to be read, no address may be used twice and
read lengths must match the register size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmuA1dQ8QTTW8pao9KcJS2
Explain that Sum follows the meter's combination code and can turn
negative, and that currents follow the direction of active power.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmuA1dQ8QTTW8pao9KcJS2
@isarrider isarrider changed the title Add new voltage and frequency opcodes to DS100 - Supersedes #385, now from a dedicated branch so it only contains the DS100 changes. DS100: line voltages, neutral current, reactive energy and register fixes Nov 3, 2026
isarrider added a commit to isarrider/mbmd that referenced this pull request Nov 3, 2026
README: point fork's DS100 changes at upstream volkszaehler#411
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.

2 participants