Separating static configuration files and dynamic data files

https://wilson.bronger.org/ha_config_tree.txt shows my HA “/config” directory. I think it is difficult to maintain this way. Besides, I wonder how complete Python packages and TTS files ended up here. Frankly, this one-for-all “/config” directory is … well … a suboptimal design decision. IMO. Anyway. I’d like to try to separate this mess into five different types of files:

  1. Static configuration files which I version in a Git repo.
  2. Static secrets like files with passwords or TLS keys.
  3. Living database and log files which store the current state of HA which I backup every night.
  4. Temporary files.
  5. Superfluous files.

Is this possible at all? Can one point HA for the first four of these categories to different directories?

The next step would be to map all files onto the five categories. But I wouldn’t start with that if it’s impossible to separate things in the first place.

Have you tried packages?

1 Like

Thank you for the pointer, I didn’t know that. However, it helps to organise the static config files (category (1)) but not to separate them from the rest, does it?

I think the static config files must stay where they are. Maybe one can give in them the paths to all the rest, which then can be stored in different directories. At least, this is what I plan to try next. Feasible plan?

I’m not sure you will ever get as ‘clean’ an installation as you are hoping for but hopefully others more knowledgeable will chime in if I am wrong.

Packages do help a lot though.

I do agree with @klogg re. packages, but I’d started with HA before that option was available and ended up creating directories in my config folder based on domains, i.e.

group: !include_dir_merge_named groups/
input_boolean: !include_dir_merge_named input_boolean/
script: !include_dir_merge_named scripts/
switch: !include_dir_merge_list switches/
light: !include_dir_merge_list lights/
binary_sensor: !include_dir_merge_list binary_sensors/
camera: !include_dir_merge_list cameras/
sensor: !include_dir_merge_list sensors/
automation: !include_dir_merge_list automations/

I’s not as clean and consistent as I would like it to be, but it helps me a lot to keep my files organized.

Discovering packages was a HUGE eureka moment for me. They might even have been one of the things that kept me using HA because, boy was I getting frustrated.

Unfortunately restart times went from under a minute to, go and make a cup of tea, come back and worry that HA has terminally crashed.

Still, you can’t have everything…