Skip to content

Sagemcom T210-D: read meter serial and clock from the push - #1292

Open
ArnieO wants to merge 2 commits into
mainfrom
fix/sagemcom-t210d-id-timestamp
Open

ArnieO wants to merge 2 commits into
mainfrom
fix/sagemcom-t210d-id-timestamp

Conversation

@ArnieO

@ArnieO ArnieO commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

The Sagemcom branch in the OBIS path never ran. meterType is reset to Unknown at the start of that path and is only set from the SAGY system title at the end of the constructor. As a result every T210-D reports the meter id "SAGY" (system title with non-ASCII bytes stripped, identical for all meters) and no meter timestamp.

  • Identify Sagemcom from the system title before the meter-specific handling.
  • Take the meter serial from the last element of the structure (new bounded helper getLastElement()) instead of the hard-coded index 58, which pointed past the end of the list. In gh867-2 the serial is element 57.
  • Decode the clock (element 1) through adjustForKnownIssues() like the OBIS clock, and only if it is a 12-byte octet string.

Test: sagemcom/gh867-2 (#867) decoded with system title SAGY05E894B6: id 178210128502 (was "SAGY"), meter time 2024-11-15 13:45:45 UTC (meter local 14:45:45, deviation −60). Golden master unchanged (the fixture has no system title).

Note: per the comment in LNG3.cpp, meterId feeds the MQTT topic and Home Assistant entity, so these may change from "SAGY" to the real serial after upgrade.

(The web editor also added a final newline to IEC6205675.cpp.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01LAhKXXvV3q3Ro13EackZPq

ArnieO and others added 2 commits October 19, 2026 14:19
The Sagemcom branch in the OBIS path never ran: meterType is reset to
Unknown at the start of that path and is only set from the SAGY system title
afterwards. As a result every T210-D reported the meter id "SAGY" (system
title with non-ASCII bytes stripped) and no meter timestamp.

- Identify Sagemcom from the system title before the meter-specific handling.
- Take the meter serial from the last element of the structure instead of the
  hard-coded index 58, which pointed past the end of the list (the serial is
  element 57 in gh867-2).
- Decode the clock (element 1) through adjustForKnownIssues() like the OBIS
  clock, and only when it is a 12-byte octet string.

gh867-2 with system title SAGY05E894B6: id 178210128502 (was "SAGY"),
meter time 2024-11-15 13:45:45 UTC (meter local 14:45:45, deviation -60).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LAhKXXvV3q3Ro13EackZPq
…oder)

See the first commit on this branch for the rationale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LAhKXXvV3q3Ro13EackZPq
@github-actions

Copy link
Copy Markdown

🔧 PR Build Artifacts

Version: 2078a38

All environments built successfully. Download the zip files:

Artifacts expire after 7 days. View workflow run

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