ARCHIVE: July, 2019

Zigbee Switch Configurable Firmware (+Router)

This firmware allows you to create a Zigbee switch device with a flexible configuration of inputs and outputs. I’ve created a base firmware for CC2530, CC2530 + CC2590 , CC2530 + CC2591 and CC2530 + CC2592 chips. The attached configurator for Windows can write your device configuration to the selected base firmware. Then you can save the customized version to a separate HEX file and upload to your device.

Inputs and outputs can work independently. So you may create a switch without a control button, or a simple button only.

The device with this firmware also works as a router.

Note: the firmware is designed for constantly powered devices.


Fig.1 The configuration window

Remember state – The firmware saves the output state to NVRAM and restores it after power off/on.

Link – The input immediately controls the state of the corresponding output. The device sends the on/off state of the output to a coordinator. Otherwise, the input is independent.

Long – The firmware detects and reports to the coordinator a long click (2000 ms).

Double – The firmware detects and reports double click (max 500 ms between clicks).

Triple – The firmware detects and reports triple-click (max 500 ms between clicks).

Zigbee internals

  1. The firmware creates a separate endpoint (1..5) for every configured output and/or input (max 5 endpoints).
  2. The firmware reports the state of an independent button via the “ZCL_CLUSTER_ID_GEN_MULTISTATE_INPUT_BASIC” cluster and the “PRESENT_VALUE” attribute. 1 – single click.
    2 – double click.
    3 – triple-click.
    4 – long click.
  3. The firmware does not send a separate report for the linked button. Otherwise, it sends reports about the output state via the “ZCL_CLUSTER_ID_GEN_ON_OFF” cluster and the “ON_OFF” attribute.
  4. You may control the output state via the “ZCL_CLUSTER_ID_GEN_ON_OFF” cluster and the “ON_OFF” attribute.
  5. The “ZCL_CLUSTER_ID_GEN_ON_OFF” cluster also accepts the “read”, “configure” and “onOffWithTimedOff” commands: “read” – returns the current state on the specified endpoint.
    “configure” – set the periodic reporting interval for the output. The “minReportInt” attribute specifies the reporting interval in seconds. If “minReportInt” is 65535, the firmware disables periodic reports. “onOffWithTimedOff” – sets the output state to “HIGH” for “onTime” milliseconds, and automatically resets to “LOW”.


2019-08-14: Fixed bug with 3rd and 4th inputs.
2019-06-27: First release.


Download firmware

There are no more results.