I'm trying to create an automation that starts the Frigate addon after it detect that my NAS has mounted in HA properly. Here's the automation I have created.
alias: Frigate NAS Check
description: Checks to make sure the frigate nas mount has occured before starting Frigate
triggers:
- event: start
trigger: homeassistant
actions:
- repeat:
until:
- condition: template
value_template: >-
{{ wait_result is defined and 'Frigate NAS mounted' in
wait_result.stdout }}
sequence:
- action: shell_command.check_frigate_nas_mount
response_variable: wait_result
- delay:
seconds: 10
- data:
addon: ccab4aaf_frigate-fa
action: hassio.addon_start
Here is my shell scrip that exists in HA configuration.yaml
shell_command:
check_frigate_nas_mount: "mount | grep -q '/media/frigate' && echo 'Frigate NAS mounted' || echo 'Frigate NAS not yet mounted'"
I'm not even sure if it's even running when HA starts up. Frigate isn't starting and I don't see any related logs (errors or otherwise) in HA. I've tried a few different things for value_template (such as {{ wait_result is defined and wait_result['return_code'] == 0 }} (and obv had a slightly diff config). Not sure if there's something here I'm missing or some other way to tell if it's erroring out.