Skip to content

Latest commit

 

History

History
148 lines (106 loc) · 11.1 KB

README.md

File metadata and controls

148 lines (106 loc) · 11.1 KB

zigpy-zigate

Build & Tests Coverage

zigpy-zigate is a Python 3 implementation for the Zigpy project to implement ZiGate based Zigbee radio devices.

ZiGate is a open source ZigBee adapter hardware that was initially launched on Kickstarter by @fairecasoimeme

Hardware and firmware compatibility

The ZiGate USB adapter communicates via a PL-2303HX USB to Serial Bridge Controller module by Prolific. There's also a Wi-Fi adapter to communicate with ZiGate over network.

Note! ZiGate open source ZigBee USB and GPIO adapter hardware requires ZiGate 3.1a firmware or later to work with this zigpy-zigate module, however ZiGate 3.1d firmware or later is recommended as it contains a specific bug-fix related to zigpy. See all available official ZiGate firmware releases here (link).

Known working ZiGate compatible Zigbee radio modules

Experimental ZiGate compatible Zigbee radio modules

Port configuration

  • To configure usb ZiGate (USB TTL or DIN) port, just specify the port, example : /dev/ttyUSB0
    • Alternatively you could manually set port to auto to enable automatic usb port discovery
  • To configure pizigate port, specify the port, example : /dev/serial0 or /dev/ttyAMA0
  • To configure wifi ZiGate, manually specify IP address and port, example : socket://192.168.1.10:9999

pizigate does require some additional adjustements on Raspberry Pi 3/Zero, and 4:

Flasher (ZiGate Firmware Tool)

zigpy-zigate has an integrated Python "flasher" tool to flash firmware updates on your ZiGate (NXP Jennic JN5168).

Thanks to Sander Hoentjen (tjikkun) zigpy-zigate now has an integrated firmware flasher tool!

See all available official ZiGate firmware releases here (link).

Flasher Usage

usage: python3 -m zigpy_zigate.tools.flasher [-h] -p {/dev/ttyUSB0} [-w WRITE] [-s SAVE] [-u] [-d] [--gpio] [--din]

optional arguments:
  -h, --help            show this help message and exit
  -p {/dev/ttyUSB0}, --serialport {/dev/ttyUSB0}
                        Serial port, e.g. /dev/ttyUSB0
  -w WRITE, --write WRITE
                        Firmware bin to flash onto the chip
  -s SAVE, --save SAVE  File to save the currently loaded firmware to
  -u, --upgrade         Download and flash the lastest available firmware
  -d, --debug           Set log level to DEBUG
  --gpio                Configure GPIO for PiZiGate flash
  --din                 Configure USB for ZiGate DIN flash

Testing new releases

Testing a new release of the zigpy-zigate 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-zigate==0.5.1
    
    

Releases via PyPI

Tagged versions are also released via PyPI

Developer references

Documents that layout the serial protocol used for ZiGate serial interface communication can be found here:

How to contribute

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

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

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, and fans. A working implementation of zigbe exist in Home Assistant (Python based open source home automation software) as part of its ZHA component

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 integration component for Home Assistant

ZHA integration component for Home Assistant is a reference implementation of the zigpy library as integrated into the core of Home Assistant (a Python based open source home automation software). There are also other GUI and non-GUI projects for Home Assistant's ZHA components which builds on or depends on its features and functions to enhance or improve its user-experience, some of those are listed and linked below.

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.

ZHA Custom

zha_custom is a custom component package for Home Assistant (with its ZHA component for zigpy integration) that acts as zigpy commands service wrapper, when installed it allows you to enter custom commands via to zigy to example change advanced configuration and settings that are not available in the UI.

ZHA Map

zha-map for Home Assistant's ZHA component can build a Zigbee network topology map.

ZHA Network Visualization Card

zha-network-visualization-card is a custom Lovelace element for Home Assistant which visualize the Zigbee network for the ZHA component.

ZHA Network Card

zha-network-card is a custom Lovelace card for Home Assistant that displays ZHA component Zigbee network and device information in Home Assistant

Zigzag

Zigzag is an custom card/panel for Home Assistant that displays a graphical layout of Zigbee devices and the connections between them. Zigzag can be installed as a panel or a custom card and relies on the data provided by the zha-map integration commponent.

ZHA Device Exporter

zha-device-exporter is a custom component for Home Assistant to allow the ZHA component to export lists of Zigbee devices.