-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HOWTO: Automated update (proposal) #36
Comments
Very cool! Thanks for sharing. |
Inspired by your proposal I thought quite a bit about automated updates and came up with the following idea: Create a very basic addon called something like "HAOS - Update-Helper for Rock Pi 4" or so.. On every new OS release, update the version of the addon as well and release it (with the same version number as the OS) The addon consists only of a relatively simple shell script which does de following:
Done. So whenever you release an new OS and the addon, all users will get notified that there is a new version availably (of the addon). And whit a simple click on "update" they will in fact get an OS update. The addon description an the release comments should make very clear whats the intent of this addon and what will happen after an update of the addon. This method takes full advantage of the allready existing update checking mechanism and makes it very simple for the user (no ssh into your box, search for the right link, look up the instructions...). |
Sounds like a simple, yet great improvement. In any case: thank you so much for caring about the rock series and Haos! |
Thank you too for your inspiration! The board should be auto-detected. With access to the host system the addon can use the Homeassistant CLI. As a clarification to my previous post: Additionaly the script should check and react accordingly on some edge cases:
I just checked and it seems there is no way to select which version of an addon gets installed. Its allways on latest, unless not updated yet. So a downgrade to an older version of the OS would not work out of the box. If needed, it could be implemented through a config option as well. |
So I got kind of motivated to try that idea out. |
Well, it wasn't as easy as I thought, but finally I have a working addon: https://github.com/honsma235/haos-rockpi_update-helper |
Great initiative! For me it ain't working yet. I receive the following error:
Quick question: |
Well, I didn't test it a lot, but never encountered this error. Did you disable the protection mode of the addon? Regarding the update: |
Indeed, I only forgot to disable the protection mode. Now it is working.Thanks! Am 06.02.2025 10:29 schrieb honsma235 ***@***.***>:
Well, I didn't test it a lot, but never encountered this error. Did you disable the protection mode of the addon?
If the error persists, I will come back to you on how to debug. But I'm busy till beginning of next week.
Regarding the update:
Homeassistant regularly checks for new versions of all it components and addons. So as soon as the addon changes to a new version (which in future should be in sync with releases from haos-rockpi), you will get notified. Just like other updates.
Then you can update the addon and start it once. This will update the OS to the same version as the addon.
The addon just stops after the update and doesn't need to run in the background.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Describe the issue you are experiencing
Hey all,
I wanted to share my way through which I intend to realise updates with the ease of a simple button click.
It is a bit hacky, but maybe someone likes it and wants to try... I am not going into all the details, but rather want to explain the high-level concept.
First, create the following file: /homeassistant/haos_update/haos_update_script.sh with the following content (mind unix formating and line-ending) with the following content:
Next, activate the Scrape addon to scrape this awesome repo of citruz.
![grafik](https://private-user-images.githubusercontent.com/7480315/375089452-c8f03321-0136-43c9-aa7b-3b9386156f13.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTEyMTksIm5iZiI6MTczOTAxMDkxOSwicGF0aCI6Ii83NDgwMzE1LzM3NTA4OTQ1Mi1jOGYwMzMyMS0wMTM2LTQzYzktYWE3Yi0zYjkzODYxNTZmMTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMTAzNTE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDMxY2Q2MzRjOTlkZjM2ZjQyZjYxZmI5MWEyYjZiMzU3NzZjMzg5ZjNlMjU2ODYwYjUzMjM3MDNmM2MyNzUwZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.24AfcCkCxf8jOVnMLtQ5RTN4USrXhNo2eBvIcho7wDA)
The definitions are
RockPi HAOS Available Version:
RockPi HAOS Update Command:
RockPi HAOS URL:
Next, define the following template sensor in configuration.yaml:
This will yield the following entities:
![grafik](https://private-user-images.githubusercontent.com/7480315/375091933-5f91b0b3-3a01-4e96-8b90-d993269f6767.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTEyMTksIm5iZiI6MTczOTAxMDkxOSwicGF0aCI6Ii83NDgwMzE1LzM3NTA5MTkzMy01ZjkxYjBiMy0zYTAxLTRlOTYtOGI5MC1kOTkzMjY5ZjY3NjcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMTAzNTE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzY4MTY1MmMwNjBlZTRmZjdjY2UyNTc1ZDcyOWZlOTlkYjlhMWE2MzhmNWVmNzgxZmI3N2ViZThjMmU3OTNjMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.OuAY8R7Dlz8sf6k3ehpooRWakoC-HiTaYYQRzhgZSkg)
Also, add the following shell commands to configuration.yaml (check out other tutorials on how to generate the private_key or accessing through ssh on port 22222 to get full access to the underlying OS):
Next, create the following automation:
Finally, you can create the following button as part of your dashboard:
So basically, the scrape extension checks this site for new releases. Whenever the released version is greater than the currently installed one, a notification will pop up and the shell script to perform the update will be written/updated.
When pressing the update button, the update script is triggered. Mind that there is no error checking and nothing visually will happen, apart from the CPU load spiking during the update. If you hit the button without an update being available, you will silently update to your current version.
The logical flow is thus to press the update button whenever the automation makes you aware of a new update of citruz. Then you wait for a minute and restart HAOS completely. You should then find the newest version in the info section.
I hope this helps. Feel free to improve the method.
The text was updated successfully, but these errors were encountered: