Trident IoT Zigbee SDK
Loading...
Searching...
No Matches
Color Temperature Bulb ZR

Theory of Operation

The Color Temperature Bulb ZR application is a single endpoint, router light bulb that is capable of receiving on, off, and toggle commands via the On/Off cluster and color temperature commands via the Color Control cluster. When an on, off, or toggle command is received, the RGB LEDs will be activated accordingly. When the On/Off state changes, an attribute report shall be sent for the On/Off attribute to indicate the new state.

When a move to color temperature command is received, the device will set the mock color temperature to either warm white (Red + Green LEDs) or cool white (Red + Green + Blue LEDs) based on the received mired value. Color temperatures below 250 mireds (~4000K) are rendered as cool white, while values above 250 mireds are rendered as warm white.

When an identify start command is received, the blue LED will turn on for the duration specified in the command.

Upon first boot up, the device shall begin searching for a network if it is not already part of one. During the network search, 5 attempts will be made to find a network and the blue LED will blink 3 times at the start of each attempt. If a network is not found after 5 attempts, the red LED will turn on solid for 2 seconds. If the device boots up and is already part of a network then the green LED will turn on solid for 2 seconds.

If the device was previously part of a network, the Network Rejoin plugin will be used to attempt to rejoin the network.

By default, builds will be created for the Trident DKNCM11 board and for a custom PCB target when doing a project build. Both configurations are identical to start but this provides a way for users to build their applications for both targets as custom device development begins. This allows easier transition between different PCB targets which can be useful if a user ever wants Trident to help debug issues. Being able to run on the DKNCM11 board will allow Trident support to more quickly reproduce issues and support customers without needing the custom hardware target. To remove either hardware target from the build, simply delete or rename the hal_config_<board>T32CM11C directory. The build system looks for the hal_config directory and builds all of them for the specified chip target (T32CM11C).

Note
This is an experimental sample application demonstrating a Zigbee Router device type with basic color temperature functionality. This application has not been thoroughly tested yet.

ZCL Configuration

Endpoint 1
RoleZR
Profile ID0x0104
Device TypeHA Color Temperature Light (0x010C)
In Clusters (Client)Identify Cluster (0x0003)
OTA Upgrade Cluster (0x0019)
Remote CLI Cluster (0xFC54)
Out Clusters (Server)Basic Cluster (0x0000)
Identify Cluster (0x0003)
Groups Cluster (0x0004)
Scenes Cluster (0x0005)
On/Off Cluster (0x0006)
Level Control Cluster (0x0008)
Color Control Cluster (0x0300)
Diagnostics Cluster (0x0B05)
Remote CLI Cluster (0xFC54)

Trident Plugins

Enabled PluginsImplemented Callbacks
Bind
Command Line Interface (CLI)
Debug Print
Network Rejointr_network_rejoin_attempt_cb
Primary/Secondary Channel Masks
End Device Keepalive
Basic Server
Color Control Servertr_color_control_server_move_to_color_temperature_cb
Groups Server
Identify Client
Identify Servertr_identify_server_identify_start_cb
tr_identify_server_identify_stop_cb
Level Control Server
On/Off Server
Over the Air Bootloading Client
Remote CLI Client
Remote CLI Server
Scenes Server
tr_app_init_cb
tr_connection_state_cb
tr_zcl_command_cb

User Interface on the DKNCM11C10

USB-C Interface

Plugging a USB-C cable from a computer into the DKNCM11C10 will enable a COM port to appear on the computer. This can be connected used to open a connection to the CLI that is running on the device.

COM Port Settings
Baud115200
Data Bits8
Stop Bits1
ParityNone
Flow ControlNone

Buttons

ButtonActionDescription
BTN0PressHardware reset
BTN1PressRestart network rejoin backoff algorithm if rejoin is active
BTN1 + BTN2Hold for 5 secondsReset to factory defaults
BTN2PressRestart network rejoin backoff algorithm if rejoin is active

LEDs

LEDBehaviorDescription
GreenOn for 2 secondsDevice reboot and previously joined to a network
GreenBlink 100msWhen network rejoin attempt is made
RedOn for 2 secondsNetwork search attempts exhausted
RedBlinkingFactory reset in progress (hold BTN1+BTN2 for 5 seconds)
BlueOn for identify durationIdentify command received
BlueBlink 3 times x 250msNetwork search attempt started
Warm White (Red+Green)On solidON command received while color temperature set above 250 mireds
Cool White (Red+Green+Blue)On solidON command received while color temperature set below 250 mireds

Custom APP Tokens

This project contains an example of how to create custom APP tokens that can be used from the application and can be interacted with externally via elcap. As long as the project_app_tokens.h exists in the project src directory, the application tokens will be added to the project and the APP token definition file needed for interacting with these tokens via elcap will be generated into the build directory. The APP token definition file looks like T32CM11C_app_token_def.json.