How to check whether HA has completely started?

I would like to log (in the HA log) that it has completely started.

This information is available somewhere because the UI warns that the startup is not done yet, and eventually informs that the startup is over.

Is there something (ideally a state - but did not find any relevant) that I can check for that? (this will be done from within my pyscript code)

1 Like
automation:
  trigger:
    platform: homeassistant
    event: start

Couldn’t you just use an automation triggering on HA start?

@anon43302295 @Syntox

I will use an automation (from within pyscript) because I want to see, looking at the logs, when HA has finished starting .

Does the event you mention indicate that HA started or completed its startup?

There are 4 home assistant events that are fired on startup/shutdown.

homeassistant_start
homeassistant_started
homeassistant_close
homeassistant_stop

You’ll have to play with them to find out when each one fires, as I can’t find any documentation on them.

I just made some tests and homeassistant_started which was the most promising does not fire. I guess the UI must be analyzing responses from the websocket it creates with the backend. I will investigate further (I am not very good with JS but will give it a try)

1 Like

did you figure it out?

No I did not. I moved away from pyscript for now so the problem died on its own.

1 Like

Just checked it with an automation which creates a persistent notification in HA and it fired after HA was fully started

alias: "Notify on startup "
description: ""
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - service: persistent_notification.create
    metadata: {}
    data:
      message: Started or starting?
      title: HA starting
mode: single
2 Likes