Config error in the Automations.yaml file

When I try to use the Automations.yaml file I get following error.
Same code is working fine in the configuration.yaml file.
I can not found the error does anyone know what the problem is?

ERROR
INFO:homeassistant.util.package:Attempting install of colorlog==3.1.4
Testing configuration at /config
ERROR:homeassistant.util.yaml:while parsing a flow node
expected the node content, but found ‘-’
in “/config/automations.yaml”, line 8, column 3
Failed config
General Errors:
- Error loading /config/configuration.yaml: while parsing a flow node
expected the node content, but found ‘-’
in “/config/automations.yaml”, line 8, column 3
Successful config (partial)

Automations.yaml:

[#######################################
#                                                                           #
# Automation                                                        #
#                                                                           #
#######################################
#
# Send notification when sun rises and sets with the Pushbullet
  - alias: 'Send notification when sun rises'
    trigger:
      platform: sun
      event: sunrise
      offset: '+00:00:00'
    action:
      service: notify.pushbullet
      data:
        message: 'The sun is up.'
  - alias: 'Send notification when sun sets'
    trigger:
      platform: sun
      event: sunset
      offset: '+00:00:00'
    action:
      service: notify.pushbullet
      data:
        message: 'The sun is down.'

Remove the [ from the start of the file.

1 Like

Also unindent by one your confing if it’s in automations.yaml then - alias should have no spaces in front

read https://www.home-assistant.io/docs/configuration/splitting_configuration/ to understand what’s happening

Removing the [ at the beginning solve the problem.
I didn’t see that.
Thanks mf_social.

1 Like