ZHA custom ota files no longer work

Hi,
Since the 2024.1 version I’ve got issues when trying to update any zigbee device with an external OTA file. I have Aqara P1 motion sensors for example, I have updated them to version 10 in the past but now ZHA does not recognize any of my OTA files when I try to update new units.

It doesn’t work for any of my devices but I will focus on the P1 here (as I am sure it worked for these devices before):
The device is identified as lumi.motion.ac02.
I took the OTA file from the link I get here: zigbee-OTA/index.json at 72ff5e8b4096f62a9b5e2d550dd0a4b88317bf14 · Koenkk/zigbee-OTA · GitHub, so it is: https://github.com/Koenkk/zigbee-OTA/raw/master/images/Lumi/20230130180718_OTA_lumi.motion.ac02_0.0.0_0010_20230104_390E3D.ota

Aqara P1’s OTA request looks like this:
OTA query_next_image handler for 'LUMI lumi.motion.ac02': field_control=0, manufacturer_id=4447, image_type=11528, current_file_version=5, hardware_version=None, model='lumi.motion.ac02'

So we see manufacturer id 4447, image type 11528 and current file version 5.
Now the data extracted from the ota file by zigpy-cli says:

        "file_version": 10,
        "image_type": 11528,
        "manufacturer_id": 4447,

So everything should match right? But in the end in the log I see:
No OTA image is available

I put the OTA file in directory: /config/zha/ota
My configuration.yaml for the zha looks like this:

zha:
  custom_quirks_path: /config/zha/custom_zha_quirks
  zigpy_config:
    ota:
      otau_directory: /config/zha/ota

Does anybody else see this? Am I doing something wrong? Is it possible to see which OTA files ZHA loads during startup? Oh I have also tried restarting the whole host os after uploading OTA files.

Ok so if anyone is wondering what the hell happened here’s the answer: Use new zigpy OTA providers for ZHA by puddly · Pull Request #111159 · home-assistant/core · GitHub. Basically this feature was disabled and I guess they “forgot” to put in the breaking changes. It will come back eventually but for the time being it can be turned back on by doing this:

zigpy_config:
  ota:
    allow_file_providers: "I understand I can *destroy* my devices by enabling OTA updates from files. Some OTA updates can be mistakenly applied to the wrong device, breaking it. I am consciously using this at my own risk."
    otau_directory: /config/zha/ota
1 Like

Nice catch, thanks for it!

With a small addition. The proper, and working temporary config is:

    allow_advanced_ota_dir: 'I understand I can *destroy* my devices by enabling OTA
        updates from files. Some OTA updates can be mistakenly applied to the
        wrong device, breaking it. I am consciously using this at my own risk.'
    advanced_ota_dir: '/path/to/ota/files' # Like `/config/zha_ota/`

For me it seems worked for one Philips lamp some minutes ago…