Scheduled auto-update for Home Assistant

My apologies for the late reply here.

It could be that the automation started running while the schedule is on, but for some reason it takes too long to complete, to the point the schedule becomes off and this is a protection in the automation to prevents itself from run outside the time slot.
So we should understand why is the automation taking longer on this environment…

Can you see any error message related to updates (or this automation) on the Home Assistant logs (Settings > System > Logs)?

Hi @EdwardTFN

There’s nothing in the logs.

The updating should not take that long. I have already disabled the backup function, to see if it was hanging in a backup job. That did not help.

So, your recommendation would be to try and set the schedule to a longer time period? Say, 4-5 hours to be on the safe side?

It shouldn’t need all this time. Mine is set to 2h, but it rarely takes more than a few minutes.
Can you see which update entity is triggering the automation? Maybe that could help with the troubleshooting.

Hi @EdwardTFN

It’ still does not work. I’ve even tried to extend the schedule helper to a whole day.

It runs as it should though - but it doesn’t update anything, and the trace timeline and automation log is empty, so it’s hard to get clues.

Blueprint config

id: '1708087521465'
alias: Auto Update Home Assistant
description: ''
use_blueprint:
  path: edwardtfn/auto_update_scheduled.yaml
  input:
    schedule_entity: schedule.auto_update_schedule
    restart_bool: true
    backup_bool: false
    schedule_monthday: 6
    pause_entities:
      - input_boolean.auto_update_pause

The schedule helper triggered the automation, both when it turned on and when it turned off.
If you have somewhere, where I can look for further clues let me know :slight_smile:

I have the issue with at least two instances. Other instances does not seem to be affected.

A part from that the blueprint is solid.

Can you see anything related to this in the Logbook?

Hi @EdwardTFN , may I ask how long the script usually takes to update the system? I tried triggering script where there are two updates available (Home Assistant Core 2024.3.1 and Home Assistant Operating System 12.1), but the script finished instantly, and no change seems to be done to the system. Could you please help me figure out if anything is going wrong? Thank you!
Here are the logs:

Auto-update Done! triggered by automation Home Assistant Auto-update triggered
16:39:44 - 7 minutes ago
Auto-update Running post-update actions... triggered by automation Home Assistant Auto-update triggered
16:39:44 - 7 minutes ago
Auto-update 0 item(s) pending a restart: - triggered by automation Home Assistant Auto-update triggered
16:39:44 - 7 minutes ago
Auto-update Remaining updates: - Home Assistant Core Update - Home Assistant Operating System Update triggered by automation Home Assistant Auto-update triggered
16:39:44 - 7 minutes ago
Auto-update Finishing update process. triggered by automation Home Assistant Auto-update triggered
16:39:44 - 7 minutes ago
Auto-update Variables: input_backup_bool: False, input_restart_bool: True, input_verbose_logging_bool: True, input_max_backup_age_seconds: 0.0, input_schedule_monthday: 1, input_update_exclusions: [[], []], input_core_os_update_mode: all, input_firmware_update_mode: all, input_general_update_mode: all, core_update_entity: update.home_assistant_core_update, os_update_entity: update.home_assistant_operating_system_update, supervisor_update_entity: update.home_assistant_supervisor_update, firmware_update_entities: [], general_update_entities; ['update.matter_server_update', 'update.nginx_proxy_manager_update', 'update.studio_code_server_update', 'update.silicon_labs_multiprotocol_update', 'update.onedrive_backup_update', 'update.network_ups_tools_update'], updates_list: ['update.home_assistant_core_update', 'update.home_assistant_operating_system_update'] triggered by automation Home Assistant Auto-update triggered
16:39:44 - 7 minutes ago
Auto-update Variables: input_backup_bool: False, input_restart_bool: True, input_verbose_logging_bool: True, input_max_backup_age_seconds: 0.0, input_schedule_monthday: 1, input_update_exclusions: [[], []], input_core_os_update_mode: all, input_firmware_update_mode: all, input_general_update_mode: all, core_update_entity: update.home_assistant_core_update, os_update_entity: update.home_assistant_operating_system_update, supervisor_update_entity: update.home_assistant_supervisor_update, firmware_update_entities: [], general_update_entities; ['update.matter_server_update', 'update.nginx_proxy_manager_update', 'update.studio_code_server_update', 'update.silicon_labs_multiprotocol_update', 'update.onedrive_backup_update', 'update.network_ups_tools_update'], updates_list: ['update.home_assistant_core_update', 'update.home_assistant_operating_system_update'] triggered by automation Home Assistant Auto-update triggered
16:39:44 - 7 minutes ago
Auto-update Variables: input_backup_bool: False, input_restart_bool: True, input_verbose_logging_bool: True, input_max_backup_age_seconds: 0.0, input_schedule_monthday: 1, input_update_exclusions: [[], []], input_core_os_update_mode: all, input_firmware_update_mode: all, input_general_update_mode: all, core_update_entity: update.home_assistant_core_update, os_update_entity: update.home_assistant_operating_system_update, supervisor_update_entity: update.home_assistant_supervisor_update, firmware_update_entities: [], general_update_entities; ['update.matter_server_update', 'update.nginx_proxy_manager_update', 'update.studio_code_server_update', 'update.silicon_labs_multiprotocol_update', 'update.onedrive_backup_update', 'update.network_ups_tools_update'], updates_list: ['update.home_assistant_core_update', 'update.home_assistant_operating_system_update'] triggered by automation Home Assistant Auto-update triggered
16:39:44 - 7 minutes ago
Auto-update Variables: input_backup_bool: False, input_restart_bool: True, input_verbose_logging_bool: True, input_max_backup_age_seconds: 0.0, input_schedule_monthday: 1, input_update_exclusions: [[], []], input_core_os_update_mode: all, input_firmware_update_mode: all, input_general_update_mode: all, core_update_entity: update.home_assistant_core_update, os_update_entity: update.home_assistant_operating_system_update, supervisor_update_entity: update.home_assistant_supervisor_update, firmware_update_entities: [], general_update_entities; ['update.matter_server_update', 'update.nginx_proxy_manager_update', 'update.studio_code_server_update', 'update.silicon_labs_multiprotocol_update', 'update.onedrive_backup_update', 'update.network_ups_tools_update'], updates_list: ['update.home_assistant_core_update', 'update.home_assistant_operating_system_update'] triggered by automation Home Assistant Auto-update triggered
16:39:43 - 7 minutes ago
Auto-update Running pre-update actions... triggered by automation Home Assistant Auto-update triggered
16:39:43 - 7 minutes ago
Auto-update List of updates: - Home Assistant Core Update - Home Assistant Operating System Update triggered by automation Home Assistant Auto-update triggered
16:39:43 - 7 minutes ago
Auto-update A new update is available for Home Assistant. triggered by automation Home Assistant Auto-update triggered
16:39:43 - 7 minutes ago
Auto-update Variables: input_backup_bool: False, input_restart_bool: True, input_verbose_logging_bool: True, input_max_backup_age_seconds: 0.0, input_schedule_monthday: 1, input_update_exclusions: [[], []], input_core_os_update_mode: all, input_firmware_update_mode: all, input_general_update_mode: all, core_update_entity: update.home_assistant_core_update, os_update_entity: update.home_assistant_operating_system_update, supervisor_update_entity: update.home_assistant_supervisor_update, firmware_update_entities: [], general_update_entities; ['update.matter_server_update', 'update.nginx_proxy_manager_update', 'update.studio_code_server_update', 'update.silicon_labs_multiprotocol_update', 'update.onedrive_backup_update', 'update.network_ups_tools_update'], updates_list: ['update.home_assistant_core_update', 'update.home_assistant_operating_system_update'] triggered by automation Home Assistant Auto-update triggered
16:39:43 - 7 minutes ago
Home Assistant Auto-update triggered
16:39:43 - 7 minutes ago - Traces

Hi - sorry for the delayed reply…

I can’t find anything in the HA log book. The automation traces tells me that no logs associated logs are available.

It’s weird because I manage 10-15 systems, and only a few of them has this issue. The rest updates juts fine.

Hi @EdwardTFN

I finally got some logs out.
I have this issue on 3 systems - the rest seems unaffected.

Can you make something out of the log?
From what I can see, it sees the available updates, but it doesn’t update them.

18 April 2024


DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
01:00:00 - Yesterday

Auto-update  Variables: input_backup_bool: True, input_restart_type: core, input_verbose_logging_bool: True, input_max_backup_age_seconds: 0.0, input_schedule_monthday: 10, input_update_exclusions: [[], []], input_core_os_update_mode: all, input_firmware_update_mode: all, input_general_update_mode: all, core_update_entity: update.home_assistant_core_update, os_update_entity: update.home_assistant_operating_system_update, supervisor_update_entity: update.home_assistant_supervisor_update, firmware_update_entities: [], general_update_entities; ['update.cloudflared_update', 'update.studio_code_server_update', 'update.weather_radar_card_update', 'update.anniversaries_update', 'update.horizon_card_update', 'update.mushroom_update', 'update.auto_entities_update', 'update.hacs_update', 'update.clock_weather_card_update', 'update.sonos_card_update'], updates_list: ['update.home_assistant_core_update', 'update.home_assistant_operating_system_update', 'update.auto_entities_update', 'update.clock_weather_card_update', 'update.sonos_card_update'] triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
01:00:00 - Yesterday

Auto-update  A new update is available for Home Assistant. triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
01:00:00 - Yesterday

Auto-update  List of updates: - Home Assistant Core Update - Home Assistant Operating System Update - auto-entities update - Clock Weather Card update - Sonos Card update triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
01:00:00 - Yesterday

Auto-update  Running pre-update actions... triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
01:00:00 - Yesterday

Auto-update  Backing up Home Assistant. triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
01:00:00 - Yesterday

Auto-update  Backup triggered. triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
01:00:08 - Yesterday

Auto-update  Variables: input_backup_bool: True, input_restart_type: core, input_verbose_logging_bool: True, input_max_backup_age_seconds: 0.0, input_schedule_monthday: 10, input_update_exclusions: [[], []], input_core_os_update_mode: all, input_firmware_update_mode: all, input_general_update_mode: all, core_update_entity: update.home_assistant_core_update, os_update_entity: update.home_assistant_operating_system_update, supervisor_update_entity: update.home_assistant_supervisor_update, firmware_update_entities: [], general_update_entities; ['update.cloudflared_update', 'update.studio_code_server_update', 'update.weather_radar_card_update', 'update.anniversaries_update', 'update.horizon_card_update', 'update.mushroom_update', 'update.auto_entities_update', 'update.hacs_update', 'update.clock_weather_card_update', 'update.sonos_card_update'], updates_list: ['update.home_assistant_core_update', 'update.home_assistant_operating_system_update', 'update.auto_entities_update', 'update.clock_weather_card_update', 'update.sonos_card_update'] triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
02:00:08 - Yesterday

Auto-update  Starting sequence of standard updates... triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
02:00:08 - Yesterday

Auto-update  Updating auto-entities update  of ['update.auto_entities_update', 'update.clock_weather_card_update', 'update.sonos_card_update'] ... triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
02:00:08 - Yesterday

Auto-update  Starting sequence of standard updates... triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
03:00:08 - Yesterday

Auto-update  Updating auto-entities update  of ['update.auto_entities_update', 'update.clock_weather_card_update', 'update.sonos_card_update'] ... triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
03:00:08 - Yesterday

Auto-update  Starting sequence of standard updates... triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
04:00:08 - Yesterday

Auto-update  Updating auto-entities update  of ['update.auto_entities_update', 'update.clock_weather_card_update', 'update.sonos_card_update'] ... triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
04:00:08 - Yesterday

Auto-update  Starting sequence of standard updates... triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
05:00:08 - Yesterday

Auto-update  Updating auto-entities update  of ['update.auto_entities_update', 'update.clock_weather_card_update', 'update.sonos_card_update'] ... triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
05:00:08 - Yesterday

Auto-update  Starting sequence of standard updates... triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
06:00:08 - Yesterday

Auto-update  Updating auto-entities update  of ['update.auto_entities_update', 'update.clock_weather_card_update', 'update.sonos_card_update'] ... triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
06:00:08 - Yesterday

Auto-update  Variables: input_backup_bool: True, input_restart_type: core, input_verbose_logging_bool: True, input_max_backup_age_seconds: 0.0, input_schedule_monthday: 10, input_update_exclusions: [[], []], input_core_os_update_mode: all, input_firmware_update_mode: all, input_general_update_mode: all, core_update_entity: update.home_assistant_core_update, os_update_entity: update.home_assistant_operating_system_update, supervisor_update_entity: update.home_assistant_supervisor_update, firmware_update_entities: [], general_update_entities; ['update.cloudflared_update', 'update.studio_code_server_update', 'update.weather_radar_card_update', 'update.anniversaries_update', 'update.horizon_card_update', 'update.mushroom_update', 'update.auto_entities_update', 'update.hacs_update', 'update.clock_weather_card_update', 'update.sonos_card_update'], updates_list: ['update.home_assistant_core_update', 'update.home_assistant_operating_system_update', 'update.auto_entities_update', 'update.clock_weather_card_update', 'update.sonos_card_update'] triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
07:00:08 - Yesterday

Auto-update  Variables: input_backup_bool: True, input_restart_type: core, input_verbose_logging_bool: True, input_max_backup_age_seconds: 0.0, input_schedule_monthday: 10, input_update_exclusions: [[], []], input_core_os_update_mode: all, input_firmware_update_mode: all, input_general_update_mode: all, core_update_entity: update.home_assistant_core_update, os_update_entity: update.home_assistant_operating_system_update, supervisor_update_entity: update.home_assistant_supervisor_update, firmware_update_entities: [], general_update_entities; ['update.cloudflared_update', 'update.studio_code_server_update', 'update.weather_radar_card_update', 'update.anniversaries_update', 'update.horizon_card_update', 'update.mushroom_update', 'update.auto_entities_update', 'update.hacs_update', 'update.clock_weather_card_update', 'update.sonos_card_update'], updates_list: ['update.home_assistant_core_update', 'update.home_assistant_operating_system_update', 'update.auto_entities_update', 'update.clock_weather_card_update', 'update.sonos_card_update'] triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
07:00:08 - Yesterday

Auto-update  Variables: input_backup_bool: True, input_restart_type: core, input_verbose_logging_bool: True, input_max_backup_age_seconds: 0.0, input_schedule_monthday: 10, input_update_exclusions: [[], []], input_core_os_update_mode: all, input_firmware_update_mode: all, input_general_update_mode: all, core_update_entity: update.home_assistant_core_update, os_update_entity: update.home_assistant_operating_system_update, supervisor_update_entity: update.home_assistant_supervisor_update, firmware_update_entities: [], general_update_entities; ['update.cloudflared_update', 'update.studio_code_server_update', 'update.weather_radar_card_update', 'update.anniversaries_update', 'update.horizon_card_update', 'update.mushroom_update', 'update.auto_entities_update', 'update.hacs_update', 'update.clock_weather_card_update', 'update.sonos_card_update'], updates_list: ['update.home_assistant_core_update', 'update.home_assistant_operating_system_update', 'update.auto_entities_update', 'update.clock_weather_card_update', 'update.sonos_card_update'] triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
07:00:08 - Yesterday

Auto-update  Finishing update process. triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
07:00:08 - Yesterday

Auto-update  Remaining updates: - Home Assistant Core Update - Home Assistant Operating System Update - auto-entities update - Clock Weather Card update - Sonos Card update triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
07:00:08 - Yesterday

Auto-update  0 item(s) pending a restart: - triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
07:00:08 - Yesterday

Auto-update  Running post-update actions... triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
07:00:08 - Yesterday

Auto-update  Done! triggered by automation DO NOT EDIT - Auto Update Home Assistant  triggered by state of Run Auto Update
07:00:08 - Yesterday


Not that much. :frowning:
I will try to review the code and add more useful logs.

Thank you,

If you tell me where to look - I’ll see if I can get better logs for you.

There is…
Looks like it is breaking between the pre-update actions and the backup, so I have a few questions here:

  1. Do you have any action set under “(optional) Pre-update actions”? If not, could you please set a simple action, like turn-off a light, just for test, and let me know if that action is executed? And please let me know if the update ran after an action was set.
  2. Do you have a sensor named sensor.backup_state? If so, could you please go to Developer Tools, under the tab “States” and share here its state and attributes. I’m interested only on the attributes keys available, so no need to share it’s values, if you can/want hide those.

Thanks for this - just set it up and I’d like to test it (currently have 8 updates sitting ready to install)

If I hit “run” the blueprint, it doesn’t seem to do anything - I am inside the schedule I’ve created (specifically created to test)
Am I missing something or will it just run at a random time within the period?