Automation failing (Slack and numeric_State)

I’m currently trying to setup the automation with the help of the trigger numeric_state and Slack as an action, but I’m a bit struggeling. The automation looks like this:

automation:
  - alias: Temperature Dario Bedroom
    trigger:
      platform: numeric_state
      entity_id: sensor.temperature_dariobedroom
      above: 20
    action:
      service: notify.smarthome
      data:
        message: "Temperature in Dario's room is above 20°C"

and


notify:
  - name: smarthome
    platform: slack
    api_key: **
    default_channel: '#smarthome'

But I get the following error:
2017-07-24 00:06:34 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [automation] is an invalid option for [automation]. Check: automation->automation. (See /home/dario/.homeassistant/configuration.yaml, line 147). Please check the docs at https://home-assistant.io/components/automation/

I appreciate the help!

Thanks :slight_smile:

My guess, based on the error message, is that you already have automation: defined in your configuration.yaml, and that the automation you have quoted is in a separate file (maybe automations.yaml ?)

If so, remove the automation: line from your automation and move everything below it back two spaces:

- alias: Temperature Dario Bedroom
  trigger:
    platform: numeric_state
    entity_id: sensor.temperature_dariobedroom
    above: 20
  action:
    service: notify.smarthome
    data:
      message: "Temperature in Dario's room is above 20°C"

Hope this helps.

Thanks for your help, but that’s not the case, automation: is just once mentioned in the configuration.yaml and the formatting is also fine.

OK, can you post your whole (sanitised) configuration.yaml file?

That’s not so handy to do, as it is quite big.

I just fixed the issue, by removing the automation tag in the automations.yaml :slight_smile:

Which is what I said first off, but you said it wasn’t the case.

You may want to consider splitting up your configuration and using secrets so that you can post your configs easily.