Homey Apps SDK
📖 Apps SDK Reference🌍 Web API🛠 Developer Tools
  • Welcome to the Apps SDK documentation 👋
  • The Basics
    • Getting Started
      • Homey CLI
    • App
      • Manifest
      • Internationalization
      • Permissions
      • Persistent Storage
    • Drivers & Devices
      • Pairing
        • System Views
          • Devices List
          • Add Devices
          • OAuth2 Login
          • Credentials Login
          • Pincode
          • Loading
          • Done
        • Custom Views
      • Capabilities
      • Energy
      • Settings
      • Best practices
        • Lights
        • Window coverings
        • Battery status
    • Flow
      • Arguments
      • Tokens
    • Widgets
      • Settings
      • Styling
      • Debugging
  • Wireless
    • Wi-Fi
      • Discovery
    • Bluetooth LE
    • Z-Wave
    • Zigbee
    • 433 MHz
    • Infrared
    • Matter
  • Cloud
    • OAuth2
    • Webhooks
  • App Store
    • Publishing
    • Guidelines
    • Verified Developer
    • Updating
  • Advanced
    • Custom Views
      • App Settings
      • Custom Pairing Views
      • HTML & CSS Styling
    • Web API
    • Images
    • LED Ring
    • Homey Compose
  • Guides
    • Homey Cloud
    • Breaking Changes
    • Tools
      • Bluetooth LE
      • Zigbee
      • TypeScript
    • Using ESM in Homey Apps
  • Upgrade Guides
    • Homey v6.0.0
    • Upgrading to SDK v3
      • Zigbee Apps
    • Device Capabilities
Powered by GitBook
On this page
  • Updating dependencies
  • Updating the driver manifest
  • Updating drivers
  • Examples
  • Breaking changes for homey-zigbeedriver

Was this helpful?

  1. Upgrade Guides
  2. Upgrading to SDK v3

Zigbee Apps

How to upgrade your Zigbee App to the new Zigbee API introduced in Homey 5.0.0

PreviousUpgrading to SDK v3NextDevice Capabilities

Last updated 1 year ago

Was this helpful?

Updating dependencies

Install and :

npm install --save homey-zigbeedriver zigbee-clusters

And uninstall :

npm uninstall homey-meshdriver

Updating the driver manifest

The most notable change here is the addition of the endpoints property which needs to contain the endpoint definition. Additionally, the number of properties which are used to identify a Zigbee device have been reduced, and only the following two are required:

  • productId

  • manufacturerId

Therefore, the following can be removed:

  • deviceId

  • profileId

To discover the endpoint definition of your Zigbee device, use the "interview" button in the . It is not safe to assume the endpoint ids you might have used before are equal. It is advised to test this with your device, since an incorrect endpoint definition will result in a non-functioning device.

The endpoint definition is currently dynamic such that it does not require a repair for it to be updated on the device. In the future this might change.

For more information on how to add the endpoints definition see the .

Updating drivers

For many drivers it will be very easy to update SDK v3 and homey-zigbeedriver.

If your driver extends ZigBeeLightDevice it is as easy as replacing the imports from:

const { ZigBeeLightDevice } = require('homey-meshdriver');

class DimmableBulb extends ZigBeeLightDevice {}

module.exports = DimmableBulb;

To:

const { ZigBeeLightDevice } = require('homey-zigbeedriver');

class DimmableBulb extends ZigBeeLightDevice {}

module.exports = DimmableBulb;

If your driver extends ZigBeeDevice the first step is to replace the homey-meshdriver imports with homey-zigbeedriver, for example:

const { ZigBeeDevice } = require('homey-zigbeedriver');

class MyZigBeeDevice extends ZigBeeDevice {}

module.exports = MyZigBeeDevice;

The next steps depends on the implementation of the driver:

  • For directly sending commands to the node check the Zigbee guide > Driver and Device > Commands.

  • For registering capabilities check the Zigbee guide > Driver and Device > Capabilities.

  • For configuration attribute reporting check the Zigbee guide > Driver and Device > Attribute Reporting.

  • For bindings and groups (new!) check the Zigbee guide > Driver and Device > Bindings and Groups.

  • For implementing custom clusters (new!) check the Zigbee guide > Driver and Device > Custom Cluster.

  • If your app implements custom Flows or accesses Managers for other reasons, check the updated SDK v3 documentation.

Examples

Breaking changes for homey-zigbeedriver

This is a non exhaustive list of breaking changes in homey-zigbeedriver with respect to homey-meshdriver which might be good to be aware of:

  • MeshDevice is removed in favour of ZigBeeDevice.

  • onMeshInit() is deprecated in favour of onNodeInit().

  • this.node.on(‘online’) is removed in favour of this.onEndDeviceAnnounce().

  • getClusterEndpoint returns null if not found.

  • cluster property is changed from string value (e.g. genOnOff) to an object which is exported by const { CLUSTER } = require(‘zigbee-clusters’);

  • registerReportListener is deprecated in favour of BoundCluster implementation.

  • registerAttrReportListener is deprecated in favour of configureAttributeReporting.

  • calculateZigbeeDimDuration renamed to calculateLevelControlTransitionTime.

    • calculateColorControlTransitionTime is added for the colorControl cluster.

  • ZigBeeXYLightDevice is removed in favour of ZigBeeLightDevice, it detects if the light supports hue and saturation or XY only.

In case you need some inspiration, or need an example, take a look at the following example app which has been migrated to SDK v3 and homey-zigbeedriver .

homey-zigbeedriver
zigbee-clusters
homey-meshdriver
Zigbee developer tools
Zigbee guide
com.ikea.tradfri