endpoints
, these are collections of clusters
. A cluster is essentially a capability of a Zigbee device.BoundCluster
to receive and handle the incoming commands in your app. For more information on implementing a BoundCluster
check out the API section.ZigBeeNode
.manufacturerName
productId
manufacturerName
and productId
.manufacturerName
, productId
and endpoint definitions, the driver's manifest can be created. This is where is defined that this driver is for a Zigbee device, for which Zigbee device specifically (hence the manufacturerName
and productId
), and what the endpoints and clusters of this Zigbee device are (hence the endpoint definitions).zigbee
object to the driver's manifest.zigbee
object contains the following properties:manufacturerName
: This is the manufacturer id which is needed to identify the device.productId
: This is the product id which is needed to identify the device. It is possible to add multiple product ids if the driver targets a couple of very similar devices with different product ids.endpoints
: This is the endpoint definition for the device. Only the endpoints and clusters listed here will be available on the ZCLNode
instance (see the documentation on homey-zigbeedriver
and zigbee-clusters
in below in the API section). The keys of the endpoints
object refer to the endpoint id of the node.clusters
: This lists the cluster ids we want to implement as client. This means, the clusters we want to send commands to, or read attributes from, on the remote node.bindings
: This lists the cluster ids we want to implement as server. This means, the clusters we want to be able to receive commands on from a remote node. For each entry in bindings
a bind request will be made to the remote node during pairing. In case you want to implement attribute reporting for a specific cluster, add the cluster id here and the required binding will be made during pairing.peerDependency
of homey-zigbeedriver. This means that homey-zigbeedriver depends on zigbee-clusters being installed with a compatible version./drivers/my_driver/device.js
. Please refer to the Drivers guide for more information on this topic.homey-zigbeedriver
, which is a library we've created which does a lot of the heavy lifting for Zigbee apps. Take a look at the API section for the specifics of this library. Below, a number of basic implementations of various aspects of a Zigbee driver is demonstrated based on homey-zigbeedriver
.It is not recommended to keep this debug logging enabled when publishing your app.
zclNode
is an instance of ZCLNode
as exported by zigbee-clusters
(check the API section for more information on this library). It can be used to directly communicate with the node using the Zigbee Cluster Library (ZCL).homey-zigbeedriver
it is very easy to map Homey's capabilities to Zigbee clusters. The library contains a set of system capabilities, which are basically very common mappings between capabilities and clusters. It is possible to extend these system capabilities when registering them, for more information take a look at the homey-zigbeedriver
documentation and API section.bindings
property. After that, the attribute reporting must be configured on the node's cluster. The example below demonstrates two ways of configuring attribute reporting:BoundCluster
(this is exported by zigbee-clusters
):zigbee-clusters
documentation on Implementing a bound cluster.This feature is available as of Homey v5.0.0 and requires [email protected] or higher. Additionally,Driver
must extendZigBeeDriver
as exported by homey-zigbeedriver.
Device
you need to define a devices
property in your Zigbee driver's manifest. The keys of this object represent a unique sub device ID which will be added to the device data object as subDeviceId
. For example, based on the manifest below:device.js
to discern between the root device, and the various sub devices.class
, name
, and capabilties
properties that are omitted in the sub device will be copied over from the root device. If the sub device should not get the same settings as the root device, make sure to add the settings: []
property to the sub device, as demonstrated below.Device
will have access to the same ZCLNode
instance and can access all endpoints. By default, for each sub device a device instance, as exported in device.js
, will be created. If the implementation of device.js
is quite different between sub devices you can use Driver#onMapDeviceClass()
to properly separate the logic for the root and sub devices by implementing multiple Device
classes.zigbee-clusters
is built on. It is not advised to use this API directly, but it is there in case you need it.ZigBeeDevice
. This class handles getting a ZigBeeNode
and uses zigbee-clusters
to extend the ZigBeeNode with Zigbee Cluster Library (ZCL) functionality. Doing this enables a developer to directly communicate with the ZigBeeNode using ZCL very easily. The basic usage is demonstrated below, for more in-depth information take a look at the homey-zigbeedriver
documentation or the source code on GitHub.homey-zigbeedriver
:zclNode
in lib/clusters
. It is very easy to add new clusters, or add attributes or commands to an existing cluster, merely by changing the definition in one of the cluster files (e.g. the onOff cluster). If you are interested in how this library works, take a look at the Zigbee Cluster Specification (PDF). The basic usage of this library is demonstrated below, note that it is usually better to use ZigBeeDevice
exported by homey-zigbeedriver instead.homey-zigbeedriver
about which cluster we are targeting we need to import the cluster specification from zigbee-clusters
as demonstrated below.zigbee-clusters
.zigbee-clusters
, changes can be made to the cluster definition in lib/clusters
. For more information on how to do this, check out Implementing a cluster.bindings
array in the driver's manifest. Please refer to Implementing a bound cluster for more information on how to create a BoundCluster
in your driver.ZigBeeNode
if needed. In general it is advised not to use this API and take a look at zigbee-clusters and homey-zigbeedriver which are libraries built on top of the Zigbee API which do most of the heavy lifting and make it even easier to develop Zigbee apps for Homey.ZigBeeNode
using ZigBeeNode#sendFrame()
and ZigBeeNode#handleFrame()
βhandleFrame
method on ZigBeeNode
, this method is called when a frame is received and if it is not overridden it will throw.