Custom firmware for Zigbee 3.0 IoT devices on the TLSR825x chip
Custom firmware for Zigbee 3.0 IoT devices on the TLSR825x chip
Supported chipset: TLSR8250, TLSR8251, TLSR8253, TLSR8258, TLSR8359, TLSR8656, Z2.
Based on an example from Telink's Zigbee SDK.
Merging with ZBdevice
Additional alternative firmware options for some devices with TLSR825x can be found at github.com/slacky1965, doctor64/tuyaZigbee
Please direct questions regarding use and configuration in ZHA, Zigbee2MQTT, Home Assistant to the appropriate resources.
New versions check that the configuration written to the device is compatible with the one updated for the new SDK (i.e. compatible with version 0.1.2.5). If it is not compatible, all settings, including bindings, are deleted. In this case, the Zigbee coordinator sees a device with the same IEEE number and a "rebinding" is performed.
Connect:. The browser should open a popup with visible Bluetooth devices. Choose the according target device (i.e. LYWSD03MMC) to pair.Action of the button (or contact "reset" to "gnd" for LYWSD03MMC):
Short press - send temperature, humidity and battery data.
Hold for 2 seconds - Switches temperature between Celsius and Fahrenheit. The change will immediately appear on the screen.
Hold for 7 seconds — reset binding. The screen will display "ooo" (for devices with fast screen refresh, not E-Ink). After restarting, the thermometer will wait forever for registration. Twitching the battery does not change anything.
Hold for 15 seconds - resets bindings and all user settings. The screen will no longer display "ooo" and will display temperature and humidity. After restarting, the thermometer will wait forever for registration. Jerking the battery does not change anything.
After flashing from BLE, the thermometer is already in standby mode for registration in the Zigbee network.
(!) When changing (Zigbee OTA) the firmware version, if there were changes in the FW functionality, re-registration of the device is required (actual for any Zigbee device).
Attr: 0x0005, CHAR_STR (id: 0x42), ModelIdentifer (Device Name): 3..23 Chars.
Attr: 0x0000, ENUM8 (id:0x30). 0 – Celsius, 1- Fahrenheit. Default 0.
Attr: 0x0002, ENUM8 (id:0x30). 0 - Show smiley, 1 - Don't show smiley. Default 0.
Attr: 0x0100, INT16 (id:0x29), Temperature offset, in 0.01° steps, range: -32767 (-327.67°)..32767(+327.67°). Default 0.
Attr: 0x0101, INT16 (id:0x29), Humidity offset, in 0.01% steps, range: -32767 (-327.67%)..32767(+327.67%). Default 0.
Attr: 0x0102, INT16 (id:0x29), Comfort temperature minimum, in 0.01° steps, range -32767..+32767 (-327.67° ..+327.67°). Default 2000 (20.00°C).
Attr: 0x0103, INT16 (id:0x29), Comfort temperature maximum, in 0.01° steps, range -32767..+32767 (-327.67° ..+327.67°). Default 2500 (25.00°C).
Attr: 0x0104, UINT16 (id:0x21), Comfort humidity minimum, in 1% steps, range 0..9999 (0..99.99%). Default 4000 (40.00%).
Attr: 0x0105, UINT16 (id:0x21), Comfort humidity maximum, in 1% steps, range 0..9999 (0..99.99%). Default 6000 (60.00%).
Attr: 0x0106, ENUM8 (id:0x30), Turn off the display. 1 - Display Off. Default 0 - Display On.
Attr: 0x0107, UINT8 (id:0x20), Measurement interval, range: 3..255 seconds. Default 10 seconds.
• Not on all HW variants, turning off the display leads to a significant reduction in consumption. Better results are obtained by increasing the measurement interval.
Power configuration (ClusterID: 0x0001), Battery Voltage (Attr: 0x0020). Min interval 360 sec, Max interval 3600 sec, Tolerance 0.
Power configuration (ClusterID: 0x0001), Battery Percentage Remaining (Attr: 0x0021). Min interval 360 sec, Max interval 3600 sec, Tolerance 0.
Temperature Measurement (ClusterID: 0x0402), Measured Value (Attr: 0x0000). Min interval 30 sec, Max interval 180 sec, Tolerance 10 (0.1°).
Relative Humidity Measurement (ClusterID: 0x0405), Measured Value (Attr: 0x0000). Min interval 30 sec, Max interval 180 sec, Tolerance 50 (0.5%).
Before flashing the firmware, check the compliance of the “Manufacturer Code” and “Image Type” between the OTA file and those issued by the Zigbee device.
Sample: "1141-020a-01233001-Z03MMC.zigbee"
| Manufacturer Code | Image Type | File Version | Stack Version | Name | Ext OTA |
|---|---|---|---|---|---|
| 1141 | 020a | 0123 | 3001 | Z03MMC | zigbee |
| 0x1141 - Telink | 0x02 - TLSR825x, 0x0a - Xiaomi LYWSD03MMC | App release 0.1, App build 2.3 | Zigbee v3.0, Release 0.1 | Z03MMC | OTA |
To restore to BLE, use the Zigbee OTA file with the same number device from: https://github.com/pvvx/ATC_MiThermometer/tree/master/zigbee_ota
Zigbee OTA for 128 KB firmware takes 677 seconds with an average consumption of about 1 mA.
ZHA patch for more precision display of data for all Zigbee devices.
A solid "BT" icon indicates a connection loss or the thermometer is not registered with the Zigbee network.
The flashing "BT" icon is called by the "identify" command.
ZHA: Switch temperature between Celsius and Fahrenheit, Show smiley, Comfort parameters
ZHA: Setting offsets for temperature and humidity, turn off the display, measurement interval
Added project assembly using 'make' (Windows/linux) and the ability to import 'Existing Project' into "Telink IoT Studio".
Default intervals for temperature and humidity reporting are set to 30-180 (min-max) seconds, reportableChanged to 0.1C and 0.5%.
Consumption has been optimized when the coordinator is disconnected or connection is lost. When performing rejoin, if the connection is broken, the thermometer consumes quite a lot. Monitor the work of your network coordinator - Zigbee does not like (almost cannot tolerate) coordinator outages.
Consumption has been optimized when polling the reset button or contact.
Additional adjustments to consumption consumption and correction of the report transmission functions algorithm.
Correspondence of transmitted and displayed measurements (correct rounding).
Reducing firmware size: removing unnecessary code from SDK, reorganization of battery voltage measurement (ADC), ...
Averaging battery level measurements (eliminates clutter on charts)
Switch temperature between Celsius and Fahrenheit
Adding button actions (ver 0.1.1.1)
Added Poll Control Cluster (ver 0.1.1.2)
Ver 0.1.1.4: According to the "ZigBee Cluster Library Specification" the "Thermostat Temperature Conversion" values have been corrected. Added On/Off smiley. (ClusterID: 0x0204 (Thermostat User Interface Configuration), Attr: 0x0000 (TemperatureDisplayMode), ENUM8 = 0 in C, = 1 in F, Attr: 0x0002 (ScheduleProgrammingVisibility), ENUM8 = 0 show smiley On, = 1 show smiley Off)
Ver 0.1.1.5: Description of the HVAC cluster (for ZHA)
Ver 0.1.1.6: Setting offsets for temperature and humidity.
Ver 0.1.1.7: Add Comfort parameters
Ver 0.1.1.8: Easy version. Options disabled: "Groups", "TouchLink", "Find and Bind".
Ver 0.1.1.9: Fix configuration saving error
Ver 0.1.2.0: At the request of @devbis, for differences in z2m, the device names have been renamed. "-z" will be added to the name Zigbee devices, "-bz" will be added to the BLE and Zigbee devices, "-zb" to the Zigbee2BLE devices.
Ver 0.1.2.1: Disabled POLL_CTRL - some programs set a short polling period without taking into account the Zigbee 3.0 specification, which increases consumption. For temperature and humidity offsets, as well as COMFORT parameters, the resolution has been changed to 0.01 units. Added parameters: display off, sensor measurement interval. The ability to change the device name is enabled - works with all programs that support ZigBee 3.0 without rewriting configurations. Down with identifying a device by name in Z2M! Users should be able to change the names of Zigbee devices!
Ver 0.1.2.2: Offset correction for SHTv3 and SHT4x sensors.
Ver 0.1.2.3: Added the ability to change the "manufacturer name". Changing the structure of saving the model and the manufacturer name. Corrected manufacturer name "MiaoMiaoCe" for MHO-C122 and MHO-C401N.
Added firmware for TH03.
Added firmware for LKTMZL02.
Added firmware for MHO-C401(old).
Ver 0.1.2.4. Added firmware for ZY-ZTH02, ZG-227Z. Prevent ZHA from incorrectly setting LongPoll to a short interval contrary to Zigbee 3.0 standards.
Ver 0.1.2.5. Completely reworked version on SDK v3.7.1.2. Merging with ZBdevice. Reduced battery consumption for thermometers with SHTC3 s
No open issues yet, or sync has not completed.