krash
(Harry)
May 16, 2019, 9:09am
1
Just upgraded to 0.93.
I’m getting this error but i have no idea where to start troubleshooting this:
2019-05-16 12:00:00 ERROR (MainThread) [homeassistant.helpers.service] Error rendering data template: UndefinedError: 'None' has no attribute 'state'
I found this , that apparently solves it, but i have no idea which template the error is referring too.
Any clues?
It 's related to a template. Do you use it a lot for entities or automation ?
Have you change template recently ? Perhaps you have an entity not existing anymore or with a new entity_id and one of the template don’t find it anymore.
krash
(Harry)
May 16, 2019, 9:17am
3
I did a search within my config folder and found 134 occurances of value_template
Does it help by filtering the one with state keyword inside ?
krash
(Harry)
May 16, 2019, 9:27am
5
I cant thing of any clever wildcard to do this, but i believe that 99% of them would have the state
keyword in them
They are some braking changes in 0.93 do you see some integration or platform linked to potential use of template and in the breaking change list ?
krash
(Harry)
May 16, 2019, 9:30am
7
Will check again with that scope in mind.
Nothing in there that i use, unfortunatelly.
Should i go remove my package folders and see if it goes away? and then find it by slowly restoring them?
Or is not worth the pain?
krash
(Harry)
May 16, 2019, 9:45am
8
Could it be that my vacuum takes too long to be set up?
It’s 12.46 atm, and didnt have any more occurances of the error.
Perhaps activating debug level of logs generally can give you some clues on what home assistant is doing before rising the error.
krash
(Harry)
May 16, 2019, 9:49am
10
Great idea!, here are the ssh logs (# hassio ha logs):
2019-05-16 12:30:00 INFO (MainThread) [homeassistant.components.automation] Executing Irrigation Weather - Update average weather conditions every 30 mins
2019-05-16 12:30:00 INFO (MainThread) [homeassistant.helpers.script] Script Irrigation Weather - Update average weather conditions every 30 mins: Running script
2019-05-16 12:30:00 INFO (MainThread) [homeassistant.helpers.script] Script Irrigation Weather - Update average weather conditions every 30 mins: Executing step call service
2019-05-16 12:30:00 INFO (MainThread) [homeassistant.helpers.script] Script calculate_average_weather_conditions: Running script
2019-05-16 12:30:00 INFO (MainThread) [homeassistant.helpers.script] Script calculate_average_weather_conditions: Executing step call service
2019-05-16 12:30:00 ERROR (MainThread) [homeassistant.helpers.service] Error rendering data template: UndefinedError: 'None' has no attribute 'state'
Looks like my irrigation weather calculations are the issue
Seems like dark_sky sensor
states.sensor.dark_sky_forecast_daytime_high_temperature_0
was changed to
states.sensor.dark_sky_forecast_daytime_high_temperature_0d
Let’s see if that fixes it
That was changed a version or 2 ago.
thoky
(TV)
May 28, 2019, 11:07am
13
Thanks - its was my error too
RonJ103
(Jeremy Scuteri)
November 18, 2019, 12:15am
14
Good tip on using the logger. I was getting an error that said
ERROR (MainThread) [homeassistant.helpers.service] Error rendering data template: UndefinedError: 'binary_sensor' is undefined
I could not figure out what the issue was. The logger pointed me at the offending automation. In a nutshell I was using this code is_state('binary_sensor.bedroom_hall_motion', 'off')
but I left the single quotes off of binary_sensor.bedroom_hall_motion.
This syntax that caused the error was like this: is_state(binary_sensor.bedroom_hall_motion, 'off')