knx_parser 1.11.2
knx_parser: ^1.11.2 copied to clipboard
A Dart library to parse KNX project files (.knxproj) from ETS5 and ETS6, including encrypted projects. Extracts data to JSON format.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.11.2 - 2026-03-30 #
Fixed #
- Template placeholder cleanup: ComObjectRef overrides containing ETS template placeholders (
{{ChNum}},{{0:...}}) are now skipped in favor of cleaner base ComObject values (e.g."Button 1"instead of"Button {{ChNum}} - {{0:...}}"}).
1.11.1 - 2026-03-30 #
Fixed #
- ComObject app program matching: Use HP suffix from
Hardware2ProgramRefIdto match the exact application program for each device. Prevents cross-matching when multiple devices share the same manufacturer prefix (e.g.O-1_R-1matching wrong program).
1.11.0 - 2026-03-30 #
Added #
- ComObject enrichment:
ComObjectInstanceRefis now enriched with data from application program XML (M-*/M-*_A-*.xml):name,description,number,functionText,objectSize,datapointTypereadFlag,writeFlag,transmitFlag,updateFlag(boolean flags)channelIdfrom project XMLgroupAddresses— resolved GA links from raw IDs (e.g.GA-1) to formatted addresses (e.g.0/0/1)
- Support for module ComObjects (e.g.
MD-1_M-1_MI-1_O-2-1_R-1) via automatic stripping of module instance prefix. copyWithDefinition()method onComObjectInstanceReffor immutable enrichment.
1.10.2 - 2026-03-30 #
Fixed #
- Device name fallback: if user didn't set a name in ETS (
Nameattribute is null/empty),productNamefrom catalog is used as fallback fornamefield.
1.10.1 - 2026-03-30 #
Fixed #
- Device name preservation: Product catalog merge (
copyWithProductCatalog) no longer overwrites user-defined device names from ETS. Added separateproductNamefield. - Added
descriptionandcommentfields toDeviceInstanceandKnxDevice, parsed from XML attributes. - Renamed
copyWithName()tocopyWithProductName()to clarify intent.
1.10.0 - 2026-03-17 #
Added #
- Topology flat lists:
KnxAreaandKnxLineclasses withareasandlineslists inKnxFlatProject. - Building level:
KnxBuildingclass for multi-building projects, withbuildingslist andfloorIds. - Device-room mapping:
KnxDevicenow includesroomId,roomName,areaId,areaName,lineId,lineName. - Rich cross-references:
KnxDeviceReflightweight reference class used inKnxRoom.devicesandKnxGroupAddress.devices(includesformattedAddressandname). fromJson()on all models: Full JSON deserialization support forKnxFlatProjectand all nested classes, plusComObjectInstanceRef,DatapointType,DatapointSubtype,BackboneKey,GroupKey,DeviceKey.- Device formatted address:
KnxDevice.formattedAddressinarea.line.deviceformat (e.g.,1.1.3). - DPT format:
datapointTypeconverted fromDPST-9-1to9.001format. - GA-device mapping:
KnxGroupAddress.devicesshows linked devices via comObject cross-reference.
Changed #
KnxFloor.parentIdrenamed toKnxFloor.buildingId.KnxRoom.deviceInstanceIdsreplaced withKnxRoom.devices(List<KnxDeviceRef>).KnxGroupAddress.deviceIdsreplaced withKnxGroupAddress.devices(List<KnxDeviceRef>).
1.9.0 - 2026-03-17 #
Added #
- Typed flat model: New
KnxFlatProjectwith typed classes (KnxFloor,KnxRoom,KnxDevice,KnxGroupAddress,KnxGroupRange,KnxSecureKeys,KnxGaSecureKey,KnxDeviceToolKey). toFlat()method onKnxProjectreturns typedKnxFlatProjectinstead of rawMap.parseToFlat()convenience method onKnxProjectParser.- GA-device mapping:
KnxGroupAddress.deviceIdsshows which devices reference each group address via comObject links. - DPT format conversion:
datapointTypein flat output now usesx.yyyformat (e.g.,9.001) instead of rawDPST-x-y. - Exported
DeviceInstanceandKnxFlatProjectmodels from library.
Changed #
toFlatJson()now delegates totoFlat().toJson().
1.8.0 - 2026-03-16 #
Added #
- Flat JSON output format: New
toFlatJson()method onKnxProjectproduces an organized, flat JSON with separate lists forfloors,rooms,devices,groupAddresses,datapointTypes, andsecureKeys. - Device-to-room mapping:
Locationmodel now includesdeviceInstanceIdsfield, parsed fromDeviceInstanceRefelements insideSpaceXML nodes. - Security detection:
hasSecureboolean in flat JSON output, auto-detected from GA keys and device security tool keys. parseToFlatJson()andparseToFlatJsonFile()convenience methods onKnxProjectParser.
Changed #
Location.fromXml()now parsesDeviceInstanceRefchildren.Location.toJson()includesdeviceInstanceIdswhen non-empty.
1.7.1 - 2026-02-09 #
Changed #
- Downgraded dependencies for Flutter 3.7.12 (Dart 2.19) compatibility:
archive: ^3.3.9xml: ^6.3.0pointycastle: ^3.7.3lints: ^2.1.1
1.7.0 - 2026-02-09 #
Added #
- Device name parsing: Device names are now extracted from Product catalog (
M-*/Hardware.xml) and merged intoDeviceInstanceobjects. copyWithName()method toDeviceInstance.copyWithProductCatalog()method toSegment,Line,Area,Topology, andInstallationfor immutable updates.
Fixed #
- Device name was previously always
nullbecauseDeviceInstanceXML elements don't containNameattribute. Now correctly extracted from manufacturer'sHardware.xml.
1.6.0 - 2026-02-03 #
Added #
- ETS version detection: Added
etsVersion("ETS5" or "ETS6") andschemaVersionfields toProjectInfoand JSON output. - ETS6 Segment device support: Fixed parsing of
DeviceInstanceelements nested withinSegmenttags (ETS6 structure).
Changed #
Segmentclass now includes adevicesproperty to support ETS6 project structure.Line.fromXmlnow combines devices from both direct children (ETS5) and Segment children (ETS6).
1.5.0 - 2026-02-02 #
Changed #
- Improved handling of ETS5 outer .knxproj archives that are not password-protected while still supporting ETS6 outer-encrypted projects.
- Refined error messages and comments to be fully in English for cleaner public API diagnostics.
1.4.0 - 2026-02-02 #
Added #
- Web support: Library can be compiled for web (dart compile js). Use
parseBytes(List<int> bytes, ...)in the browser;parse(String filePath)and file-based APIs remain VM-only via conditional import. io_stub.dartfor web builds (stub for dart:io whendart.library.htmlis defined).
Changed #
- Parser uses conditional import
dart:io/io_stubso the same code runs on VM and web. File.exists/Directory.existsusage aligned with dart:io API (getter, no parentheses).
1.3.0 - 2026-01-27 #
Added #
- ETS6 encryption support: Implements PBKDF2-HMAC-SHA256 password derivation for ETS6 encrypted projects.
- Auto-detection of ETS version based on schema version (ETS6 = schema >= 21).
- Support for both ETS5 (raw password) and ETS6 (derived password) encrypted projects.
Dependencies #
- Added
pointycastle: ^3.9.1for PBKDF2 key derivation. - Added
crypto: ^3.0.3for cryptographic operations.
1.2.0 - 2026-01-26 #
Added #
- Support for parsing secure KNX projects (AES encrypted
P-*.zipfiles) with password. - Parsing of
DeviceInstanceelements in Topology. - Parsing of
Securitykeys (ToolKey) for devices. - Parsing of
Keyfor Group Addresses. - Updated JSON export to include new device and security data.
1.0.0 - 2026-01-26 #
- Initial release
- Parse
.knxprojfiles (ZIP-based XML format from ETS6) - Extract project information (name, GUID, dates, style)
- Extract topology (Areas, Lines, Segments)
- Extract group addresses with formatted address support (e.g., 0/0/1)
- Extract group ranges with hierarchical structure
- Extract locations (Buildings, Spaces)
- Parse datapoint types (DPT) from knx_master.xml
- Export to structured JSON format
- Comprehensive unit tests
- Example usage script
Dependencies #
archive: ^3.6.1- ZIP file handlingxml: ^6.5.0- XML parsing