Trouble combining configuration old and new in order to use the HA cloud

When I try to combine new automations with old. I keep getting this error message in the log:

YAML file /config/configuration.yaml contains duplicate key “automation old”. Check lines 103 and 238.

I need both types of automations in order to use the new HA cloud webhooks (see details below). My automations do work but the error prevents restarting from the web, it forces all restarts to be manual, which is scaring me.

I followed the docs and put the following in my automations.yaml file:

automation: !include automations.yaml
automation old: !include_dir_merge_list automations

and then before the first automation in my automations.yaml I use:

automation old:

The reason I am combining the two is that I am using the webhooks feature of the Home Assistant cloud. As far as I can tell, the webhook feature of the cloud can only be used via the new automations GUI. However the new automations GUI method does not support comments, and more importantly it does not appear to support data_template which I am using extensively.

The solution I have found is to keep the bulk of my automations in the configuration.yaml file (as configuration old) and just use automations.yaml file for webhooks by having the GUI created automations in automations.yaml trigger the legacy automations in the automations old section of configuration.yaml. This works, but it gives the error.

Did you try remiving the second “aitomation old:” entry and see if it fixes it?

You can’t have the same domain entered twice in your config. If you put automation old: in the include statement then you cant have it in the included file too.

I figured that was the problem, however I either have to have “automation:” or “automation old:” at the beginning of my automations. I have tried every combination I can think of, and searched all over the web.

It is all rather ironic. For everything else (all the things HA is giving me for free) I could find an answer by just googling, but for the only thing that I am actually paying for there seems to be no answer anywhere ! … at least not yet :slight_smile:

The only instructions for using the old and new configurations together are given here:

What that is saying is that you need both of those sections in your config but even tho you need to have both sections you still can’t have two of either “automation:” or “automation old:” in your config.

when you use include statements it is just like you write whatever is in the inluded file in the config exactly as it is in the file.

For example if you use the following:

automation: !include automations.yaml
automation old: !include old_automations.yaml

if in your automations.yaml you have:

automation:
  automation_new_1
  automation_new_2

and in your old_automations.yaml file you have:

automation old:
  automation_1
  automation_2
  etc

then the config sees this:

automation: 
  automation:
    automation_new_1
    automation_new_2
automation old:
   automation old:
      automation_1
      automation_2
      etc

You should be able to see the issue.

If you have those headings in your automations.yaml or automations_old.yaml you need to remove them.

If that’s not the case then let me know and I’ll try to approach it from a different way.

Yay!
It is fixed now.
Thank you, you pointed me in the right direction!

My /config/automations.yaml file never was the problem, it is completely controlled by the GUI and is automatically built.

The problem was in my /config/configuration.yaml

The solution was to remove one of the includes
Now the ONLY include I have is:

automation: !include automations.yaml

and then in /config/configuration.yaml file my automations begin with:

automation old: