I run Home Assistant via a Container installation in Docker, and update this using the shell_command integration from a script.
With the introduction of update entities in Home Assistant 2022.4, I wanted to see if I could integrate this and so I have created Custom Update Entities
You can use this to create as many update entities as you want, based on two sensors (for the latest and installed version) and an action in script syntax.
Here is the configration I am actually using on my system for Home Assistant updates:
custom_update_entities:
updaters:
- name: Home Assistant Core
latest_version_entity: sensor.latest_beta_version
installed_version_entity: sensor.current_version
logo_url: https://brands.home-assistant.io/_/homeassistant/icon.png
update_action:
- service: shell_command.update_hass
data:
version: '{{ version }}'
- delay: '00:00:10'
- service: homeassistant.update_entity
target:
entity_id: binary_sensor.hass_update_completed
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.hass_update_completed
to: 'on'
(The wait_for_trigger is used there because the update command runs in the background, so the script relies on a sensor to check if the update has completed and it’s about to restart.)
You can install this manually or by addit it to HACS as a custom repository (although I may see if I can get it in the official repositories).