ZHA UI option to add a custom quirk (ZHA device handder) via Home Assistant frontend GUI?

Request UI option to add/remove a “custom quirk” (Zigbee device handler) to ZHA via the frontend GUI.

Having a UI option to add ZHA quirks would make it much more user-friendly to test custom quirks.

For those who do not know, a “custom quirk” for the native ZHA (Zigbee Home Automation) integration is a custom Zigbee device handler (a.k.a. Zigbee device converter or translator) which converts/translates non-standard Zigbee messages and parameters into standard Zigbee messages and parameters.

ZHA in Home Assistant ships with a “ZHA Device Handlers” (a.k.a. zha-quirks) library which contain a whole bunch of custom quirks that the ZHA/zigpy developers have already approved for mainline release, however, the ZHA integration also allows the end-user to on their own manually add custom quirks for testing a custom quirk which has not yet been approved for mainline release, but to do so is not always such a user-friendly experience.

Thus it would be a nice ZHA feature if it would there was a UI option to upload custom quirks via GUI.

Manually add and use a not yet merged custom ZHA quirk

If you have bought a non-standard Zigbee device that is not yet supported by ZHA but someone have written a ZHA “quirk” module (ZHA Device Handler/Zigbee Converter) that not get been merged into a “ZHA Device Handlers"” library release then you can add that manually as a custom ZHA quirk to your Home Assistant instance, (using something like File Editor or Samba share add-ons in Home Assistant).

  1. Get a copy of an existing custom ZHA quirk or code your own quirks. Tip is to search using Zigbee device signature Issues · zigpy/zha-device-handlers · GitHub
  2. Create a directory/folder for your custom quirks (for example /config/zha_quirks/)
  3. Copy or create a quirk file in this directory (called it for example “devicemodelzyz_devicetypexyz.py”). This file should contain the Python script for the quirk and its specific Zigbee device signature unique to it.
  4. Add configuration with the full path to the directory that now containing custom quirk module(s) that will override and take precedence over any built-in quirks matching any device that has the same Zigbee device signature. to Home Assistant’s config.yaml
zha:
  custom_quirks_path: /config/zha_quirks/
  1. Restart Home Assistant to make the quirk take effect.

Great idea! I’m all for it! :+1:

3 Likes