edwardtfn / ha_auto_update_scheduled

A Home Assistant blueprint to assist keeping the system automatically updated with the latest version of it's components
2 stars 2 forks source link

Home Assistant - Auto update (scheduled)

What is this?

A Home Assistant blueprint to assist keeping the system automatically updated with the latest version of it's multiple components.

I’ve created a new version of my previous Auto-update Home Assistant blueprint , but now based in the new schedule helpers and other improvements. I’m using this blueprint myself.

I understand Home Assistant wasn't considered a stable system for years,

I still think you should understand the benefits and risks of auto-updating, so I keep suggesting you to take a look on those discussions:

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… :relaxed:

Important notes

Supervisor update

The update of HA Supervisor is always 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). Please take a look into the following discussions around this:

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. 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 while in the schedule windows.

Installing

Import blueprint tools in Home Assistant (easier)

Just click in the following button and follow it's steps:

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Manual

  1. Open Home Assistant interface

  2. Using the File editor (or Studio Code Server), navigate to the /config/blueprints/automation, right click and then click on New Folder...: image

  3. Type a name for your new folder

  4. Right click your new created folder and select New file..., then name your file (make sure to end with .yaml). image

  5. Go to the edit window and past the content of this blueprint.

  6. Go to Developer tools and select the tab YAML.

  7. Click on Automations and wait until it is reloaded. image

Creating the new automation

  1. Go to Settings and Automations & Scenes
  2. Click on + Create automation button (bottom-right)
  3. Click on the Use a blueprint box to open the list of blueprints: image
  4. Select the new blueprint from the list

image

  1. Enter the inputs and hit Save (See Setting up)

Setting up

The following inputs are supported by this blueprint:

Create a full backup before start the updates?

Select it if you want to trigger an additional backup before starting the updates.

Force Home Assistant host to restart if required by any update? *Required

This won't affect updates where a restart is automatic, but for updates requiring a manual restart (quite common on HACS) this blueprint can automatically force a restart by the end of the updates.

Schedule entity *Required

You can create an Schedule under Settings > Devices & Services > Helpers.

Earliest day in the month to update Home Assistant *Required

Usually a new major version of Home Assistant is available on the begining of every month. Some people consider those release as not stable enough and prefer to avoid those versions, not updating the system until the mid of the month (day 15).

Pre-update actions *Optional

Actions to execute before the backup or any update starts. You can use this to send notifications, turn on/off devices or activate scenes before starting the updates.

Post-update actions *Optional

Actions to execute AFTER the update process finishes. You can use this to send notifications, turn on/off devices or activate scenes after applying the updates.

Pause update entities *Optional

You can select one or more entities to pause the updates. If any of the selected entities is "On" or "True" the system won't be updated on the schedule time. You can use this to hold your updates when you have a party at home, or when you are on vacations and don't want to be concerned about updates on Home Assistant.

image

Changes log

Please take a look on the log of commits.