doudz/homeassistant-zigate

Can't run OTA updates for TRADFRI devices

Closed this issue ยท 16 comments

benjR commented

Hi,
I have been trying to update my TRADFRI devices with latest firmwares that can be found here: https://fw.ota.homesmart.ikea.net/feed/version_info.json but whenever I try to load a firmware I have a warning like so:

Header size(3684586090) and file size(174150) does not match
00:37 custom_components/zigate/__init__.py (ERROR)
Header size(1177025433) and file size(205190) does not match
00:31 custom_components/zigate/__init__.py (ERROR)

Am I the only one? Is there something I am missing ?
Thanks :)

I just tried with the Ikea Outlet with the firmware download from your file and I have the same error.

doudz commented

According to this fairecasoimeme/ZiGate#86 (comment)
the files need to be converted before, because Ikea doesn't use standard OTA file format

Currently I don't know how the conversion works, so you need deconz to do the job

doudz commented

So conversion looks easy, if I'm right we just have to remove a digital signature, so just the begining and the ending of the file

doudz commented

I just add a small converter, if you want to try it
https://github.com/doudz/zigate/blob/dev/ikea_ota_converter.py

Usage :
python3 ikea_ota_converter.py /home/doudz/otau/ikea_firmware.ota.signed

The file will be converted and save with the same file name

With a quick test I still have the error with the file 10005777-4.1-TRADFRI-control-outlet-2.0.022.ota.ota.signed

Before it was:
Header size(1177025433) and file size(205190) does not match

Now it is:
Header size(797) and file size(204221) does not match

doudz commented

oups, should be ok now

How is the syntax to load a new firmware on a device?
Is this integrated in home assistant or command line only?

doudz commented

The small converter created is just a test file, if it's working good, the code will be included in the zigate lib so it will be transparent for user
For now you have to use command line to convert the file first to make it compatible

The converter is OK now :)
I updated one Outlet successfully.

benjR commented

Nice! Thanks a lot @doudz
Will test this as well, is there any output in the logs to check if version was really updated?

doudz commented

The converter is OK now :)
I updated one Outlet successfully.

Nice, I have included the converter in the next zigate release

doudz commented

@benjR looking in the zigate.json, you should see different application version or datecode for the cluster 0 of the device
you may have to read the attribute manually by calling read_attribute on cluster 0 and attribute 1 or attribute 6

Does IKEA release a changelog of their bulbs? ๐Ÿ˜†

benjR commented

From my readings in the logs, the update has been successfull for my outlet. However can't see any difference while comparing the zigate.json before/after.
Will try on another device.

doudz commented

You should try to call the service zigate.read_attribute on attribute 0x0006 of cluster 0x0000
example :

{
  "entity_id": "zigate.000b57fffe2ae07d",
  "endpoint": 1,
  "cluster": 0,
  "attribute_id": "0x0006"
}

The value is visible on the zigate device entity
image