How on earth do I trouble shoot this error?

I’m getting this error every thirty minutes exactly on the hour and half past the hour.
It started recently but I couldn’t tell you when or what I have changed (too much to remember!!) but I did upgrade to 0.83.2 from 0.82 in the last couple of days.

## Log Details (ERROR)
Tue Dec 04 2018 16:00:00 GMT+0000 (Greenwich Mean Time)
Error rendering data template: UndefinedError: 'None' has no attribute 'state'

I have searched for anything I can think of in my config related to the words used in the error and relating to times but nothing in my config seems to be relevant. And I ‘know’ (famous last words) I have no automations that trigger on the hour of half hour.

I am wondering if it might be a sensor or custom component…

Whatever it is, does anyone have any suggestions for trouble shooting?

Do you have any template sensors? or anything with templates? It’s stating that whatever entity_id or trigger you’re using isn’t being passed or used and so it essentially is a variable that doesn’t have any attributes.

Look at automations that run every 30 minutes.

I don’t have any!

Is something not working or is this just a bothersome log message. This can be some error related to ha code rather than an error specific to your configuration.
You can enable debug logging and then
tail -f home-assistant.log | grep “UndefinedError”

As far as I can tell everything works.
I’ll change the logging level and see what I can find…

Remember to reset logging after you are done looking. :wink:

1 Like

Hmm, so I see someone else asked, but do you have any sensors that use templates. here is how I would troubleshoot.

I’d comment out all sensors that have a data template. Even ones that I think are good.

I’d restart HA, and check back in 30 minutes. See if you still have the error.

If the error is gone, then I’d look closer at the templates I do and look for ones that use ‘state’ in any way at all.

uncomment any that you think could be the culprit and repeat.

Yes, but I have tons…

If it comes to it I will have to remove packages one by one and try that.

The strange thing is I wouldn’t have to wait 30 minutes. It is always on the hour and on the half hour.

Do you have any wemo lights that you tried to change their states using template_lights?

From what I know this error usually comes up when a template sensor or switch or whatever, is unavailable. I have seen this on some of my calendar sensors where the calendar didnt load. Also had this with a proximity sensor where the Google location was delaying to report status after a restart.
I know these might sound silly, but I thought that might be of help somehow.

No I don’t but interestingly I only recently added the calendar sensor. I’ll look into that.