I am getting the below error message every minute. It seemed to start a few days ago after I had some dramas with my HA server crashing. The error was there with 0.78.3 and remains after upgrading to 0.80.2 this morning. Running HassIO on HassOS.
018-10-18 13:13:47 WARNING (MainThread) [homeassistant.setup] Setup of xiaomi_aqara is taking over 10 seconds.
2018-10-18 13:14:06 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: ‘mappingproxy object’ has no attribute ‘timestamp’
2018-10-18 13:14:14 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-10-18 13:15:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: ‘mappingproxy object’ has no attribute ‘timestamp’
2018-10-18 13:16:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: ‘mappingproxy object’ has no attribute ‘timestamp’
2018-10-18 13:17:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: ‘mappingproxy object’ has no attribute ‘timestamp’
Any ideas what this could be? It doesnt seem to point to anything specific.
sounds like you have an automation that runs every minute that’s not formatted correctly. It is good enough to pass the syntax check but not good enough to work…
As far as I can remember I don’t have any automations that are set to run every minute, plus I haven’t created any new ones at the time that this started happening.
can you check your logbook and see if you find something that would change around the same time? Maybe it’s a template sensor that updates once a min ?
the logbook doesnt show an event every minute. There are times where many minutes go by (even an hour) without an entry, yet the error is logged every minute
based on the error referring to a ‘template condition’ I just looked through my automations and the below seems to be the only one with a template in the condition section.
Can you try and replace as_timestamp(states.binary_sensor.kitchen_multi_sensor_sensor.last_changed)
with (as_timestamp(states.binary_sensor.master_bedroom_multisensor_sensor.last_changed | default(0))) | int
this will ensure that should you have no data for one of your sensors (yet) it won’t throw an error message
yes you would. and if the automation is off and it still pops up then it’s not this one.
Still a good thing to have to avoid future errors (I’m in the process of doing this for all my automations)
Not sure what else could be generating this error message, as it does look like it’s a condition related one from an automation. Sorry…
You’re looking in the wrong place. Do you have a template sensor that acts as an alarm clock? The templates you just posted aren’t using the timestamp attribute. If I recall correctly, the only states object that has that attribute is in the input_datetime domain.
after playing around by turning off automations I have tracked the error down to the Alarm Clock package. This previously did not create errors before I upgraded to 0.78.3. could someone please help me fix the issue in the above alarm clock code?
I figured it out. Due to a HA server crash last week I didn’t have a value set for the alarm clock input_datetime. I have now entered a value and it seems to be happy
value: "{{ trigger.to_state.attributes.volume_level | multiply(100) | int }}"
if you change that to pull directly from the entity_id instead of the trigger object, you won’t get that error. That error shouldn’t appear anyways because the trigger.to_state.attributes should always have volume_level. So something else is causeing that to trigger, probably on startup. So you could ignore the error. But anyways, the 2 ways to fix it are:
value: "{{ state_attr('media_player.receiver', 'volume_level') | multiply(100) | int }}"
Hi.
I’m having a similar problem.
Every minute I get:
2020-02-16 21:18:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-02-16 21:19:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-02-16 21:20:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-02-16 21:21:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-02-16 21:22:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-02-16 21:23:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-02-16 21:24:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-02-16 21:25:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-02-16 21:26:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-02-16 21:27:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-02-16 21:28:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-02-16 21:29:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
I spent the whole sunday looking for a fix, but I didn’t find the cause yet.
In logbook I can’t see anything triggering each minute.
I tried to exclude some packges and i tried to follow every suggestion found by googling, but the error is still there.
I really don’t how to find where the problem is.
I tried to apply this to some templates:
this is a templating error and it’s basically saying that HA cannot find attributes in an empty object.
So you need to look through all your templates in which you use `states.<entity_id>.attributes.<attr>` . One of those is giving you problems. And the problem is, that `<entity_id>` is bad or the component has not set it up yet.
typically you can prevent this in templates by adding an if statement wrapped around your object:
Copy to clipboard
{% if states.device.domain %}
{{ states.device.domain.attributes.attr }}
{% else %}
Unknown
{% endif %}
But the problem did not go away.
I checked all my automation to find if I used a template in some condition.
I searched in all yaml file for “.attributes.” and I commented or put an if condition in al recurrencies.
Can someone help me in finding where the problem is?
Thank you very much.