HI Phil, aware you have lost time for all things important, so just letting you know I notice a new (think…) issue in the logs, after having updated to HA 116:
Error while processing state changed for device_tracker.me
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 251, in _async_state_change_dispatcher
hass.async_run_job(action, event)
File "/usr/src/homeassistant/homeassistant/core.py", line 384, in async_run_job
target(*args)
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 844, in _refresh
update = self._render_template_if_ready(track_template_, now, event)
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 819, in _render_template_if_ready
self._info[template] = template.async_render_to_info(track_template_.variables)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 401, in async_render_to_info
render_info._result = self.async_render(variables, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 332, in async_render
return compiled.render(kwargs).strip()
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/usr/local/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "<template>", line 4, in top-level template code
File "/usr/local/lib/python3.8/site-packages/jinja2/sandbox.py", line 462, in call
return __context.call(__obj, *args, **kwargs)
TypeError: tzinfo argument must be None or of a tzinfo subclass, not type 'Undefined'
and this is what’s in the Log viewer:
TemplateError('TypeError: tzinfo argument must be None or of a tzinfo subclass, not type 'Undefined'') while processing template 'Template("{% set state = states.device_tracker.me %} {% if state.attributes is not none and state.attributes.time_zone is not none and state.attributes.time_zone != 'unknown' %} {% set n = now() %} {{(n.astimezone(state.attributes.last_seen.tzinfo).utcoffset() - n.utcoffset()).total_seconds()/3600}} {% else %} undetermined {% endif %}")' for attribute '_state' in entity 'sensor.marijn_tz_offset'
have also tried to add a condition
value_template: >
{% set state = states.device_tracker.me %}
{% if state.attributes is not none and
state.attributes.time_zone is not none and
state.attributes.time_zone != 'unknown' and
state.attributes.time_zone is defined %}
{% set n = now() %}
{{(n.astimezone(state.attributes.last_seen.tzinfo).utcoffset() -
n.utcoffset()).total_seconds()/3600}}
{% else %}
undetermined
{% endif %}
but none of these seem to prevent this from happening.
my config hasn’t changed in ages for this device_tracker, so maybe the HA update could have caused this?
seems the tracker is fine though (will have to see tomorrow when I move again ( ), so this could be a startup issue.
edit
no its definitely not a startup issue, happening at random (unexpected) moments. Maybe related to 116/117 (been running the beta’s for several days and still happening)