16-12-24 02:36:54 homeassistant.components.sensor.template: UndefinedError: 'None' has no attribute 'state'
16-12-24 02:36:54 homeassistant.components.sensor.template: UndefinedError: 'None' has no attribute 'attributes'
16-12-24 02:36:54 homeassistant.components.sensor.template: UndefinedError: 'None' has no attribute 'attributes'
16-12-24 02:36:54 homeassistant.components.sensor.template: UndefinedError: 'None' has no attribute 'state'
Any way to properly debug the problem?
Edit: Original problem was most likely not linked to this errors.
You’re testing an attribute of a sensor before it exists. This won’t break anything, but it will generate errors. Wrap it in an “if” that checks for the existence of the entity first. Like
value_template: '{% if states.remote.livingroom.state %}{{ states.remote.livingroom.attributes.current_activity }}{% endif %}'
If I’m not mistaken, is_state shouldn’t error like this. Are you sure that’s where you’re getting the errors from? That log mentions attributes of “attributes” and “state”. Rather than failing (before the tracker exists) the value for that template would be “=OFFLINE=”