Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Green spring cleaning #1349

Merged
merged 8 commits into from
Mar 18, 2025
Merged

fix: Green spring cleaning #1349

merged 8 commits into from
Mar 18, 2025

Conversation

Nerivec
Copy link
Collaborator

@Nerivec Nerivec commented Mar 16, 2025

Important

FULLENCR mode is rarely used, and devices that do (namely Moes ZEU2S), appear to misbehave in other ways (non-fixed source ID?)... Implementation is purely based on data gathered from Koenkk/zigbee2mqtt#19405 (comment) (ember) and the GP spec. It needs testing with actual devices. Also, with the data being limited compared to having the full NWK GP frame, this will only work if the stack passes the proper information. The codepath is guarded as much as possible, so, worse case scenario, it just shouldn't trigger.

  • 29be863
    • Fix trying to identify GP devices (not supported by GP, would always result in failed request)
    • Implement support for decommissioning (0xe1), in same way as regular device leave (tested/confirmed with PTM216Z)
debug: 	zh:ember:ezsp: ezspGpepIncomingMessageHandler(): callback called with: [status=UNPROCESSED], [gpdLink=221], [sequenceNumber=1], [addr={"applicationId":0,"sourceId":22369751,"endpoint":0}], [gpdfSecurityLevel=FC_MIC], [gpdfSecurityKeyType=NWK], [autoCommissioning=false], [bidirectionalInfo=0], [gpdSecurityFrameCounter=257], [gpdCommandId=225], [mic=1344968817], [proxyTableIndex=255], [gpdCommandPayload=], [packetInfo={"senderShortId":65535,"senderLongId":"0xFFFFFFFFFFFFFFFF","bindingIndex":255,"addressIndex":255,"lastHopLqi":221,"lastHopRssi":0,"lastHopTimestamp":0}]
debug: 	zh:controller:greenpower: [DECOMMISSIONING] from=21975
debug: 	zh:controller: Green power device '22369751' left
debug: 	zh:controller: Removing green power device from database '0x00000000015555d7'
warning: 	z2m: Device '0x00000000015555d7' left the network

@Koenkk storing of the gpSecurityKey in device.meta isn't all that great, but since devices pass it during commissioning and it's not available in following UNPROCESSED frames, we need to store it somehow...?
Also this is supposed to be the frame counter, but instead it has been using source ID!?

CC: @chris-1243

@Koenkk
Copy link
Owner

Koenkk commented Mar 17, 2025

but since devices pass it during commissioning and it's not available in following UNPROCESSED frames, we need to store it somehow...?

.meta is more meant for apps like z2m, maybe we can add a .greenPowerData to the device? (not saved to database.db when the object is not set)

@Nerivec
Copy link
Collaborator Author

Nerivec commented Mar 17, 2025

It's really just that key that's the problem, don't think it's worth adding another object. Maybe directly as device.gpSecurityKey?

@Koenkk
Copy link
Owner

Koenkk commented Mar 17, 2025

Also fine!

@Koenkk Koenkk merged commit cfa8342 into Koenkk:master Mar 18, 2025
1 check passed
@Koenkk
Copy link
Owner

Koenkk commented Mar 18, 2025

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for encrypted Zigbee Green Power devices
2 participants