Hi all,
I had a problem with my Aliexpress Tuya TS011F / TZ3000 Zigbee plug that it randomly turned off.
Spending some time in Google found people suggesting that a firmware update solved it for them.
This guide should work for any OTA update available and not only for this specific plug
Since I don’t have a Tuya Zigbee Hub I had to update the firmware with ZHA, which involves a few steps and wasn’t obvious for me. This post aims to explain step by step how to update the plug’s firmware.
Step 1: Configure ZHA OTA updates
Followed this guide to get it working.
- Create a
zigpy_ota
folder inside yourconfig
folder - Add this to your
configuration.yaml
:zha: zigpy_config: ota: otau_directory: /config/zigpy_ota ikea_provider: true ledvance_provider: true
- (Optional but useful) Add this for logging purposes to
configuration.yaml
:logger: default: info logs: homeassistant.components.zha: debug zigpy: debug
Step 2: Check current firmware version
Get into the device page (Settings > Devices & Services > Devices tab and click on the device) and open Manage zigbee device
:
Now select the Ota
Cluster and in the Attribute dropdown select downloaded_file_version
and click Read Attribute
:
This represents the firmware version. Just note the Value to know if the upgrade was successful. Mine is already updated so it may be different.
If you have an IKEA or Ledvance device, skip Step 3.
This is because ZHA is automatically downloading firmwares for these two vendors. But we have to manually do it for others.
All available firmware updates can be found here: https://github.com/Koenkk/zigbee-OTA/blob/c29406257053fb5378723101535a16e278fc3ebc/index.json
Step 3: Download the firmware
Get into the ota directory and download the firmware:
cd /config/zigpy_ota
wget https://images.tuyaeu.com/smart/firmware/upgrade/20220907/1662545193-oem_zg_tl8258_plug_OTA_3.0.0.bin
Step 4: Restart and check logs
Restart HomeAssistant and if you enabled logging, you can run this command in your config
directory to check if it is in fact updating:
tail -f home-assistant.log | egrep 'zigpy.ota|zigpy.util|zigpy.*OTA'
If the update is detected and sent to the device you should see something like;
2022-11-14 16:55:08.460 INFO (MainThread) [zigpy.ota.provider] Trådfri: OTA provider enabled
2022-11-14 16:55:08.466 INFO (MainThread) [zigpy.ota.provider] Ledvance: OTA provider enabled
...
2022-11-14 16:56:12.562 DEBUG (MainThread) [zigpy.zcl] [0xA81A:1:0x0019] OTA query_next_image handler for '_TZ3000_typdpbpg TS011F': field_control=FieldControl.0, manufacturer_id=4417, image_type=54179, current_file_version=74, hardware_version=None, model='TS011F'
2022-11-14 16:56:12.605 DEBUG (MainThread) [zigpy.zcl] [0xA81A:1:0x0019] OTA image version: 192, size: 307682. Update needed: True
2022-11-14 16:56:21.744 DEBUG (MainThread) [zigpy.util] Duplicate 146 TSN
This means that it found the new firmware and it is updating it. Wait for some time (I can’t tell how much) and go back to the Device page and repeat Step 2 to check if the version if different. If it is then it worked!
If it didn’t keep reading.
Step 4: Update didn’t work on restart
You can manually trigger an update and it’s easy.
First find the device IEEE
by going into the Device page and copying the value that is just in the dropdown view below the Device Info
Go to the Developer Tools
, open the Services
tab and click the GO TO YAML MODE
button.
Then paste this replacing <device_ieee> with the Device IEEE you just copied and click on the Call Service
button.
service: zha.issue_zigbee_cluster_command
data:
ieee: <device_ieee>
endpoint_id: 1
cluster_type: out
command_type: client
cluster_id: 25
command: 0
args:
- 0
- 100
You can check the logs as in Step 4 and see if the firmware is detected and the updated fired.
My Device Logbook now reports Attribute Update
every few minutes, preventing I guess to going off:
Hope this helps someone that has the same problems I have and clarifies this situation.
Probably this will be updated and an UI functionality would be added to do this like it already exists in Zigbee2MQTT or ZWaveJS. In the meantime this looks like the only solution.