Automation Configuration Help

The below is erroring and not allowing HA to start. When I eliminate all but the first automation it works just fine but when I add a second, third etc. automation I get errors on

docker start [image ID].

Here is the automation section of the configuration.yaml in reference;

http://hastebin.com/voyehobube.sm

If you get a log from HA I’ll try to help.
The docker start [image ID]. doesn’t really say anything about whats wrong.

At a first glance your automation config looks good but can’t run it trough HA atm.
I was wrong. Have a look at @Danielhiversen’s answer.

I think that the best way to set up HA is to move everything to its separate config files, and only leave the include line in the main configuration.yaml.
So an example:
configuration.yaml:

automation: !include my_automations.yaml

Then your my_automations.yaml:

  • !include automation_directory_name_it_as_you_like_under_the_main_ha_directory/rule01.yaml
  • !include automation_directory_name_it_as_you_like_under_the_main_ha_directory/rule02.yaml

And so on …

Watch out that the my_automations.yaml should not contain any identation!


Your rule01.yaml:

alias: ‘My first automation rule’
trigger:
platform: state
entity_id: group.all_switches
state: ‘on’

action:
service: homeassistant.turn_off
entity_id: group.all_switches

Pay attention that the alias, trigger, and action parts ARE 2 SPACES IDENTED, and everything under them are +2 two spaces idented.

Ok, this automation rule does not make any sense, I know, but you get the idea how to set up your files structures.

The file and directory names are not restricted in any way, name them as you like, but be consistent, so two week later you still know what you did before.

cheers
tom

I found several errors. All of the errors are mentioned in the log. So you have to check your log to correct your configuration.

I have fixed your atuonation for now, so have a look at this:
http://hastebin.com/edumurutuh.sm

1 Like

There’s actually a way to do this without manually including individual things in my_automations.yaml. Try automation: !include_dir_merge_list automation_directory_name_it_as_you_like_under_the_main_ha_directory in configuration.yaml instead.