Home Assistant... But Modular
Table of Contents
Modularity always helps when it comes to the maintenance of complex systems, and so it should help when it comes to managing Home Assistant. A while back, I stumbled across Frenck’s GitHub profile, where he was showcasing his Home Assistant config - https://github.com/frenck/home-assistant-config. I found the idea of splitting each entry into it’s own dedicated file, rather then having one huge config file, much more intuitive and easier to manage.
Setup
Navigate to your data folder
103:43:35 vivaan@ultimate ~ → cd /clstr/homeassistant/data
Create a new integrations folder
This will be where all the entries for Home Assistant’s config will be stored.
103:55:50 vivaan@ultimate data → mkdir integrations
203:56:53 vivaan@ultimate data → ls integrations/
303:57:02 vivaan@ultimate data →
Configure configuration.yaml to look in the integrations folder
Add the following to the bottom of your configuration file:
1homeassistant:
2 packages: !include_dir_named integrations
Restart Home Assistant

Examples
Say if you want to move your default_config section to this new modular structure:
First, create a file named
default_config.yamlAdd the following
1default_config:and remove that line from
configuration.yaml
Notes
- Make sure you don’t have any duplicate keys in your
configuration.yamlfile - i.e. you should only have onehomeassistant: - Home Assistant should validate the configuration before restarting, so as long as it pass that check you should be good to go
Final Thoughts
Overall, the introduction of a modular structure should make it easier to maintain and change things, as it’ll be pretty simple to work out the location of where something is. As well as this, it should mean that your configuration.yaml file remains pretty small and readable.