Skip to main content

Zigbee Home Automation (ZHA)

CI Coverage Status python pre-commit PyPI version License: Apache 2.0

ZHA is a versatile and hardware-independent Zigbee gateway implementation, designed to replace proprietary Zigbee gateways, bridges, hubs, and controllers. With ZHA, you can create a unified Zigbee network, allowing you to easily pair and connect a wide range of Zigbee-based devices for home automation and lighting.

Key Features

  • Hardware Independence: ZHA is not tied to any specific hardware, giving you the freedom to choose the Zigbee radio that best suits your needs.
  • Compatibility: ZHA supports a vast array of Zigbee-based devices, ensuring seamless integration with popular home automation and lighting solutions.
  • Unified Zigbee Network: By utilizing ZHA, you can establish a single Zigbee network, simplifying device management and enhancing interoperability.
  • Low-Bandwidth Communication: Zigbee operates on a low-bandwidth communication protocol, utilizing small, low-power digital radios to connect devices within local Zigbee wireless private area networks.

Getting Started With Development

To bootstrap a development environment for ZHA, follow these steps:

  1. Clone the project from the zigpy organization:

    git clone https://github.com/zigpy/zha.git
    
  2. Navigate to the script directory:

    cd zha/script
    
  3. Run the setup script to install the necessary dependencies:

    ./setup
    

    The setup script sets up a virtual environment, installs necessary packages and dependencies, and configures pre-commit hooks for the project. It helps ensure a consistent and controlled development environment for the project, saving you time and effort.

    Script Overview

    The setup script in the zha/script directory performs the following actions:

    • curl -LsSf https://astral.sh/uv/install.sh | sh: This command uses curl to download a shell script from the specified URL (https://astral.sh/uv/install.sh) and then pipes it to the sh command to execute it. This script is responsible for installing a tool called "uv" (short for "universal virtualenv") which helps manage Python virtual environments.

    • uv venv venv: This command uses the "uv" tool to create a new Python virtual environment named "venv" in the current directory. A virtual environment is an isolated Python environment that allows you to install packages and dependencies specific to your project without affecting the global Python installation.

    • . venv/bin/activate: This command activates the newly created virtual environment. When a virtual environment is activated, any subsequent Python-related commands will use the Python interpreter and packages installed within that environment.

    • uv pip install -U pip setuptools pre-commit: This command uses the "uv" tool to upgrade the "pip" package manager, as well as install or upgrade the "setuptools" and "pre-commit" packages. "pip" is the default package manager for Python, "setuptools" is a library that facilitates packaging Python projects, and "pre-commit" is a tool for managing and enforcing pre-commit hooks in a Git repository.

    • uv pip install -r requirements_test.txt: This command uses the "uv" tool to install the Python packages listed in the "requirements_test.txt" file. This file typically contains a list of dependencies required for running tests in the project.

    • uv pip install -e .: This command uses the "uv" tool to install the project itself in editable mode. The dot (.) represents the current directory, so this command installs the project as a package in the virtual environment.

    • pre-commit install: This command installs Git pre-commit hooks for the project. Pre-commit hooks are scripts that run before each commit is made in a Git repository, allowing you to enforce certain checks or actions before committing changes.

  4. If creating new entities or modifying existing ones, unit tests that use device diagnostic files will fail. You can regenerate existing device diagnostic JSON files to incorporate the new entities:

    python -m tools.regenerate_diagnostics
    

License

ZHA is released under the Apache 2.0 License. Please refer to the LICENSE file for more details

Metadata

Release files for zha 2.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zha 2.5.1
File Size Uploaded Provenance Actions
zha-2.5.1.tar.gz 312.7 kB Without provenance Details for zha-2.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zha 2.5.1
File Interpreter ABI Platform Actions
zha-2.5.1-py3-none-any.whl Python 3 none any Details for zha-2.5.1-py3-none-any.whl

Total release size: 522.9 kB

Release files / zha-2.5.1.tar.gz

Download URL zha-2.5.1.tar.gz
Size 312.7 kB
Tags Source
SHA-256 checksum
How to use checksums
854ce787bb1f6d5aadd760d835eabd2bc036138326207dfb60345b1e1d495c0a
BLAKE2b-256 checksum
How to use checksums
5bf0f96ae72142fa257ce3c71d1109b4e8f45b1745bf10c4b3de8cb45751b475
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / zha-2.5.1-py3-none-any.whl

Download URL zha-2.5.1-py3-none-any.whl
Size 210.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcc740ecdfbecc20b328198b4e0b8a00db2d7adb1d8d874025c739fcc68e021e
BLAKE2b-256 checksum
How to use checksums
5c53dfc0e3782b181b85908ebad3204e556dacbcefeb0d2468a0faff063958f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for zha 2.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.5.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page