Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sensor.total_imported_energy_cost error #1

Open
RafAustralia opened this issue Jun 12, 2024 · 0 comments
Open

sensor.total_imported_energy_cost error #1

RafAustralia opened this issue Jun 12, 2024 · 0 comments

Comments

@RafAustralia
Copy link
Owner

hi all

I am getting this error and not sure how to solve this so need some assistance please:

UNTIL TODAY, I HAVE NEVER POSTED ISSUES ON GITHUB SO MIGHT BE DOING IT ALL WRONG
Apologies in advance.

....................................................................................................................................

Logger: homeassistant.helpers.event
Source: helpers/template.py:605
First occurred: June 11, 2024 at 4:51:43 PM (2 occurrences)
Last logged: June 11, 2024 at 4:51:43 PM

Error while processing template: Template<template=({{ (states('sensor.total_imported_energy_cost')) | float |round(2) }}) renders=2>
Error while processing template: Template<template=({{ (states('sensor.total_exported_energy_compensation')) | float |round(2) }}) renders=2>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2239, 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 603, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2616, 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 "", line 1, in top-level template code
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2242, in forgiving_float_filter
raise_no_default("float", value)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1853, in raise_no_default
raise ValueError(
ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.total_imported_energy_cost')) | float |round(2) }}' 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 715, in async_render_to_info
render_info._result = self.async_render( # noqa: SLF001
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 605, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.total_imported_energy_cost')) | float |round(2) }}' but no default was specified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant