I just added some automations to my automations.yaml file. When validating the configuration I am getting the following error:
Invalid config for [automation]: [after] is an invalid option for [automation]. Check: automation->trigger->0->after. (See /config/configuration.yaml, line 145). Please check the docs at https://home-assistant.io/components/automation/ Invalid config for [automation]: [after] is an invalid option for [automation]. Check: automation->trigger->0->after. (See /config/configuration.yaml, line 145). Please check the docs at https://home-assistant.io/components/automation/
Strange thing is that I have not made any changes to my config file.
Is line 145 the automation line if so the the error is in the automation file HA has a hard time dealing with !include just check your spacing in said file
Thanks!
Yes, the line 145 is the automation file.
So the error is in that file? I have previously got errors specifically in automation.yaml. Have not seen this before.
Is there any tool to validate the automation file that you know of?
A tick you can do is what I did when starting down this track is
Put a # at the front of line 145
Then copy all the automation into the configuration file under automation:
Then do a config check that will tell you the line number then cut it back to the automation file take out the # in 145 do a config check again
I splitted the automation file and found out that the error is in this bit:
- alias: Turn on indoor lights random when not at not at home
trigger:
platform: time
after: '17:00:00'
condition:
- condition: state
entity_id: input_boolean.not_at_home
state: 'on'
action:
delay: '{{ (range(0, 2)|random|int) }}:{{ (range(1, 59)|random|int) }}:00'
service: light.turn_on
entity_id:
- light.hue_ambiance_lamp_2_2
- light.hue_ambiance_lamp_1_2