Universal firmware for Zigbee CCT (dual-color cold + warm white) lamps and LED strip dimmers.
Mostly based on the Telink SDK example, with cleanup and some improvements:
- Smooth On/Off transition (configurable via
OnOffTransitionTimeattribute) - Brightness gamma correction
- Hardware configuration stored in a separate flash region; OTA updates are hardware-independent
- Optional status LED and button support
The firmware targets 512k flash size, so it supports the entire TLSR825x family, including Tuya ZT* and cheap TB-03F/04/05 modules.
First flash is only possible over SWS; after that, OTA updates can be used.
Pick a suitable configuration in hw_variants.h, or set your own in hw_config_custom:
cold_pwm_pin,warm_pwm_pin- PWM output pins; any pins frompwm_channel_map, but the two PWM channels must be different.pwm_freq- LED PWM frequency in Hz. Higher values reduce flicker, but setting it too high may damage your hardware, especially cheap LED strip dimmers with slow power MOSFETs. Tested safe values: 10k for a track lamp with Hi7001 drivers, 1k for a LED strip dimmer.cold_temp_k,warm_temp_k- color temperature of the cold/warm channel, in K.status_led_pin- status LED pin; set toPIN_NCif not used.button_pin- button pin; set toPIN_NCif not used.pin_invert_mask- input/output invert bitmap; any combination ofINVERT_PWM,INVERT_LED_STATUS,INVERT_BUTTON. When a bit is set, the corresponding i/o is active-low, otherwise active-high.model_name- zigbee model name string.
Build and flash using TLSRPGM:
make clean
make DOWNLOAD_PORT=[port] flash-erase
make HW_VARIANT=HW_VARIANT_CUSTOM DOWNLOAD_PORT=[port] flash
If the device shows up with the model name "CFG ERROR", you did something wrong.
OTA updates are supported, currently tested only in zigbee2mqtt. New versions will be uploaded to the z2m OTA repository, or you can download them manually from the releases page.
Only standard clusters are used, so it works out-of-the-box in ZHA. z2m converter is pending.
Factory reset: toggle device power quickly 5 times, or hold the button (if enabled) for 5 seconds.
Short button press toggles the light.