The Zigbee light control example demonstrates a basic Zigbee network. It provides a minimal implementation of the following devices:
The coordinator establishes the network and commissions the light bulb and light switch. Once the light switch is successfully commissioned, it sends a broadcast message to find any device with implemented Level Control and On/Off clusters. It remembers the device network address from the first response and is controlled via on-board buttons.
All devices indicate the Zigbee stack state using LEDs, as defined in Thread BSP LED reference. The dimmable light option is available from BSP_LED_3 on the light bulb. On the coordinator node, BSP_LED_2 informs if the network is opened for new devices (BSP_LED_2 is turned on) or closed (BSP_LED_2 is turned off). Currently there is no option to reopen the network, so it is recommended to power up all devices while BSP_LED_2 is on. The network stays opened for 180 seconds after coordinator start-up.
Buttons are used only on the light switch node. Pressing BSP_BUTTON_1 after successful commissioning (BSP_LED_2 state) should turn off the light bulb (BSP_LED_3). Pressing BSP_BUTTON_0 will turn it back on. Using a long press adjusts the brightness level of the light bulb. BSP_BUTTON_1 decreases the brightness and BSP_BUTTON_0 increases the brightness.
You can find the source code and the makefiles in the following folders:
<InstallFolder>\examples\zigbee\experimental\light_control\light_coordinator
<InstallFolder>\examples\zigbee\experimental\light_control\light_switch
<InstallFolder>\examples\zigbee\experimental\light_control\light_bulb