Error message for which automation?

Hi everybody !

When I restart my home assistant, after few weeks without change it, I have a error message in my logs :

Invalid config for [automation]: Unexpected value for condition: 'None'. Expected numeric_state, state, sun, template, time, zone, and, or, not, device @ data['condition'][0]['conditions'][0]. Got None. (See /config/configuration.yaml, line 144).

My issue is, in line 144, I put all my automation folder… And I don’t which automation failed. Do you have an idea to find it ?

Unfortunately no. All that error message tells you is that it is the first condition in one of your automations that is invalid. It looks like a pretty egregious error. You should be able to spot it.

Temporarily remove half of your automations and restart.

  • If the error message returns, cut it half again.
  • If the error message is gone, the problem is the other half.
    Continue doing this until you narrow it down to the offending automation.

Or start by looking at the last automation you edited if this is the first time you have seen the error.

2 Likes

I did like that, and I found it… sunrise issue. Thanks for your help

1 Like

Glad it worked for you.

I had a similar problem and my automations are in separate files, within a directory, so it was difficult to tell which automation in which file was the source of the problem. I removed files until I could isolate which file contained the defective automation.

Hey 123, just out of interest, how would you implement a more efficient algorithmic search than a binary search?

Is it possible to apply a bubble sort to searching this type of thing?

LOL, in lieu of a better search technique, I would implement an error message that was more specific than just "Yo! Automation’s got a bad condition" :slight_smile:

I’m OK with the “Rule of Halves” to isolate the culprit; it’s worked for me and isn’t too time-consuming or complicated to do (that’s not to say I enjoyed doing it, knowing my automations have names and why can’t the error message use them).

1 Like