Automation Refuses to Work

I’ve read through the many topics here regarding automations not working and tried all of the reformatting techniques but my automation still refuses to load. It keeps returning the following message:

16-09-02 17:52:17 homeassistant.bootstrap: Invalid config for [automation]: required key not provided @ data[‘action’]. Got None
required key not provided @ data[‘trigger’]. Got None

Here is the script from the .yaml file I created for this automation.

trigger:
paltform: time
minutes: ‘/5’
seconds: 0
condition: use_trigger_values
action:
service: notify.mytelegram
data:
title: “Test Message”
message: “This is a test of Telegram Notify.”

I can see in the logs that the Telegram service is loading and registering just fine but HA is giving me this error on the automation. I’m really stuck here and I can’t seem to get my first automation to work. Does anybody know what “required key values” I am missing here?

Regards,
Brian

“platform: time” is misspelled as “paltform: time”

1 Like

Good catch on the misspelling. I’ve been looking at this so long I couldn’t see that. Thank you. That wasn’t able to fix the automation though. I was still receiving the same error after fixing the spelling issue.

My configuration.yaml had this line for my automation file:

automation: !include_dir_merge_list includes/automations

In the automations directory I had a file, testtelegram.yaml with the script I posted initially.

To get the automation to work I moved the script from testtelegram.yaml (with corrected spelling) back into the configuration.yaml file:

automation:
trigger:
platform: time
minutes: ‘/5’
seconds: 0
action:
service: notify.mytelegram
data:
message: “This is a message every 5min. 0sec.”

I now receive a text message every 5 minutes. I am glad that this works. I started breaking the configuration.yaml into separate files because I couldn’t even get the example automation to work and that seemed to be the consensus suggestion. I appreciate your help. I now have a working automation and a place where I can start working from. Thank you.

1 Like

I’ve had issues getting the automation dir_merge_list to work myself, and now that I am actually writing more automations, I’ve got to figure it out. Must be something in the syntax in the individual files…

I was using !include_dir_merge_list because that is what bah2830 was using in the example configuration.yaml. Thanks for the heads up that it is buggy. I noticed that cbulock’s example uses a combination of !include_dir_merge_list, !include_dir_list, and !include_dir_named to reference directories filled with .yaml files. I’m not sure what the different use cases are yet but I am hoping one of them works.

Just to be clear, it isn’t dir_merge_list that’s buggy, it’s my understanding of it. :flushed:

My guess in my case is that I either haven’t formatted the original YAML correctly for the individual automations or I’m not using it correctly.

But many are using this with no problem at all… I just don’t want you to think there is an issue with the code.

Gottcha! Thanks again for the help.

Repost your config in code tags so that we can see the indentation. This is very important for YAML.

Here is my example !include_dir_merge_list and automation file.

@AlucardZero Thank you very much for the insight. I have it working now. It’s very interesting the way it works and I guess it is just a matter of getting used to the rules of the syntax. When using !include_dir_merge_list you need to:

  1. ensure that each separate file is indented properly (e.g. 2 spaces) for the first line. You cannot start the file completely left justified.

  2. Even though you are using separate files, you need to view the formatting within your files as if they were part of a contiguous file. e.g. use a ‘- alias:’ at the beginning of each file.

Here is one of the test automations I am using:

  - alias: Test Every 5 Minutes
    trigger:
      platform: time
      minutes: '/5'
      seconds: 0
    action:
      service: notify.mytelegram
      data:
        message: "This message is sent every 5 minutes!"

I have 3 separate files in the directory and all 3 automations are running now. Thanks for the insight. Now I am going to turn this automation off because it’s annoying!