Library implementing Zigpy quirks for ZHA in Home Assistant
Project description
ZHA Device Handlers For Home Assistant
ZHA Device Handlers are custom quirks implementations for Zigpy, the library that provides the Zigbee support for the ZHA component in Home Assistant.
ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices. Zigbee devices that deviate from or do not fully conform to the standard specifications set by the Zigbee Alliance may require the development of custom ZHA Device Handlers (ZHA custom quirks handler implementation) to for all their functions to work properly with the ZHA component in Home Assistant.
Custom quirks implementations for zigpy implemented as ZHA Device Handlers are a similar concept to that of Hub-connected Device Handlers for the SmartThings Classics platform as well that of Zigbee-Herdsman Converters / Zigbee-Shepherd Converters as used by Zigbee2mqtt, meaning they are virtual representation of a physical device that expose additional functionality that is not provided out-of-the-box by the existing integration between these platforms. See Device Specifics for details.
How to contribute
For specific Zigbee debugging instructions on capturing logs and more, see the contributing guidelines in the CONTRIBUTING.md file:
If you are looking to make your first code contribution to this project then we also suggest that you follow the steps in these guides:
- https://github.com/firstcontributions/first-contributions/blob/master/README.md
- https://github.com/firstcontributions/first-contributions/blob/master/github-desktop-tutorial.md
Currently Supported Devices:
CentraLite
- Contact Sensor: CentraLite 3300-S
- Motion Sensor: CentraLite 3305-S
- Dimmer Switch: CentraLite 3130
- Water Sensor: CentraLite 3315-S
- Contact Sensor: CentraLite 3320-L
- Motion Sensor: CentraLite 3325-S
- Motion Sensor: CentraLite 3326-L
- Contact Sensor: CentraLite 3321-S
- Temperature / Humidity Sensor: CentraLite 3310-S
- Smart Button: CentraLite 3460-L
- Thermostat: CentraLite 3157100
Xiaomi Aqara
- Cube: lumi.sensor_cube.aqgl01
- Button: lumi.sensor_switch.aq2
- Vibration Sensor: lumi.vibration.aq1
- Contact Sensor: lumi.sensor_magnet.aq2
- Motion Sensor: lumi.sensor_motion.aq2
- Temperature / Humidity Sensor: lumi.weather
- Water Leak: lumi.sensor_wleak.aq1
- US Plug: lumi.plug.maus01
- EU Plug: lumi.plug.mmeu01
- CN Plug: lumi.plug
Osram
SmartThings
- Arrival Sensor: tagv4
- Motion Sensor: MotionV4
- Multi Sensor: MultiV4
Keen Home
- Temperature / Humidity / Pressure Sensor: LUMI RS-THP-MP-1.0
Lutron
- Connected Bulb Remote: Lutron LZL4BWHL01 Remote
WAXMANN
- Water Sensor: leakSMART Water Sensor V2
Digi
- XBee Series 2: xbee
- XBee Series 3: xbee3
Yale
Configuration:
- Update Home Assistant to 0.85.1 or a later version.
NOTE: Some devices will need to be unpaired and repaired in order to see sensor values populate in Home Assistant.
Device Specifics:
Centralite
- All supported devices report battery level
- Dimmer Switch publishes events to Home Assistant
- Dimmer Switch temperature sensor is removed because it is non functional
- 3321-S reports acceleration
- 3310-S reports humidity
Osram
- Dimmer Switch publishes events to Home Assistant and reports battery level
- Dimmer Switch temperature sensor is removed because it is non functional
Xiaomi Aqara
- All supported devices report battery level
- All supported devices report temperature but I am unsure if it is correct or accurate
- Vibration sensor exposes a binary sensor in Home Assistant that reports current vibration state
- Vibration sensor sends
tilt
anddrop
events to Home Assistant - Cube sends the following events:
flip (90 and 180 degrees)
,rotate_left
,rotate_right
,knock
,drop
,slide
andshake
- Motion sensor exposes binary sensors for motion and occupancy.
- Button sends events to Home Assistant
- All supported plugs report power consumption and can be toggled
SmartThings
- All supported devices report battery level
- tagV4 exposed as a device tracker in Home Assistant. The current implementation will use batteries rapidly
- MultiV4 reports acceleration
Lutron
- Connected bulb remote publishes events to Home Assistant
WAXMANN
- leakSMART water sensor is exposed as a binary_sensor with DEVICE_CLASS_MOISTURE
Digi XBee
- Some functionality requires a coordinator device to be XBee as well
- GPIO pins are exposed to Home Assistant as switches
- Analog inputs are exposed as sensors
- PWM output on XBee3 can be controlled by writing 0x0055 (present_value) cluster attribute with
zha.set_zigbee_cluster_attribute
service - Outgoing UART data can be sent with
zha.issue_zigbee_cluster_command
service - Incoming UART data will generate
zha_event
event. - PWM can be controlled with
zha.set_zigbee_cluster_attribute
service
Please refer to xbee.md for details on configuration and usage examples.
Yale
- All supported devices report battery level
Testing new releases
Testing a new release of the zha-quirks package before it is released in Home Assistant.
If you are using Supervised Home Assistant (formerly known as the Hassio/Hass.io distro):
- Add https://github.com/home-assistant/hassio-addons-development as "add-on" repository
- Install "Custom deps deployment" addon
- Update config like:
where 0.0.38 is the new versionpypi: - zha-quirks==0.0.38 apk: []
- Start the addon
If you are instead using some custom python installation of Home Assistant then do this:
- Activate your python virtual env
- Update package with
pip
pip install zha-quirks==0.0.38
Testing quirks in development in docker based install
If you are using Supervised Home Assistant (formerly known as the Hassio/Hass.io distro) you will need to get access to the home-assistant docker container. Directions below are given for using the portainer add-on to do this, there are other methods as well not covered here.
-
Install the portainer add-on (https://github.com/hassio-addons/addon-portainer) from Home Assistant Community Add-ons.
-
Follow the add-on documentation to un-hide the home-assistant container (https://github.com/hassio-addons/addon-portainer/blob/master/portainer/DOCS.md)
-
Stage the update quirk in a directory within your config directory
-
Use portainer to access a console in the home-assistant container:
-
Access the quirks directory
- on HA > 0.113: /usr/local/lib/python3.8/site-packages/zhaquirks/
- on HA < 0.113: /usr/local/lib/python3.7/site-packages/zhaquirks/
-
Copy updated/new quirk to zhaquirks directory:
cp -a /config/temp/NEW_QUIRK ./
-
Remove the pycache folder so it is regenerated
rm -rf ./__pycache__/
-
Close out the console and restart HA.
-
Note: The added/update quirk will not survive a HA version update.
Thanks
- Special thanks to damarco for the majority of the device tracker code
- Special thanks to Yoda-x for the Xioami attribute parsing code
- Special thanks to damarco and Adminiuga for allowing me to bounce ideas off of them and for listening to me ramble
Related projects
Zigpy
zigpy is Zigbee protocol stack integration project to implement the Zigbee Home Automation standard as a Python 3 library. Zigbee Home Automation integration with zigpy allows you to connect one of many off-the-shelf Zigbee adapters using one of the available Zigbee radio library modules compatible with zigpy to control Zigbee based devices. There is currently support for controlling Zigbee device types such as binary sensors (e.g., motion and door sensors), sensors (e.g., temperature sensors), lightbulbs, switches, locks, fans, covers (blinds, marquees, and more). A working implementation of zigpy exist in Home Assistant (Python based open source home automation software) as part of its ZHA component
ZHA Map
zha-map project allow building a Zigbee network topology map for ZHA component in Home Assistant.
zha-network-visualization-card
zha-network-visualization-card is a custom Lovelace element for visualizing the Zigbee network map for ZHA component in Home Assistant.
ZHA Network Card
zha-network-card is a custom Lovelace card that displays ZHA network and device information in Home Assistant
zigpy-deconz-parser
zigpy-deconz-parser project can parse Home Assistant ZHA component debug log using zigpy-deconz
library if you have ConBee or RaspBee hardware.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file zha-quirks-0.0.44.tar.gz
.
File metadata
- Download URL: zha-quirks-0.0.44.tar.gz
- Upload date:
- Size: 68.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a08d4e565a2044f519482f04400157434c421c361b2c9747fd1a030aac65b830 |
|
MD5 | 914609c240842cb271b4806f5f57e390 |
|
BLAKE2b-256 | 78f83956fa1159b746b3b0e6078490fcf21508c88b2f88b8f4d28c8009640f66 |
File details
Details for the file zha_quirks-0.0.44-py3-none-any.whl
.
File metadata
- Download URL: zha_quirks-0.0.44-py3-none-any.whl
- Upload date:
- Size: 150.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c24fca458f236361a5368d3f5076f1971c0ebb21124998f1834b5685e0d80759 |
|
MD5 | 9c469adc2c67b785d5c111e04b60ea5d |
|
BLAKE2b-256 | 3d7d3e3bb9a3538a3d6efa57c45996260f1221c66d2512ab2d9e0c2c2fd2af6f |