Repository navigation
Extend tariff 1 & 2 counter coverage to DSMR and more DLMS paths - #1199
Merged
Merged
Conversation
DSMR/P1 meters report 1.8.1/1.8.2 and 2.8.1/2.8.2 but the parser only summed them into the totals. Read the per-tariff registers into the tariff counters (guarded so absent registers don't zero known values), and apply accumulatedMultiplier scaling to them for consistency. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Wire up the AMS_OBIS_*_COUNT_T1/T2 constants in the generic OBIS-lookup path so any list exposing 1.8.1/1.8.2/2.8.1/2.8.2 populates the tariff counters (these constants were previously declared but unused). - Store export tariff values in the Iskra export-list path that already parsed obis281/282. - Apply accumulatedMultiplier scaling to the tariff counters, matching the totals. Paths that only read 1.8.0/2.8.0 totals, or skip the tariff positions with uncertain (commented '?') layout, are left untouched pending real payloads. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
🔧 PR Build ArtifactsVersion: All environments built successfully. Download the zip files:
|
|
I have an Iskra IE.5 which supports two tarrif couters (obis codes 1.8.1 and 1.8.2). I made test build from main branch (commit 4bcc708) but it still shows only sum of those two tarrifs (T1 + T2). If you need me for testing/verification, just let me know, I'm willing to flash test firmwares myself. I'm using custom hardware based on ESP32-C3. |
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.
Follow-up to #1136, which added Tariff 1 & 2 import/export counters but only sourced them from the LNG parser and one IEC6205675 (Iskra) list path. This PR extends the same counters to the remaining payload types that expose tariff registers.
Changes
DSMR / P1 (
IEC6205621)The most common dual-tariff family (NL/BE/LU day–night meters). The parser already read
1.8.1/1.8.2and2.8.1/2.8.2but only summed them into the totals — the per-tariff breakdown was discarded (the same "read but not stored" bug #1136 fixed for LNG).1.8.1/1.8.2and2.8.1/2.8.2into the tariff counters, guarded so absent registers don't zero known values.accumulatedMultiplierscaling to the tariff counters, matching the totals.DLMS (
IEC6205675)AMS_OBIS_*_COUNT_T1/T2OBIS constants in the generic OBIS-lookup path. Add tariff counter support (Tariff 1 & 2) for import/export #1136 declared these constants but never used them; now any list exposing1.8.1/1.8.2/2.8.1/2.8.2via OBIS tags populates the tariff counters.obis281/282.accumulatedMultiplierscaling to the tariff counters.Output
No new plumbing needed — the MQTT (
tPIT1/tPIT2/tPOT1/tPOT2), Raw (.../tariff1,.../tariff2), and UI (ict1/ict2/ect1/ect2) layers from #1136 read theAmsDatatariff getters, so these parsers' values flow through automatically.Scope / deliberately left alone
1.8.0/2.8.0totals, or that skip the tariff positions with uncertain (commented?) layout, are untouched — adding reads there without validated payloads risks writing garbage into tariff counters.LNG2and the Kamstrup (KMP) driver expose only total registers — nothing to source.Testing
esp32andesp8266both succeed.main(it comes with the planned restructure), andIEC6205621is built on ArduinoString. Verified by build + code review against the OBIS register definitions. Real-meter validation (DSMR dual-tariff + an Iskra) recommended before release.