Please provide feedback. This is based on my other blueprint, just changing the items related to the schedule, so I believe the update mechanism itself is quite well tested, but you know, there are always new ideas or new use cases that we never though about, so let me know your ideas, issues and concerns…
Important notes:
Supervisor update:
The update of HA Supervisor is by default set to auto-update by the system, so it will be updated out of this blueprint anyways (and the time of that update is not controlled by this blueprint). There is a way to disable this auto-update (so the blueprint will be able to manage), but there are some important points to take in account, so I would hardly suggest you read carefully the following discussions about this topic:
All the standard add-ons of Home Assistant support to set “Auto-update” thru the UI. If that is enabled, this blueprint cannot guarantee the time of running the updates for that specific add-on (as it is controlled outside this blueprint).
HACS update:
At this moment (2022-09-10), HACS updates are not released, but it is an experimental feature, so, if you enable HACS to use its experimental features, this blueprint will include HACS updates automatically.
Schedule helper
You will need a schedule helper indicating the time slots where the updates could start.
The updates will be installed one by one, while inside the schedule windows. It’s not guaranteed that the update will finish inside the schedule windows.
Now, if one of the updates forces HA to reboot, the automation will restart after the reboot and will resume the updates of all the remaining items.
Change log:
2022-09-10 06:10 UTC:
First time published (this version based on schedule helpers)
2022-09-17 07:38 UTC:
Error handling - The update process will now handle errors gently and continue to the following actions
2022-12-08 14:26 UTC:
Code clean-up (removed commented code)
Waiting time for backup
Code moved to Github.
This is the Blueprint:
=> The code is now available at Github. Please contribute with your ideas:
[546743126000] Error handling message: while scanning a simple key in "<unicode string>", line 543, column 1: </code></pre> ^ could not find expected ':' in "<unicode string>", line 544, column 1: <p><strong>Roadmap: (no promises ... ^ (unknown_error)
There are some new code compared to the old one, but the core is almost the same, so I believe it will work fine for most people. It’s working fine for me since a few updates.
This thing about scheduler is much better… Gives more flexibility and I can play with more triggers just adding a condition to never run outside that window.
I hope you enjoy this one.
OK thanks for this, but I am still very much a n00B. Is there any chance of a step by step guide to get this up and running? (I’m also the guy who posted one of the original threads to ask for this this feature).
I don’t know how to import a blueprint. Essentially I have a HA instance up and running and configured. But I’ve done nothing with it, because it require frequent maintenance by me, which I just don’t have time to do. This is why I asked this question originally. It’s potentially more relevant now that Google have borked IFTTT integration with Google Home/Nest.
So, let’s start installing the Blueprint then (the process might change a bit depending on your system, but it’s basically following the steps offered to you by Home Assistant):
To start, go back to my first post on this thread and click at that black and blue button saying “Import blueprint”:
On the schedule window, give a name for your helper and select the times for update. I suggest to do this over Voight and to allow a few hours for each window (to accommodate backup and an eventual restart if needed). Then click “Save”.
Then fill the mandatory inputs and hit save. You can leave everything that is “(optional)” for when you get more experience with Home Assistant. I highly recommend you to enable the options for backup and restart, then select the scheduler helper you created and the earlier day in a month to run the update. Maybe you should select something between 10 and 15 days to avoid all the newly released (and sometimes a bit buggy) updates on the beginning of each month.
Hi, HAOS is not updated, CoreState.FREEZE error, only backup is done.
Logger: homeassistant.components.automation.home_assistant_auto_update_on_a_schedule_base_4_00_5_00
Source: helpers/script.py:405
Integration: Автоматизация (documentation, issues)
First occurred: 05:00:10 (2 occurrences)
Last logged: 05:00:10
Home Assistant Auto-update on a schedule base: Repeat at step 9: Error executing script. Error for call_service at pos 4: Error updating Home Assistant Operating System: ‘OSManager.update’ blocked from execution, system is not running - CoreState.FREEZE
Home Assistant Auto-update on a schedule base: Error executing script. Error for repeat at pos 9: Error updating Home Assistant Operating System: ‘OSManager.update’ blocked from execution, system is not running - CoreState.FREEZE
Thanks for sharing the error log.
Do you still haven’t updated or have you done that manually?
If you still on the old version I’d like to ask you to, before you update, to run the following under Developer Tools > Template and please let me know the results:
{% for u in integration_entities('hassio') | select('search', '^update[.]')
if (device_attr(u, 'identifiers') | first)[1] == 'OS' %}
{{ u }}
{% endfor %}
and:
{{ states.update | selectattr('state','eq','on') | map(attribute='entity_id') | list }}
I’ve updated the Blurprint in order to handle errors nicely.
I couldn’t test on my environment as I’m already updated, so I would appreciate if you can use this new Blueprint and provide your feedback.
{% for u in integration_entities(‘hassio’) | select(‘search’, ‘^update[.]’)
if (device_attr(u, ‘identifiers’) | first)[1] == ‘OS’ %}
{{ u }}
{% endfor %}
Hi, tonight updated 2 addons, HAOS is not updated - CoreState.FREEZE error, backup is done.
Auto-update Done! triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
06:02:44 - 2 hours ago
Auto-update Running post-update actions... triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
06:02:44 - 2 hours ago
Auto-update Restart variables: input_restart_bool: True, restart_count: 0, restart_entities: [] triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
06:02:44 - 2 hours ago
Auto-update Remaining updates: - Home Assistant Operating System Update triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
06:02:44 - 2 hours ago
Auto-update Finishing update process. triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
06:02:44 - 2 hours ago
Auto-update Updating Home Assistant Operating System Update of ['update.home_assistant_operating_system_update'] ... triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:02:44 - 3 hours ago
Auto-update Starting sequence of OS update... triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:02:44 - 3 hours ago
Auto-update Updating Studio Code Server Update of ['update.studio_code_server_update'] ... triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:01:21 - 3 hours ago
Auto-update Starting sequence of standard updates... triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:01:21 - 3 hours ago
Auto-update Updating Portainer Update of ['update.portainer_update', 'update.studio_code_server_update'] ... triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:00:10 - 3 hours ago
Auto-update Starting sequence of standard updates... triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:00:10 - 3 hours ago
Auto-update Backup triggered. triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:00:10 - 3 hours ago
Auto-update Backing up Home Assistant. triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:00:00 - 3 hours ago
Auto-update Running pre-update actions... triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:00:00 - 3 hours ago
Auto-update List of updates: - Home Assistant Operating System Update - Portainer Update - Studio Code Server Update triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:00:00 - 3 hours ago
Auto-update A new update is available for Home Assistant. triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:00:00 - 3 hours ago
Auto-update Variables: input_backup_bool: True, input_restart_bool: True, input_min_update_age: 0, input_schedule_monthday: 1, input_update_exclusions: False, input_update_exclusions_processed: [ ], updates_list: ['update.home_assistant_operating_system_update', 'update.portainer_update', 'update.studio_code_server_update'] triggered by automation Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:00:00 - 3 hours ago
Home Assistant Auto-update on a schedule base triggered by state of Расписание HA Update
05:00:00 - 3 hours ago - Tracese or paste code here
Logger: homeassistant.components.automation.home_assistant_auto_update_on_a_schedule_base
Source: helpers/script.py:405
Integration: Automation (documentation, issues)
First occurred: 05:02:44 (1 occurrences)
Last logged: 05:02:44
Home Assistant Auto-update on a schedule base: Update - OS: Error executing script. Error for call_service at pos 4: Error updating Home Assistant Operating System: 'OSManager.update' blocked from execution, system is not running - CoreState.FREEZE
I’ve tried to implement a way to don’t update until the update is available for a minimum time, however, as both last_update and last_change are both reset after a reboot, I don’t have any reference to use.
I have to find some time to implement something based on minor vs major versions, which will probably work even better.
Since we can now use the update. domain to update firmware and MANY of us use HA hosted in docker, it would be great if you would consider offering an option in the blueprint to ONLY update the NON HomeAssistant Core components. Or put a better way for the UI, “SKIP update of Home Assistant CORE”.
I suspect I could easily hack up the YAML from your blueprint for my personal use but seeing as you referenced this Blueprint in the Shelly thread (and I had considered using it to replace my old firmware automation script). In the end was simpler for me to revise the 14 automations I had but as mentioned might help others, and will likely consider it when/if other integration start to make use of the update domain for firmware updates (I’m talking about you LIFX!)
I’ll link to this comment in the Shelly thread where you mentioned.