Hello!
This is my sloppely written guide for the time that you want to do OTA manually because for instance in my case I had old firmware on my IKEA Styrbar remote that could not get auto-updated because of how the newer version of firmware reported its version number.
This is written from my setups perspective as I’m not `linux-savvy´ I can’t say that it will work the same for every setup. And in the way I’ve interpreted what I’ve read from various sources so bare with me if I’m off on some terminology.
Also NOTE I’m assuming a certain skill-level when it comes to theese types of edits
Skip the parts you’ve got covered already (for instance SSH access to host)
I’m running Home Assistant OS on Oracle VM.
Step 1: We need access to the Container housing our Home Assistant on our host machine in order to modify a specific file. In order to get this access we need to enable SSH access to our host machine (source1: Debugging the Home Assistant Operating System | Home Assistant Developer Docs)
(source2: operating-system/Documentation/configuration.md at dev · home-assistant/operating-system · GitHub)
- Format a thumb-drive as FAT32/NTFS and label it CONFIG (case-sensitive)
- Insert into PC where our VM is running and pass the thumb-drive through to Home Assistant OS. This is just to test that the VM can pick it up. (One of my usb-drives wasn’t detectable)
- When step 2 is OK unmount drive from VM
- Download and install PuTTy (https://www.putty.org/)
- Follow guide to generate a public/private key
IBM Documentation - Using Notepad++ create a new text document and paste in the contents of the generated public key from PuTTy. Change/convert encoding to ANSI from the top menu options and in the bottom right, third from right, Check that you change “Windows (CR LF)” to “Unix (LF)”. Then save the file as authorized_keys (without extension) in the root of your thumb-drive.
- Save Private key somewhere on your PC, you need this for your SSH Connection later
- Insert thumb-drive to PC with VM, pass thumb-drive to VM and from the Home Assistant CLI type Os Import. After this step is done port 22222 should be open on your machine so you can access Home Assistant cointainer
Step 2: Use PuTTy to SSH into your machine at the newly exposed port 22222 with the previously generated private key. (How to use SSH Keys with PuTTY - IONOS)
Connect with root@VM-IP on port 22222 and enter your private key pass if you created one
Step 3: If successfully connected to host machine the following command should be issued first:
docker exec -it homeassistant /bin/bash
Step 3.1 (only once): write the following command to install suplemon for textediting
pip install suplemon
Step 4: Now we need to edit the init.py file of the zigpy package. By writing the following command you should open the correct file in suplemon editor. (Notice, python versions may change, check with command “python –version” and edit path accordingly)
suplemon /usr/local/lib/python3.10/site-packages/zigpy/ota/__init__.py
Step 5: Navigate inside the __init__.py in Suplemon to find the row below
if ver >= self.version:
This needs to be edited to the code below in order to trigger on any OTA-image that isn’t equal to the currently installed one
if ver == self.version:
Save the file with CTRL+S then close it with CTRL+Q
Step 6 (Optional): If you wish to downgrade for some reason
Step 7 (Optional): Enable logging in order to track that the OTA-image is accepted as well as progress by adding the following lines to your configuration.yaml
logger:
default: info
logs:
homeassistant.components.zha: debug
zigpy: debug
(source: OTA Device Firmware Updates · zigpy/zigpy Wiki · GitHub)
Step 8 : Enable OTA updates by editing configuration.yaml according to the link below
Restart Home assistant!
Step 9: Manually force OTA on selected devices according to the documentation below found, I Did 3-4 devices at a time without issue. This should pull the latest firmware from the cloud
And that’s about it. Good luck!
Old Post: