I’m toying with some ESP32-C6 dev boards and building some simplistic zigbee door monitors. I’m trying to understand how ZHA ‘subscribes’ to each zigbee device.
Speaking from a vocabulary standpoint pub/sub isn’t part of the zigbee vernacular (at least not in the espressif SDK which seems to be pretty faithful to the zigbee stack vocab). So what is actually going on in ZHA when a new device joins the network? Does ZHA/coordinator bind to the device? Or do the end devices send cluster/attribute updates to the coordinator by default? Or some third thing I’m missing?
It looks like discovery.py is involved with discovering what the endpoint clusters/attributes are, but I don’t understand what is happening after that.
FWIW, the off the shelf zigbee stuff I already have works flawlessly.
Any amount of light-shedding would be greatly appreciated!
@asward2 the ZHA integration depends on the zigpy project so you are probably better of if you ask ZHA related questions in the zigpy discussions as most ZHA developers reply to developers questions there → https://github.com/zigpy/zigpy/discussions
Note! Assuming that you are already using both the very latest ESP-IDF v5.1.x release (of ESP-IDF v5.2 beta) in combination with the very latest Espressif Zigbee SDK release (with the newest esp-zigbee-lib and esp-zboss-lib) then you should also post problems and feature requests as issues to Espressif’s esp-zigbee-sdk repository if they are missing Zigbee clusters and attributes → GitHub - espressif/esp-zigbee-sdk: Espressif Zigbee SDK (see → Issues · espressif/esp-zigbee-sdk · GitHub)
FYI, if you only use standard clusters and attributes from the ZCL (Zigbee Cluster Library) specification you should not need a custom ZHA Develice Handler (a.k.a. quirk) for adding new devices to the ZHA integration, see:
But if you want to expose non-standard clusters and attributes then you will need to at least need to add a custom ZHA Develice Handler (a.k.a. quirk):
And if you also want to expose additional/advanced device classes or device types that are not exposed as entities by default in the ZHA UI then you will also need to extend the zha component inside Home Assistant core (see for example sensor.py and manufacturerspecific.py):