Trigger automation after Home Assistant has been up for 15 seconds

I am looking for help creating an automation that will restart my Frigate when Home Assistant has been up for 15 seconds. The reason for this automation is that Frigate starts before Home Assistant when my server boots up and this causes problem with Frigate publishing MQTT events. (I run Home Assistant in a vm and Frigate in a docker container on the host machine.)

I’ve seen conflicting advice on the forum about how to measure Home Assistant’s uptime. Can I just use the Uptime integration which creates sensor.uptime? Then I could write an automation like this:

alias: "System: Restart Frigate when Home Assistant has been up for 15 seconds"
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.uptime
    above: 15
condition: []
action:
  - service: mqtt.publish
    data:
      topic: frigate/restart
mode: single

Would this work? Any advice would be greatly appreciated.

Try this:

- id: '1565194745362'
  alias: Status bij opstarten HA
  trigger:
  - event: start
    platform: homeassistant
  condition: []
  action:
  - delay: 00:00:15
  - service: mqtt.publish
    data:
      topic: frigate/restart
mode: single
2 Likes

Thank you @francisp