Consider this automation triggered on HA startup:
automation:
- alias: ...
id: ...
description: ...
trigger:
- platform: homeassistant
event: start
condition: []
action:
- service: starline.set_scan_obd_interval
data:
...
mode: single
Sometimes I see an error in Log:
Error executing script. Service not found for call_service at pos 1: Unable to find service starline.set_scan_obd_interval
Seems that the Starline integration is not “ready” by the moment of calling the service.
My question is: is it possible that the “start” event raised BEFORE all integrations are loaded?
Shall I wait for “homeassistant_started” event (link)? (it is written that this event raised after “start” event)
Or shall I check somehow if the integration is “ready” - and then call this service?
Smth like:
trigger:
- platform: homeassistant
event: start
action:
- wait_template: >-
{{ not states('some_starline_sensor') in ['unavailable','unknown'] }}
- call service
Update: this is exactly what I did: waiting for an availability of some Starline sensor.
After this I do not see the error.