List automations or scripts that will be terminated upon restart

When restarting Home Assistant, there is a nice warning telling you “This will interrupt all running automations and scripts.”
image

Sometimes a restart is required by the update of a custom component, a change to configuration.yaml or anything else but the currently running automations/scripts are more important than this restart.

It would be nice to have them listed on that popup so that you are aware of what will break and potentially postponing the restart to another time.

Further more, there could be a checkbox to wait for no running automations/script before restarting automatically.

Or if we want to have mode flexibility this checkbox could trigger an event that you could listen to in an automation and do whatever checks or actions you want before calling a restart of Home Assistant.

Until this is implemented you can create a dashboard card to check this yourself.

Screenshot 2024-02-17 at 09-58-52 Administration – Home Assistant

It requires the two third party cards:

type: vertical-stack
entities:
  - card:
      head:
        label: Disabled Automations
        type: section
      padding: 0
      type: custom:fold-entity-row
    filter:
      exclude:
        - state: 'on'
        - state: unavailable
      include:
        - domain: automation
    sort:
      ignore_case: true
      method: name
    type: custom:auto-entities
  - card:
      head:
        label: Missing Automations
        type: section
      padding: 0
      type: custom:fold-entity-row
    filter:
      exclude:
        - attributes:
            current: '= 0'
        - attributes:
            current: '= 1'
      include:
        - domain: automation
    show_empty: true
    sort:
      ignore_case: true
      method: name
    type: custom:auto-entities
  - card:
      head:
        label: Running Automations
        type: section
      padding: 0
      type: custom:fold-entity-row
    filter:
      exclude:
        - state: unavailable
        - attributes:
            current: '= 0'
      include:
        - domain: automation
    show_empty: true
    sort:
      ignore_case: true
      method: name
    type: custom:auto-entities
  - card:
      head:
        label: Running Scripts
        type: section
      padding: 0
      type: custom:fold-entity-row
    filter:
      exclude:
        - state: 'off'
        - state: unavailable
      include:
        - domain: script
    show_empty: true
    sort:
      ignore_case: true
      method: name
    type: custom:auto-entities
  - card:
      head:
        label: Missing Scripts
        type: section
      padding: 0
      type: custom:fold-entity-row
    filter:
      exclude:
        - state: 'off'
        - state: 'on'
      include:
        - domain: script
    show_empty: true
    sort:
      ignore_case: true
      method: name
    type: custom:auto-entities
show_header_toggle: false
title: Auto-filled Lists
type: entities

Good idea!

I just added the card.
Like you say, it can help but a cleaner, well integrated solution would make things easier for everyone.

Thanks for sharing this