Skip to content

Add Switzerland OBIS fields for channel 1-1#59

Merged
PolarGoose merged 4 commits into
esphome-libs:mainfrom
SebiGo:add-ch-fields
Jul 4, 2026
Merged

Add Switzerland OBIS fields for channel 1-1#59
PolarGoose merged 4 commits into
esphome-libs:mainfrom
SebiGo:add-ch-fields

Conversation

@SebiGo

@SebiGo SebiGo commented Jun 29, 2026

Copy link
Copy Markdown

Adds 34 DEFINE_FIELD entries for the AM550 smart meter (used by EWL Luzern): total energy (1-1:1.8.0 / 2.8.0), reactive energy totals (3.8.0 / 4.8.0), reactive energy by quadrant Q1-Q4 (5-8.8.0-2), per-phase active and reactive power (1-1:21-64.7.0), and maximum power demand with timestamp (1-1:1.6.0 / 2.6.0).

Specification from EWL

Adds 34 missing DEFINE_FIELD entries for the AM550 smart meter used by
EWL Luzern: total energy (1-1:1.8.0 / 2.8.0), reactive energy totals
(3.8.0 / 4.8.0), reactive energy by quadrant Q1-Q4 (5-8.8.0-2),
per-phase active and reactive power (1-1:21-64.7.0), and maximum power
demand with timestamp (1-1:1.6.0 / 2.6.0).
@SebiGo

SebiGo commented Jun 29, 2026

Copy link
Copy Markdown
Author

Hi, and thanks for maintaining this library!

A bit of context on this PR: I run a P1 reader on an Iskraemeco AM550 (the meter EWL Luzern deploys), which sends almost everything on the Swiss 1-1 channel. The existing _ch fields cover the totals and tariff registers, but per-phase power, reactive energy and the maximum-demand registers aren't mapped, so they can't be surfaced today without parsing the raw telegram by hand. This PR fills that gap.

That said, I'm not sure how well this matches the direction you'd want, so I'd rather ask than assume:

  • Scope: I added the full set from EWL's OBIS table (34 fields, including per-phase reactive power and the Q1–Q4 reactive-energy quadrants). That may be more than you'd like to carry — happy to trim it to a leaner, more commonly useful subset.
  • Naming: I followed the existing _ch convention as closely as I could, but I'll gladly rename anything to fit your scheme.
  • Downstream: if you're happy to merge this, I'll follow up with the matching PR in esphome/esphome to expose these fields in the dsmr component's sensor.py, so they're actually usable end-to-end.

If this isn't a direction you want to support, no problem at all — just say the word and I'll close it. Otherwise I'm happy to revise it however works best for you.

@PolarGoose

Copy link
Copy Markdown
Collaborator

@SebiGo,

Thanks a lot for your work. I will process it today or tomorrow

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the parser’s Switzerland (channel 1-1) OBIS field coverage to support the AM550 smart meter profile (EWL Luzern) and updates the existing parser test to exercise and validate those new fields end-to-end.

Changes:

  • Added Switzerland-specific OBIS field definitions for total active energy, reactive energy totals and quadrants (Q1–Q4), per-phase active/reactive power, and maximum demand with timestamp.
  • Extended the comprehensive parsing test telegram with the corresponding 1-1:* OBIS lines.
  • Added assertions verifying correct unit handling (including integer *Wh fallback) and timestamped maximum-demand parsing.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/dsmr_parser/fields.h Adds Switzerland/channel 1-1 DEFINE_FIELD entries for AM550-specific OBIS codes (energy, reactive energy, per-phase power, max demand w/ timestamp).
tests/parser_test.cpp Extends the full-message parsing test with new 1-1 OBIS lines and validates parsed values/timestamps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@PolarGoose PolarGoose merged commit 7a7be94 into esphome-libs:main Jul 4, 2026
3 checks passed
@PolarGoose

Copy link
Copy Markdown
Collaborator

@SebiGo,

Please create a pull request to EspHome and EspHome docs.

@SebiGo

SebiGo commented Jul 4, 2026

Copy link
Copy Markdown
Author

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.

3 participants