Add Zigbee2MQTT 2.x external converter (.mjs)#11
Open
denovich wants to merge 1 commit intoStuckAtPrototype:masterfrom
Open
Add Zigbee2MQTT 2.x external converter (.mjs)#11denovich wants to merge 1 commit intoStuckAtPrototype:masterfrom
denovich wants to merge 1 commit intoStuckAtPrototype:masterfrom
Conversation
Z2M 2.x requires ES module format (.mjs) — the existing CommonJS
converter (aircube.js) fails to load silently (renamed to .invalid).
Two additional Z2M 2.x compatibility fixes in the new converter:
- Cluster ID must be a string ('64513') not a number (0xFC01),
because Z2M 2.x compares unknown cluster names as strings
- Import paths use no .js extension per Z2M 2.x conventions
Also updates HOME_ASSISTANT.md to document both Z2M versions and
adds Z2M 2.x troubleshooting guidance.
Owner
|
Awesome, thank you! I got a report of the same thing happening on the quirk. I was testing on HA 2025. Thanks! I will review and pull in |
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.
Summary
The existing Z2M external converter (
z2m/aircube.js) uses CommonJS format which is incompatible with Zigbee2MQTT 2.x. Z2M 2.x silently rejects.jsconverters — it renames them to.invalidand the custom cluster data (eCO2, VOC, AQI) never gets processed.This PR:
z2m/aircube.mjs— an ES module converter that works with Z2M 2.x'64513') not a number (0xFC01), because Z2M 2.x compares unknown cluster names as strings internally.jsextensionHOME_ASSISTANT.mdto document both Z2M 1.x and 2.x setupaircube.jsas Z2M 1.x onlyThe existing
aircube.jsis preserved for Z2M 1.x users.Testing
Tested with Z2M 2.9.1 (HA add-on). All five sensors report correctly:
Before the fix, Z2M would log:
After: