Possible to include a second configuration file?

Is it possible to include a second configuration file from the main one?

In the examples for split configuration I have seen this done for certain sections, but I need to include a full configuration file with its own sections.

I tried putting a line like this in the main file:

!include configuration2.yaml

But it complains about a missing semicolon, so what is the correct approach?

What exactly do you mean with “a full configuration”? What’s meant to be in there?
Do Packages fulfill yoour needs?

I am trying to work around an issue with how HA is installed in Umbrel. Its docker config maps config/configuration.yaml to a different location, and this file is overwritten frequently, so useless for customizations.

I want to modify that file so it includes a custom .yaml that will not be overwritten by Umbrel.

I can easily do this for a section like automation:

automation: !include custom.yaml

But I need to do it at the base level, and

: !include custom.yaml

gives an error. I also tried:

<<: !include custom.yaml

But this doesnt work neither.

Never heard of Umbrel before but if it’s docker, can’t you define the volumn mapping to persist your configuration folder on your host?

No, I cannot do that because Umbrel manages the docker compose files, so any changes to the container will be undone during restarts.

Also, even if I could, it would not work, because if I remapped it to a different location then I would be missing the settings from the configuration.yaml that Umbrel dynamicly generates (which includes IP addresses that sometimes change).

So the only feasible solution would be to include a second configuration file from the one that Umbrel generates.

Seems like this is an issue within Umbrel.
if configuration.yaml is wiped during startup I have no idea how including another configuration would solve the issue.

Because this other file will not be wiped but persist.

But if the main configuration.yaml gets wiped then how will HA even know that the second configuration file exists? Because you need to code the location/existence of the second file in the first file…that gets overwritten and set toi default. :man_shrugging:

They are overwritten by the template file. And I will make a pull-request to change the Umbrel code so that in the future this template will include the reference to the second file. Since this file is empty by default, this does no harm to existing installations. So I’m confident they will accept my request to change the template for this cause.

I cannot make a pull-request to change the template to include my custom settings, because they are only applicable to my installation, and don’t make sense for anyone else.

Do you now understand it a bit better?

No, sorry.

From my perspective Umbrel shouldn’t overwrite any file in the configuration folder to maintain the integrity of HA.

2 Likes