Add support for 2-level KNX group addresses (fixes #92) - #93
Open
Tim0kot wants to merge 1 commit into
Open
Conversation
ETS projects can use 2-level group addresses (for example 6/7). The bundled knx library declares a twoLevelAddressing flag but never passes it when marshalling the cEMI destination address, so any 2-level address throws 'Invalid address - missing 3rd token' at serialization, after the write has already resolved: devices pair normally but no telegram is ever transmitted. - patches/knx+2.5.4.patch (applied via patch-package on postinstall) passes the flag on encode and decode of the destination address. patch-package is a production dependency so the patch also applies on production installs. - New app settings page with a "Use 2-level group addresses (for example 1/7)" toggle, default off, stored as two_level_group_addressing and applied by app.js on startup and on change. Localized for all 13 languages. An error is logged if 2-level mode is enabled while configured addresses still use 3-level style. - test/TestTwoLevelAddressing.js (wired as npm test) proves a 2-level telegram is byte-identical to its 3-level twin, covers the address range limits, and reproduces the original failure. Fixes athombv#92
Tim0kot
force-pushed
the
fix/two-level-group-addressing
branch
from
July 30, 2026 20:54
152d8bb to
ab65d8a
Compare
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.
Fixes #92.
As described in the issue, the bundled
knxlibrary only ever parses group addresses in 3-level mode:KnxProtocol.jscallsAddress.parse/Address.toStringwithout theirtwoLevelAddressingargument, so a 2-level address like6/7throws at serialization time, after the write has already resolved. The app looks connected but nothing is transmitted.Changes:
patches/knx+2.5.4.patch(applied bypatch-packageonpostinstall): pass the library's existingKnxProtocol.twoLevelAddressingflag when encoding and decoding the cEMI destination address. It's a two line change, the flag is already declared in the library (defaulting tofalse), it was just never wired up.two_level_group_addressingapp setting;app.jsapplies it on init and on change, no restart needed. Localized for all 13 languages.test/TestTwoLevelAddressing.js(wired asnpm test): verifies that a 2-level telegram is byte-identical to its 3-level twin (6/7and6/0/7are the same 16-bit address on the bus), covers the address range limits, and reproduces the original failure.With the toggle off (the default) the encode/decode paths produce byte-identical output to the current release, so existing 3-level installations are unaffected. Decode uses the same flag, so incoming telegrams match the configured group addresses and status updates work as well, not just writes.
Tested with this branch installed on a Homey Pro tunnelling to knxd, with telegrams captured by tcpdump on the gateway host: toggle off reproduces the silent failure from the issue, toggle on puts the expected destination on the wire (including sub groups above 255), and the status address round-trips correctly. The same two library edits have also been running for a week on a live 130-device installation that uses 2-level addressing throughout.