WJDDesigns / Ultra-Vehicle-Card

This custom card allows you to display vehicle information in your Home Assistant dashboard, including the vehicle name, image, and fuel or charge level.
Other
174 stars 17 forks source link

Issue after removing icon template #130

Closed mattdevo1 closed 2 weeks ago

mattdevo1 commented 2 weeks ago

I was messing around using the new template feature for showing icons in the grid. It wasn't really doing what I had hoped, so I removed them from the card config.

However, I'm now seeing the below errors in my core log.

Any idea how to get rid of this?

Probably a good idea to change the behavior for how this works to avoid future issues for others too.

Logger: homeassistant.helpers.event
Source: helpers/template.py:634
First occurred: 7:21:38 AM (13718 occurrences)
Last logged: 7:21:53 AM

Error while processing template: Template<template=({{ states('sensor.teslarossa_tire_pressure_rear_right') | float < 39 }}) renders=6480>
Error while processing template: Template<template=({{ states('sensor.teslarossa_tire_pressure_front_left') | float < 39 }}) renders=28276>
Error while processing template: Template<template=({{ states('sensor.teslarossa_tire_pressure_front_right') | float < 39 }}) renders=10068>
Error while processing template: Template<template=({{ states('sensor.teslarossa_tire_pressure_rear_left') | float < 39 }}) renders=8532>
Error while processing template: Template<template=({{ states('sensor.teslarossa_tire_pressure_rear_right') | float < 39 }}) renders=6482>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2348, in forgiving_float_filter
    return float(value)
           ^^^^^^^^^^^^
ValueError: could not convert string to float: 'unknown'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 632, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2729, in _render_with_context
    return template.render(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.12/site-packages/jinja2/environment.py", line 939, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2351, in forgiving_float_filter
    raise_no_default("float", value)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1905, in raise_no_default
    raise ValueError(
ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ states('sensor.teslarossa_tire_pressure_front_left') | float < 39 }}' but no default was specified

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 749, in async_render_to_info
    render_info._result = self.async_render(  # noqa: SLF001
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 634, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ states('sensor.teslarossa_tire_pressure_front_left') | float < 39 }}' but no default was specified
WJDDesigns commented 2 weeks ago

Try updating to the newest beta to see if all the issues you had go away, thanks!

mattdevo1 commented 2 weeks ago

That seemed to do the trick. Thanks!