Skip to main content

Library implementing a ZigBee stack

Project description

zigpy

Build Status Coverage

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, and fans.

zigpy contains common code implementing Zigbee ZCL, ZDO and application state management which is being used by various radio libraries implementing the actual interface with the radio modules from different manufacturers. The separate radio libraries interface with radio hardware adapters/modules over USB and GPIO using different native UART serial protocols.

Reference implementation of the zigpy library exist in Home Assistant (Python based open source home automation software) as part of its ZHA integration component.

Compatible hardware

Radio libraries for zigpy include bellows (which communicates with EZSP/EmberZNet based radios), zigpy-xbee (which communicates with XBee based Zigbee radios), and as zigpy-deconz for deCONZ serial protocol (for communicating with ConBee and RaspBee USB and GPIO radios from Dresden-Elektronik). There are also experimental radio libraries called zigpy-zigate for communicating with ZiGate based radios and zigpy-cc for communicating with Texas Instruments based radios based radios that have custom Z-Stack coordinator firmware.

Known working Zigbee radio modules

Experimental support for additional Zigbee radio modules

Testing new releases

Testing a new release of the zigpy library before it is released in Home Assistant.

If you are using Supervised Home Assistant (formerly known as the Hassio/Hass.io distro):

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 zigpy==0.20.0
    
    

Troubleshooting

For troubleshooting with Home Assistant, the general recommendation is to first only enable DEBUG logging for homeassistant.core and homeassistant.components.zha in Home Assistant, then look in the home-assistant.log file and try to get the Home Assistant community to exhausted their combined troubleshooting knowledge of the ZHA component before posting issue directly to a radio library, like example zigpy-deconz or zigpy-xbee.

That is, begin with checking debug logs for Home Assistant core and the ZHA component first, (troubleshooting/debugging from the top down instead of from the bottom up), trying to getting help via Home Assistant community forum before moving on to posting debug logs to zigpy and radio libraries. This is a general suggestion to help filter away common problems and not flood the zigpy-cc developer(s) with too many logs.

Please also try the very latest versions of zigpy and the radio library, (see the section above about "Testing new releases"), and only if you still have the same issues with the latest versions then enable debug logging for zigpy and the radio libraries in Home Assistant in addition to core and zha. Once enabled debug logging for all those libraries in Home Assistant you should try to reproduce the problem and then raise an issue to the zigpy repo (or to a specific radio library) repo with a copy of those logs.

To enable debugging in Home Assistant to get debug logs, either update logger configuration section in configuration.yaml or call logger.set_default_level service with {"level": "debug"} data. Check logger component configuration where you want something this in your configuration.yaml

logger: default: info logs: asyncio: debug homeassistant.core: debug homeassistant.components.zha: debug zigpy: debug bellows: debug zigpy_xbee: debug zigpy_deconz: debug zigpy_zigate: debug zigpy_cc: debug

Release packages available via PyPI

New packages of tagged versions are also released via the "zigpy" project on PyPI

Older packages of tagged versions are still available on the "zigpy-homeassistant" project on PyPI

Packages of tagged versions of the radio libraries are released via separate projects on PyPI

How to contribute

You can contribute to this project either as an end-user, a tester (advanced user contributing constructive issue/bug-reports) or as a developer contributing code.

How to contribute as an end-user

If you think that you are having problems due to a bug then please see the section below on reporting issues as a tester, but be aware that reporting issues put higher responsibility on your active involvement on your part as a tester.

Some developers might be also interested in receiving donations in the form of money or hardware such as Zigbee modules and devices, and even if such donations are most often donated with no strings attached it could in many cases help the developers motivation and indirectly improve the development of this project.

Sometimes it might just be simpler to just donate money earmarked to specifically let a willing developer buy the exact same type Zigbee device that you are having issues with to be able to replicate the issue themselves in order to troubleshoot and hopefully also solve the problem.

Consider submitting a post on GitHub projects issues tracker about willingness to making a donation (please see section below on posing issues).

How to report issues or bugs as a tester

Issues or bugs are normally first to be submitted upstream to the software/project that it utilizing zigpy and its radio libraries, (like for example Home Assistant), however if and when the issue is determined to be in the zigpy or underlying radio library then you should continue by submitting a detailed issue/bug report via the GitHub projects issues tracker.

Always be sure to first check if there is not already an existing issue posted with the same description before posting a new issue.

How to contribute as a developer

If you are looking to make a contribution as a developer to this project we suggest that you follow the steps in these guides:

Code changes or additions can then be submitted to this project on GitHub via pull requests:

Developer references

Silicon Labs video playlist of ZigBee Concepts: Architecture basics, MAC/PHY, node types, and application profiles

Related projects

ZHA Device Handlers

ZHA deviation handling in Home Assistant relies on the third-party ZHA Device Handlers project. 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. These ZHA Device Handlers for Home Assistant can thus be used to parse custom messages to and from non-compliant Zigbee devices. The custom quirks implementations for zigpy implemented as ZHA Device Handlers for Home Assistant are a similar concept to that of Hub-connected Device Handlers for the SmartThings platform as well as that of zigbee-herdsman converters as used by Zigbee2mqtt, meaning they are each virtual representations of a physical device that expose additional functionality that is not provided out-of-the-box by the existing integration between these platforms.

ZHA Custom Radios

zha-custom-radios adds support for custom radio modules for zigpy to [Home Assistant's ZHA (Zigbee Home Automation) integration component]. This custom component for Home Assistant allows users to test out new modules for zigpy in Home Assistant's ZHA integration component before they are integrated into zigpy ZHA and also helps developers new zigpy radio modules without having to modify the Home Assistant's source code.

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

zigpy-0.22.1.tar.gz (81.1 kB view details)

Uploaded Source

Built Distribution

zigpy-0.22.1-py3-none-any.whl (102.2 kB view details)

Uploaded Python 3

File details

Details for the file zigpy-0.22.1.tar.gz.

File metadata

  • Download URL: zigpy-0.22.1.tar.gz
  • Upload date:
  • Size: 81.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for zigpy-0.22.1.tar.gz
Algorithm Hash digest
SHA256 e22699605791155c3ad812d432260edde7b163cfa519652e88588e1979cff48d
MD5 ddeb14e43a4fdcb30ac4c84211fba3fc
BLAKE2b-256 d4b31e9bfa0087c972f68fdeb2555d9070f501e078d4e80871ee6400c36c8548

See more details on using hashes here.

File details

Details for the file zigpy-0.22.1-py3-none-any.whl.

File metadata

  • Download URL: zigpy-0.22.1-py3-none-any.whl
  • Upload date:
  • Size: 102.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/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for zigpy-0.22.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a11bced7e9df617f27ebae4e8a9c9bfcbbe6e600fab69c688a3f28b7891fec7
MD5 1e1a648671c90108eaa443cd6de7ad45
BLAKE2b-256 f6fb1d398f3604e2ec5658f8f1ccbe8516e7db7c02da6a5e4237ab1021023b46

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page