We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I have for several month a sensor constructed such as:
- platform: attributes friendly_name: "Last Month" attribute: "Last month" device_class: energy unit_of_measurement: "kWh" round_to: 1 entities: - sensor.myenedis_xxx
and some other with the same philosophy
Recently, in the log, I receive a lot of:
2024-04-14 11:31:57.457 ERROR (MainThread) [custom_components.attributes.sensor] Could not attribute sensor for sensor.myenedis_xxx: ValueError: Template error: float got invalid input 'None' when rendering template '{% if states('sensor.myenedis_xxx') != 'unknown' and states('sensor.myenedis_xxx') != 'unavailable' %}{{ (state_attr('sensor.myenedis_xxx', 'Last month') | float) | round(1) }}{% else %} unknown {% endif %}' but no default was specified
which is quite understandable, the sensor sometimes outputs None
Is there a way to avoid it?
The text was updated successfully, but these errors were encountered:
Yes, there is. The code needs adjustments
Sorry, something went wrong.
No branches or pull requests
Hi,
I have for several month a sensor constructed such as:
and some other with the same philosophy
Recently, in the log, I receive a lot of:
which is quite understandable, the sensor sometimes outputs None
Is there a way to avoid it?
The text was updated successfully, but these errors were encountered: