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.