Hi all, I’m new to Home Assistant… I would like to automate the setting up of HA Core from scratch. This is not a complaint but rather a statement expressing how far I got.
In February, I started digging into how Home Assistant works and tried to find a way to automate setting up of Home Assistant Core. I didn’t really care whether it was through YAML or config-flow, I just wanted a consistent way to automate the set up, so that I can a well tested configuration I can run against new releases and identify changes I need to make before rolling it out to my installation. I didn’t want to use snapshot restoration as a means of automation as it could make it difficult to identify which individual component is failing.
I reverse engineered how the API works by watching the requests/responses through Chrome Developer Tools and a little bit of reading the code. Then I created an ansible role that install home assistant core and configures it.
Here’s an excerpt that shows how the integration configuration works (This was tested with 0.105.x):
It works for the most part but not certain if it’s comprehensive.
But then I tried to take the same approach for trying out configuring entities, zones, etc… but I can’t seem to how HA is making the API calls from frontend to the backend to configure those via Chrome Dev Tools. Config flow automation works for the most part, but others like entitites I haven’t figured out. I would love to help by contributing to bringing some consistency to the APIs across the project.