Closed puddly closed 2 years ago
@puddly What does this key actually present? Does this indicate whether the peer device is a direct child of coordinator or something else? If so, I may have a bit different implementation in zigbee herdsman.
Does this indicate whether the peer device is a direct child of coordinator
Yes. What approach did you end up taking with herdsman?
Well I didn't detect the pattern as you did, but I may be wrong. If the entry is & Assoc then its just a device without APS link keys negotiated, bcz those are present in address manager table as well. When the entries as & Assoc & Security they are configured with APS link keys as well. Please correct me if I am wrong.
Here are the address manager entries of a fresh network with five devices (one router and four end devices):
# ZB3 outlet (only other router on the network)
AddrMgrEntry(type=<AddrMgrUserType.Security|Assoc: 3>, nwkAddr=0x71BA, extAddr=d0:cf:5e:ff:fe:ce:3a:f2)
# ZB3 dimmer (child of coordinator)
AddrMgrEntry(type=<AddrMgrUserType.Security|Assoc: 3>, nwkAddr=0xBE28, extAddr=00:0b:57:ff:fe:2b:cf:1f)
# ZB3 dimmer (child of outlet)
AddrMgrEntry(type=<AddrMgrUserType.Security: 2>, nwkAddr=0x24FD, extAddr=00:0b:57:ff:fe:2b:d4:57)
# Aqara temp sensor (child of coordinator)
AddrMgrEntry(type=<AddrMgrUserType.Assoc: 1>, nwkAddr=0xB4C2, extAddr=00:15:8d:00:01:f2:3a:88)
# Aqara temp sensor, (child of ZB3 outlet)
(no addrmgr entry)
To me, it seems like Assoc
corresponds to whether a device is a child of the coordinator or not. Security
corresponds to whether or not it has a link key shared with the coordinator. Right now we have no way to distinguish ZB3 dimmer (child of coordinator)
from ZB3 dimmer (child of outlet)
, since they both generate the same backup JSON.
Any thoughts on this? The change is backwards-compatible so you can ignore the key if you don't find it useful.
Oh, allright. Yeah, I am totally okay with it. I am going to create a reminder for myself to implement this within zigbee-herdsman. Feel free to merge.
It's not possible to currently tell if a device with an APS link key is a child or just a descendant. In Z-Stack,
is_child
would map toAddrMgrUserType.Assoc
. The presence oflink_key
would indicateAddrMgrUserType.Security
.The current behavior is kept if the key is missing: assume
is_child == True
if no APS link key is present in the device entry, andis_child == False
if there is an APS link key entry.