I don't understand Zigbee OTA, can someone help?

This weekend I created a flatcar VM to run openhab in a docker. Added a zigbee USB stick and once that was running (it took a bit more time than “once” :wink: ) I added to things to my brand new openhab:

  • Ember Coordinator
  • Ikea Inspelning

This seems to work fine, although the ikea plug is providing the wrong information, for which a firmware update to inspelning exists.

I have read Zigbee binding documentation, focusing on the part where it says: # # Device Firmware Updates (there is a typo in the markdown # # should be ##)

If I understand that part of the documentation correctly then firmware updates are done automatically by request of a ZigBee device. And as the request interval is a given of the ZigBee device, I don’t need to do anything but to patiently wait for an update to happen.
Correct :question:

When I run Zigbee commands in the console, I get:

openhab> zigbee otaupgrade
Address    Ieee Address      State     
E02A/1     94EC32FFFE0049A5  OTA_UNINITIALISED

But I can’t find any documentation on that, what does OTA_UNINITIALISED mean :question:

I have also read these forum post:

I also had a look at the github that is mentioned in the documentation: Koenkk OTA, the README of that github says: have a look at the index.json. It shows me there is an update for the device I am looking at:

{
    "fileName": "inspelning-smart-plug-soc_release_prod_v33816645_02579ff4-6fec-42f6-8957-4048def87def.ota",
    "fileVersion": 33816645,
    "fileSize": 294530,
    "url": "https://github.com/Koenkk/zigbee-OTA/raw/master/images/IKEA/inspelning-smart-plug-soc_release_prod_v33816645_02579ff4-6fec-42f6-8957-4048def87def.ota",
    "imageType": 40766,
    "manufacturerCode": 4476,
    "sha512": "76f16f4c2ca48a2b6a66693c3a2d4f85d2f52ff440cc09a565b5856d46a872435b28c5a9b6746d50cb2425555db9bdf41ae05e1a17b0292095198af53552e5eb",
    "otaHeaderString": "GBL inspelning_smart_plug_soc\u0000\u0000\u0000"
  },

Using the file above could I also " force" an update :question:
What would be the steps to do so :question:
(Openhab files in the docker are linked to local /opt/openhab)

1 Like

had a look in my userdata folder and saw this:

/opt/openhab/userdata/zigbee/firmware/github.com/Koenkk/zigbee-OTA/raw/master/images/Hue $ ls -al
total 272
drwxr-xr-x. 2 core core   4096 Jan 19 14:29 .
drwxr-xr-x. 4 core core   4096 Jan 20 22:11 ..
-rw-r--r--. 1 core core 267452 Jan 20 17:50 100B-010C-01001A02-ConfLight-Lamps_0012.zigbee

So I created a folder with the same"naming convention" and added the file mentioned in my first post:

/opt/openhab/userdata/zigbee/firmware/github.com/Koenkk/zigbee-OTA/raw/master/images/IKEA $ wget https://github.com/Koenkk/zigbee-OTA/raw/master/images/IKEA/inspelning-smart-plug-soc_release_prod_v33816645_02579ff4-6fec-42f6-8957-4048
def87def.ota

And then used openhab console in docker:

$ docker exec -it openhab-server /openhab/runtime/bin/client
......
openhab> zigbee otaupgrade start 57386/1 zigbee/firmware/github.com/Koenkk/zigbee-OTA/raw/master/images/IKEA/inspelning-smart-plug-soc_release_prod_v33816645_02579ff4-6fec-42f6-8957-4048def87def.ota
OTA File "zigbee/firmware/github.com/Koenkk/zigbee-OTA/raw/master/images/IKEA/inspelning-smart-plug-soc_release_prod_v33816645_02579ff4-6fec-42f6-8957-4048def87def.ota" set for node E02A/1
OTA File: ZigBeeOtaFile [headerVersion=256, headerLength=56, manufacturerCode=4476, imageType=9F3E, fileVersion=02040045, stackVersion=ZIGBEE_PRO, headerString=GBL inspelning_smart_plug_soc, imageSize=294530]

openhab> zigbee otaupgrade state 57386
OTA Upgrade configuration for E02A/1
Current state    : OTA_TRANSFER_IN_PROGRESS
Firmware Version : 02040034

...long wait...

openhab> zigbee otaupgrade state 57386                                                                        
OTA Upgrade configuration for E02A/1
Current state    : OTA_UPGRADE_COMPLETE
Firmware Version : 02040045

So I was able to do an update. But still would like to know:
Is this how it is supposed to work :question:
Or will it actually automagically be able to do do an update without user interference :question:

In principle it should download the files automatically from the web, and update them. Note though that this can take days since most devices will only make a request once per day, and the way the system works it will take a couple of requests.

1 Like

Hi @chris,

so I guess it it is not updating automatically at least I did not recognize something here. (And Maybe we should switch this off by default and ask the user in case he wants to update.

Okay and now my personal issues:

The question is simple to avoid you need to read the next:
How do i know which file belongs to which device?

I can see this files in the firmware folder:

frsc@raspi://opt/openhab3/data/openhab/userdata/zigbee/firmware $ find . -type f
./raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/Aurora/MainsPowerOutlet_JN5169_PCB_ARC_OTA_0x1409_v22.ota
./github.com/Koenkk/zigbee-OTA/raw/master/images/Hue/100B-010C-01001A02-ConfLight-Lamps_0012.zigbee

And i see this:

Here it is what i can see in the console:

openhab> zigbee otaupgrade
Address    Ieee Address      State
5869/1     A4C138F96D1BA59C  OTA_UNINITIALISED
2BA0/2     001788010969320F  OTA_UNINITIALISED
9CC2/11    00178801042F514E  OTA_UNINITIALISED

And I can do things like this in the console:

zigbee otaupgrade start 57386/1 zigbee/firmware/github.com/Koenkk/zigbee-OTA/raw/master/images/HUE/XYZ.ota

How do i know which file belongs to which device?

And then my next question:
I’ve seen there is a newer file available, is the OTA Update server looking to an online file or is there a offline copy if the index.json file?

  {
    "fileName": "100B-010C-01001A02-ConfLight-Lamps_0012.zigbee",
    "fileVersion": 16783874,
    "fileSize": 267452,
    "url": "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/Hue/100B-010C-01001A02-ConfLight-Lamps_0012.zigbee",
    "imageType": 268,
    "manufacturerCode": 4107,
    "sha512": "c4591fe155bef8500779c36c7792f3960c4f83dde9dd47aa367113229c5bd73161f14cc92e6d6a0960e807c54626ce2ab0ce0d18c76d0206770dcda3a4776862",
    "otaHeaderString": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
    "originalUrl": "https://otau.meethue.com/storage/ZGB_100B_010C/2ef158a5-ffb4-43ac-9d59-3cb71078f6f7/100B-010C-01001A02-ConfLight-Lamps_0012.zigbee",
    "maxFileVersion": 16783873
  },
  {
    "fileName": "100B-010C-01002800-ConfLight-Lamps_0012.zigbee",
    "fileVersion": 16787456,
    "fileSize": 266684,
    "url": "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/Hue/100B-010C-01002800-ConfLight-Lamps_0012.zigbee",
    "imageType": 268,
    "manufacturerCode": 4107,
    "sha512": "30c754504fed42ce12b4243fbf70a8207675f02cba1efbe2e454270049b472e400578c316602978deadb39166b196cb21aaf0f5cbb527fd2491fd78d4a14b620",
    "otaHeaderString": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
    "originalUrl": "https://otau.meethue.com/storage/ZGB_100B_010C/9ee7aed8-faed-43eb-b7f7-712a5b578dba/100B-010C-01002800-ConfLight-Lamps_0012.zigbee",
    "minFileVersion": 16783874
  },

and finally i tried to update a hue panel with this:

Usage: openhab:zigbee - otaupgrade [STATE | FILE | START | COMPLETE | CANCEL] [ENDPOINT] [FILENAME] - Provides detailed information about device over the air upgrade server status.
openhab> zigbee otaupgrade start 53068/11 frsc/100B-010E-01002600-ConfLight-ModuLum_0012.zigbee
OTA File "frsc/100B-010E-01002600-ConfLight-ModuLum_0012.zigbee" set for node CF4C/11
OTA File: ZigBeeOtaFile [headerVersion=256, headerLength=56, manufacturerCode=4107, imageType=010E, fileVersion=01002600, stackVersion=ZIGBEE_PRO, headerString=, imageSize=269002]

If i do then check fi completion i get the Error:

Exception during command execution (IllegalArgumentException): Node 53068 does not implement the OTA Upgrade server

openhab> zigbee otaupgrade state 53068
Error: Exception during command execution (IllegalArgumentException): Node 53068 does not implement the OTA Upgrade server
openhab> zigbee otaupgrade COMPLETE 53068/11
OTA Upgrade completion on endpoint CF4C/11 returned false

Is it upgradeing or not?

openhab> zigbee otaupgrade
Address    Ieee Address      State
5869/1     A4C138F96D1BA59C  OTA_UNINITIALISED
2BA0/2     001788010969320F  OTA_UNINITIALISED
9CC2/11    00178801042F514E  OTA_UNINITIALISED

I’ve also tried the firmware command as the documentation says

UI doesn’t support the firmware management system, so this must be performed using the console

but did not succeed

openhab> firmware list zigbee:device:62ec522f14:0017880103342a12
No firmwares found for thing with UID zigbee:device:62ec522f14:0017880103342a12

With that said thank you Chris for your efforts and fixes.

/Franz

By default it should not be automatic - it requires the user to decide if they want to update.

However the problem (or part of the problem) is that the UI currently doesn’t provide this functionality.

https://github.com/openhab/openhab-webui/issues/1427

I started to add this a few weeks ago -:

https://github.com/openhab/openhab-webui/pull/3158

I have more changes mostly done to support this further - both in the UI and also in the zigbee binding. I’ve mostly tested out the changes, but the device I had with me when I was implementing this already had the latest firmware so next time I test I need to take a device with old firmware :slight_smile: .

Unfortunately I’m doing quite a bit of travelling at the moment so am away from home a lot. Most of this I did while I was out in the UK a couple of weeks back - now that I’m home my partner wants me to do other things :slight_smile: . I hope to take another look at this in a couple of weeks and get it into a PR to hopefully support this better.

Hi @chris,

I hope you’ve had a great summer (or winter, depending on where you’ve been!) and that your travels went smoothly. I hope you’re settling back in well.

I’ve recently upgraded to OHN 5.1, but I’m still a bit stuck on how to perform device upgrades. I have several ‘tuya_plug_ts011f’ smart plugs that I’d like to update.

I found that there is custom firmware available for them, and I tried using the OTAUPGRADE command, but I haven’t had any luck so far. Do you have any insight into what I might be doing wrong or if there’s a specific step I missed?

Thanks for the help!

        U    2577 r-- UNSIGNED_16_BIT_INTEGER   Average RMS Voltage Measurement Period Phase C  
        U    2578 r-- UNSIGNED_16_BIT_INTEGER   Average RMS Over Voltage Counter Phase C  
        U    2579 r-- UNSIGNED_16_BIT_INTEGER   Average RMS Under Voltage Counter Phase C  
        U    2580 r-- UNSIGNED_16_BIT_INTEGER   RMS Extreme Over Voltage Period Phase C   
        U    2581 r-- UNSIGNED_16_BIT_INTEGER   RMS Extreme Under Voltage Period Phase C  
        U    2582 r-- UNSIGNED_16_BIT_INTEGER   RMS Voltage Sag Period Phase C            
        U    2583 r-- UNSIGNED_16_BIT_INTEGER   RMS Voltage Swell Period Phase C          
        S   65533 r-- UNSIGNED_16_BIT_INTEGER   Cluster Revision                          
        U   65534 r-- ENUMERATION_16_BIT        Attribute Reporting Status                
   E000 
     - APS Security disabled
   E001 
     - APS Security disabled
Output Clusters   : (Client)
   000A Time
     - APS Security disabled
        S   65533 r-- UNSIGNED_16_BIT_INTEGER   Cluster Revision                          
        S   65534 r-- ENUMERATION_16_BIT        Attribute Reporting Status                
   0019 Ota Upgrade
     - APS Security disabled
        S       0 r-- IEEE_ADDRESS              Upgrade Server ID                         
        S       1 r-- UNSIGNED_32_BIT_INTEGER   File Offset                               
        S       2 r-- UNSIGNED_32_BIT_INTEGER   Current File Version                     Sat Jun 21 09:53:52 CEST 2025 74
        S       3 r-- UNSIGNED_16_BIT_INTEGER   Current ZigBee Stack Version              
        S       4 r-- UNSIGNED_32_BIT_INTEGER   Downloaded File Version                   
        S       5 r-- UNSIGNED_16_BIT_INTEGER   Downloaded ZigBee Stack Version           
        S       6 r-- ENUMERATION_8_BIT         Image Upgrade Status                      
        S       7 r-- UNSIGNED_16_BIT_INTEGER   Manufacturer ID                           
        S       8 r-- UNSIGNED_16_BIT_INTEGER   Image Type ID                             
        S       9 r-- UNSIGNED_16_BIT_INTEGER   Minimum Block Request Period              
        S      10 r-- UNSIGNED_32_BIT_INTEGER   Image Stamp                               
        S   65533 r-- UNSIGNED_16_BIT_INTEGER   Cluster Revision                          
        S   65534 r-- ENUMERATION_16_BIT        Attribute Reporting Status                


openhab> zigbee otaupgrade start 29420/1 zigbee/firmware/1141-d3a3-1111114b-tuya_plug_ts011f_zrd.zigbee
OTA File "zigbee/firmware/1141-d3a3-1111114b-tuya_plug_ts011f_zrd.zigbee" set for node 72EC/1
OTA File: ZigBeeOtaFile [headerVersion=256, headerLength=56, manufacturerCode=4417, imageType=D3A3, fileVersion=1111114B, stackVersion=ZIGBEE_PRO, headerString=Slacky-DIY OTA, imageSize=207522]

openhab> zigbee otaupgrade status 29420/1 zigbee/firmware/1141-d3a3-1111114b-tuya_plug_ts011f_zrd.zigbee         
Error: Exception during command execution (IllegalArgumentException): Invalid command argument status
openhab> zigbee otaupgrade state 29420/1 zigbee/firmware/1141-d3a3-1111114b-tuya_plug_ts011f_zrd.zigbee         
Error: Exception during command execution (IllegalArgumentException): Node '29420/1' is not found.
openhab> zigbee otaupgrade state 29420 zigbee/firmware/1141-d3a3-1111114b-tuya_plug_ts011f_zrd.zigbee     
Error: Exception during command execution (IllegalArgumentException): Node 29420 does not implement the OTA Upgrade server
openhab>
openhab> zigbee otaupgrade status 29420/1 zigbee/firmware/1141-d3a3-1111114b-tuya_plug_ts011f_zrd.zigbee         
Error: Exception during command execution (IllegalArgumentException): Invalid command argument status
openhab> zigbee otaupgrade state 29420/1 zigbee/firmware/1141-d3a3-1111114b-tuya_plug_ts011f_zrd.zigbee         
Error: Exception during command execution (IllegalArgumentException): Node '29420/1' is not found.
openhab> zigbee otaupgrade state 29420 zigbee/firmware/1141-d3a3-1111114b-tuya_plug_ts011f_zrd.zigbee     
Error: Exception during command execution (IllegalArgumentException): Node 29420 does not implement the OTA Upgrade server
openhab>