Elegant/Best Practice Config Architecture?

Could anyone recommend a good resource or useful article(s) that talks about Home Assistant/Hassio overall design/config architecture?

My first attempt with Hassio was a lot of fun, and it was great seeing things like my door/window sensors working together with my lights, sonos etc etc… But after a short while, things started to become disorganised… I had a larger issue that then sent me chasing my tail for a while. I’ve now come full circle, and am ready to rebuild from scratch.

I understand that implementation is hardware and use case specific, but I am look for inspiration for how to set up my config from the ground up to keep things organised, and minimise the amount of tweaking I’ll have to do for changes etc. In terms of principles, it would be nice to follow your typical coding/development things (reuse, minimise hard-coding etc, naming standards etc)

Any insight(s) appreciated.

Located the ‘splitting up the configuration’ page:

Seems like a good starting point after figuring out the basics. After this, I think I will have a look at some of the published configs for ideas:

Looks like your finding your own answers :wink:
I’m in the same boat. I’ve been running HA for around 6 months and have all my hardware sorted and autos running.
The config.yaml quickly becomes large and hard to work with, as you’ll see, splitting it up makes things much easier to work with.
As I learn about features that I was unaware of I go back through my setup and make changes / consolidate code.
For example, a few weeks ago I discovered that scripts can have conditions, so I went back through my automations and converted some of them to scripts ( scripts can be stopped once started, autos can not )

It seems to be an ever evolving system

Also, using the right software for editing can remove a lot of silly mistakes and confusion.
Personally I use Visual Studio Code.

Yeah, I’m definitely trying to be resourceful … or at least appear to be :rofl:

After browsing through about half of the cookbook configs and the various ways to do things… I have to say, I am even more confused about how to move forward!

The article I linked discusses how to split out the config in technical terms (great). The cookbook configs display how people have set things up (also good).

The bit that’s missing for me however - and not at all to imply that this is someones job - is an understanding of someones individual needs, their equipment/hardware, their decisions (for example how to use groups) and their rationale for those decisions. I totally understand why this is, as this is the bit that usually goes on in the designer’s head, and they may have perfectly good reasons for their decisions, but it’s just not very clear by just looking at some yaml and scripts. At least not with my level of experience with these.

As with most things I’ve learned from others in the past, I find I get a lot more out of a discussion that lets me delve into the questions above. But unfortunately this is not really an option, at least not in person/audio.

I wanted to start this thread as a way to understand the big wins that people have had. For example, I have a bunch of xiaomi door/window sensors (~6) that I would like to manage. I think adding some friendly names and grouping them would be useful. How and where to do this? I checked out some binary-sensor.yaml examples and came out more confused than I was going in… :tired_face:

I might be overthinking this, but I guess I really want to approach this with more thought the second time around.

1 Like

You can use customize to set your friendly names/icons and much more…

You can also split this out into separate file/s so you could put motion sensors in one file and door/window sensors in another file or keep them to their hardware groups, which is what I do.

1 Like