sshaikh
(Shak)
September 9, 2020, 4:59pm
1
During my last rebuild I managed to successfully integrate all my zigbee devices using the built in ZHA support in HA. I was previously using Z2M, so it was nice to have a native solution - I was able to decommission my mqtt server as well as Z2M itself.
A new zigbee device isn’t working as well however, and as no quirk is being loaded I presume its because it is not supported yet. I see it in the Z2M list however, so it should be possible.
Rather than ask the question on a per device basis, I was wondering if there was a way to reuse the quirk used by Z2M (herdsman) in ZHA? The formats seem to be different but I can’t quite figure out a mapping - as well as understand how to introduce custom quirks in ZHA.
Any thoughts or tips?
walt
(Walt)
September 9, 2020, 6:04pm
2
You might start here:
# Primer
ZHA device handlers and it's provided Quirks allow Zigpy, ZHA and Home Assistant to work with non standard Zigbee devices. If you are reading this you may have a device that isn't working as expected. This can be the case for a number of reasons but in this guide we will cover the cases where functionality is provided by a device in a non specification compliant manner by the device manufacturer.
## What are these specifications?
[Zigbee Specification](https://zigbeealliance.org/wp-content/uploads/2019/11/docs-05-3474-21-0csg-zigbee-specification.pdf)
[Zigbee Cluster Library](https://zigbeealliance.org/wp-content/uploads/2019/12/07-5123-06-zigbee-cluster-library-specification.pdf)
[Zigbee Base Device Specification](https://zigbeealliance.org/wp-content/uploads/zip/zigbee-base-device-behavior-bdb-v1-0.zip)
[Zigbee Primer](https://docs.smartthings.com/en/latest/device-type-developers-guide/zigbee-primer.html)
## What is a device in human terms?
A device is a physical object that you want to join to a Zigbee network: a light bulb, a switch, a sensor etc. The host application, in this case Zigpy, needs to understand how to interact with the device so there are standards that define how the application and devices can communicate. The device's functionality is described by several **descriptors** while the device itself contains **endpoints** and **endpoints** contain **clusters**. There are two types of clusters an endpoint contains:
- **in_clusters** - are "Server" clusters in ZCL terms. These clusters control the device, e.g. a smart plug or light bulb would have an `on_off` server cluster. **in_clusters** are also the ones which also send attribute reports and/or you can read an attribute from a **in_cluster**.
- **out_clusters** - are "Client" clusters. These clusters control some other device, as "Client" cluster sends commands to "Server" cluster. For example an On/Off remote would have an `on_off` client cluster and will generate cluster commands and send those to some other device.
Zigpy needs to understand all these elements in order to correctly work with the device.
This file has been truncated. show original
You can’t directly re-use the z2m quirks but you can definitely use the information from them to build your own quirk.
1 Like