I am trying out the 0.111 beta, which has a great feature where the frontend becomes available earlier in the startup process which avoids the issue of failing integrations stopping the frontend from loading.
However, this causes problems if you use an automation like this which uses the start event of the homeassistant integration to set the backend theme:
- id: set_theme
alias: Set Theme on Startup
description: Set theme on startup
trigger:
- platform: homeassistant
event: start
action:
- data:
name: My Theme
service: frontend.set_theme
Since the frontend starts early, the theme won’t be set until some time after the frontend and until that happens the default theme will be used.
To resolve that, I believe we should have a start event for the frontend integration, and then we could just replace the trigger in the automation with:
If the system require to start FE before backend, then definitely there is something wrong with system architecture. one way or another it will fail due to this fact
Maybe a better feature here would be the ability to set your own default theme? That way an automation isn’t needed? I voted but personally its still a workaround to me to add another event here. Unless there is a use case I missed?
Going from the discussion over on Discord, it looks like a frontend started event isn’t going to help since automations won’t be loaded until after the frontend which means that there won’t be anything to listen to the event.
I never even knew about a frontend start event and I do use an automation to set the theme on HA start not frontend. That is working fine. I do get the white screen for maybe 20 or 30 seconds and then the correct theme is loaded.