How to debug what failed in my automations?

I have many automations and i have somewhere some fails.
I have used Automation editor and all logs just say problem is in Line 9x… and that number is just !include automations file.

Any way to get some logs where really the problem is?

Im having hard time to do new automations cause formatting is totally different in here at forums than in automation editor. Making learning hard…

  • Timo

What does the error say?

Ok, here is some from my logs…

2018-02-28 00:41:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [at] is an invalid option for [automation]. Check: automation->condition->0->at. (See /config/configuration.yaml, line 91). Please check the docs at https://home-assistant.io/components/automation/
2018-02-28 00:41:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [at] is an invalid option for [automation]. Check: automation->condition->0->at. (See /config/configuration.yaml, line 91). Please check the docs at https://home-assistant.io/components/automation/
2018-02-28 00:41:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [at] is an invalid option for [automation]. Check: automation->condition->0->at. (See /config/configuration.yaml, line 91). Please check the docs at https://home-assistant.io/components/automation/
2018-02-28 00:41:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [after] is an invalid option for [automation]. Check: automation->condition->0->after. (See /config/configuration.yaml, line 91). Please check the docs at https://home-assistant.io/components/automation/
2018-02-28 00:41:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: required key not provided @ data[‘trigger’]. Got None. (See /config/configuration.yaml, line 91). Please check the docs at https://home-assistant.io/components/automation/
2018-02-28 00:41:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: required key not provided @ data[‘action’]. Got None. (See /config/configuration.yaml, line 91). Please check the docs at https://home-assistant.io/components/automation/
2018-02-28 00:41:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [id] is an invalid option for [automation]. Check: automation->trigger->2->id. (See /config/configuration.yaml, line 91). Please check the docs at https://home-assistant.io/components/automation/

The lines in your automations are not indented properly, so you have the keywords at, after and id aligned with automation, where the first two should be at least 4 spaces in, and the latter 2.

I would just be so happy if this error would say “There is something wrong in automations.yaml file in row 436”. Would be so much easier to check things.

I think the problem is that it unpacks it all in to one long configuration file before it does the check, so included files wouldn’t preserve their line numbers.

Realistically the error message is informative enough to narrow it down, you’re looking for a couple of misaligned keywords, should be fairly easy to spot. Could even use ‘find’ for the applicable keywords.

I just dont get it. I try to look what of those at and or after words are wrong but they seem to be aligned on same level that other working ones and so on.

I copypasted my whole automations.yaml file here:
https://pastebin.com/5XHVYFPh

Can you point out what of those are wrong and i try to realise what is really wrong and try to avoid it later :slight_smile:

It’s the middle of the night here, and I’m scanning it on my phone, but quickly spotted:

Line 116 should be after: '08:01:00'
Line 117 should be before: '07:40:00'
Line 134 should be after: '07:00:00'
Line 135 should be before: '07:20:00'

I can’t find the line(s) where trigger / id is out atm. Maybe when I’m awake and have a decent sized screen. :+1:

1 Like

Btw, they were like that before and automation editor has changed them.