How to find config error?

Hi,

I am getting this error on Hass.io startup. Everything works … But this error is making me crazy
Can anyone push me to the correct direction how to solve it or how find what is causing it?

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/automation/__init__.py", line 283, in async_trigger
    if skip_condition or self._cond_func(variables):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/automation/__init__.py", line 398, in if_action
    return all(check(hass, variables) for check in checks)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/automation/__init__.py", line 398, in <genexpr>
    return all(check(hass, variables) for check in checks)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/condition.py", line 352, in template_if
    return async_template(hass, value_template, variables)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/condition.py", line 331, in async_template
    value = value_template.async_render(variables)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/template.py", line 140, in async_render
    return self._compiled.render(kwargs).strip()
  File "/usr/local/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in top-level template code
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'

Not sure, but i assume a value_template (maybe template sensor) that converts a value (float) from an entity that needs some time on startup.
Check your config for

... | float ...

I could also be wrong with this!

Thank you for suggestion. I found 5 entries with this function … comented them out … but no luck, error still shows up in log

Do you have NoneType in your configuration anywhere?

I think I found what you meantioned. I mean entity that on startup has ‘null’ value.
last_triggered has ‘null’ value
Is there a way to avoid it?

'{{ (as_timestamp(now()) - 
 as_timestamp(states.automation.restart_ffmpeg.attributes.last_triggered))
      >5}}'

Yes!

{% if states.automation.restart_ffmpeg.attributes.last_triggered %}
  {{ (as_timestamp(now()) - as_timestamp(states.automation.restart_ffmpeg.attributes.last_triggered)) > 5 }}
{% else %}
  False
{% endif %}
2 Likes

Kudos to you !!!
Error is no more

1 Like