Same error. The entire error log is:
Invalid config for [automation]: required key not provided @ data[‘action’]. Got None
required key not provided @ data[‘trigger’]. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/automation/
I’ve never specified an automation, either before or after using packages, without - alias: blah, blah, blah
I don’t know if alias is required, or the dash is required (to make it a list element.) I’d suggest either:
automation:
- trigger:
platform: state
entity_id: input_boolean.switch_enable
to: 'on'
action:
service: input_datetime.set_datetime
entity_id: input_datetime.enable_time
data:
date: '2018-07-10'
time: '05:00'
or:
automation:
- alias: Set datetime
trigger:
platform: state
entity_id: input_boolean.switch_enable
to: 'on'
action:
service: input_datetime.set_datetime
entity_id: input_datetime.enable_time
data:
date: '2018-07-10'
time: '05:00'
Sorry, no luck. Both options give me the same error. But just out of curiosity, I pasted the code directly into configuration.yaml and it works. Is there anything specific required for automation defined in a package?
Ok, after more digging I found the problem… when I moved the code into a package, I left previous automation keyword in configuration.yaml. After removing it, everything started to work.
This allows me to use both packages as well as “normal” automation and script files. Any file I put in <config>/packages will be interpreted as a package file, anything in <config>/automations can contain a list of automations, and anything in <config>/scripts can contain a set of named scripts.