Repository navigation
Decode the 22-field Iskra AM550 frame from Elektro Celje - #1336
Merged
Merged
Conversation
The meter alternates a 9-field frame led by the ISK logical device name with a 22-field frame led by a 12-character serial. Once the 9-field frame had marked the meter as Iskra, the 22-field frame fell through to the positional fallback, which read the 4.8.0 register as import power and a 2-byte frequency plus the next field as export power, and shifted every counter by one. Readers reported jumps to 10.7 MW import and 327 MW export, and import/export energy swapped every other second. Decode the 22-field frame by position: power, the four energy totals, per-phase current, voltage and active power. It starts from the stored state so the tariff registers, which only the 9-field frame carries, are kept. The 9-field frame skipped the 1.8.1/1.8.2 and 2.8.1/2.8.2 fields as unknown. They are the tariff registers (they sum to 1.8.0 and 2.8.0 in this capture and in the Elektro Ljubljana one from #869), so read them. Refs #1332 Co-Authored-By: Claude Opus 5.5 <[email protected]>
🔧 PR Build ArtifactsVersion: All environments built successfully. Download the zip files:
|
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.
Why
An Iskra AM550 on the Elektro Celje grid (Slovenia) alternates between two unencrypted frames every second (#1332):
ISK…logical device name, which is decodedThe 22-field frame has no
ISKprefix, so it doesn't take theISKbranch. Once the 9-field frame has set the meter type to Iskra, it enters theuseMeterType == AmsTypeIskrablock. That block only knows lengths0x21,0x1Cand0x0F, so0x16drops to the positional fallback. The fallback starts at field 5 and reads every field as 4 bytes:00 A4 39 B4= 10,762,676 W)13 85 12 04= 327,488,004 W)These are exactly the spikes the reporter saw in the UI and Home Assistant. The reporter's analysis was confirmed against their Telnet log (98 frames, strictly alternating).
Changes
New
0x16branch in the Iskra block. It is guarded on field 10 being LongUnsigned and field 17 being DLongUnsigned, and decodes by position:The branch calls
apply(state)first, like theISK9-field branch does. Without it, the tariff counters (which only the 9-field frame carries), the list ID and the meter ID would be zeroed every other second.9-field
ISKframe (DLongUnsigned variant): read 1.8.1/1.8.2 and 2.8.1/2.8.2 instead of skipping them as unknown. They sum exactly to 1.8.0 and 2.8.0 in both this capture and the Elektro Ljubljana fixturegh869-6, so the layout is the same there.How the mapping was checked
Some of the mapping is less certain:
gh615-8.Verification
gh1332-1.hexandgh1332-2.hex: the two anonymized frames from the issue.test_iskra_am550_slovenia_celje_22:gh869-6gh1332-2alone decodes to nothing, as on a device that hasn't seen the 9-field frame yet.pio test -e nativepasses: 27 passed, 6 skipped (encrypted fixtures, no keys locally).pio run -e esp8266builds.Refs #1332
🤖 Generated with Claude Code