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

Issues after update to 2024.9 even with v2.2.0 - Template error: float got invalid input 'unavailable' when rendering template #335

Open
f45tb00t opened this issue Dec 7, 2023 · 9 comments

Comments

@f45tb00t
Copy link

f45tb00t commented Dec 7, 2023

Hi,

first of all: Thank you for this great work. This integration is pretty much AWESOME! :)

Since my update yesterday to the HA version 2023.12.0 I have several issues in the logs and the integration cannot be loaded. I did not have time to investigate more the issue, was on a business trip and just came back - sorry for that.
But maybe you have an idea what it could be.

2023-12-07 16:09:14.021 ERROR (MainThread) [homeassistant.config] Error importing config platform thermal_comfort: cannot import name 'async_log_exception' from 'homeassistant.config' (/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config.py)
2023-12-07 16:09:14.021 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'thermal_comfort': Invalid config.
2023-12-07 16:09:41.214 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ ( float(states('sensor.thermal_comfort_wohnzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=2>
ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_wohnzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_wohnzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
2023-12-07 16:09:41.221 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_wohnzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified') while processing template 'Template<template=({{ ( float(states('sensor.thermal_comfort_wohnzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.absolute_luftfeuchtigkeit_unterschied_wohnzimmer_aussen'
2023-12-07 16:09:41.221 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ ( float(states('sensor.thermal_comfort_kueche_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=2>
ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_kueche_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_kueche_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
2023-12-07 16:09:41.225 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_kueche_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified') while processing template 'Template<template=({{ ( float(states('sensor.thermal_comfort_kueche_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.absolute_luftfeuchtigkeit_unterschied_kuche_aussen'
2023-12-07 16:09:41.226 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ ( float(states('sensor.thermal_comfort_arbeitszimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=2>
ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_arbeitszimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_arbeitszimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
2023-12-07 16:09:41.229 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_arbeitszimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified') while processing template 'Template<template=({{ ( float(states('sensor.thermal_comfort_arbeitszimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.absolute_luftfeuchtigkeit_unterschied_arbeitszimmer_aussen'
2023-12-07 16:09:41.230 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ ( float(states('sensor.thermal_comfort_badezimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=2>
ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_badezimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_badezimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
2023-12-07 16:09:41.233 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_badezimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified') while processing template 'Template<template=({{ ( float(states('sensor.thermal_comfort_badezimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.absolute_luftfeuchtigkeit_unterschied_badezimmer_aussen'
2023-12-07 16:09:41.233 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ ( float(states('sensor.thermal_comfort_kinderzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=2>
ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_kinderzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_kinderzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
2023-12-07 16:09:41.236 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_kinderzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified') while processing template 'Template<template=({{ ( float(states('sensor.thermal_comfort_kinderzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.absolute_luftfeuchtigkeit_unterschied_kinderzimmer_aussen'
2023-12-07 16:09:41.236 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ ( float(states('sensor.thermal_comfort_schlafzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=2>
ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_schlafzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_schlafzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
2023-12-07 16:09:41.239 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ ( float(states('sensor.thermal_comfort_schlafzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified') while processing template 'Template<template=({{ ( float(states('sensor.thermal_comfort_schlafzimmer_absolute_humidity')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.absolute_luftfeuchtigkeit_unterschied_schlafzimmer_aussen'
@rautesamtr
Copy link
Collaborator

Hi, you need to update to 2.2.0

@f45tb00t
Copy link
Author

f45tb00t commented Dec 8, 2023

Hi,

as mentioned in the subject I upgraded already to v2.2.0?

What I did to update. Download, extracted and moved the files and folders to ~/.homeassistant/custom_components/thermal_comfort

@rautesamtr
Copy link
Collaborator

rautesamtr commented Dec 8, 2023

So you just extracted the new files over the old ones?
Then delete config.py from the thermal_comfort folder, it's a left over from the previous version.
Or better, always delete the old thermal_comfort before extracting the new one.

This indicates the leftover:

2023-12-07 16:09:14.021 ERROR (MainThread) [homeassistant.config] Error importing config platform thermal_comfort: cannot import name 'async_log_exception' from 'homeassistant.config' (/srv/homeassistant/lib/python3.11/site-packages/homeassistant/config.py)

The template errors are just there because thermal_comfort isn't loaded because of the config.py error so your templates aren't working.

@f45tb00t
Copy link
Author

f45tb00t commented Dec 8, 2023

Or better, always delete the old thermal_comfort before extracting the new one.

Hi,

I did it this way now. Issue solved. Thanks a lot! :)

@f45tb00t f45tb00t closed this as completed Dec 8, 2023
@f45tb00t f45tb00t reopened this Oct 3, 2024
@f45tb00t
Copy link
Author

f45tb00t commented Oct 3, 2024

Hi,

it seems the issue came up again.

homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ ( float(states('sensor.thermal_comfort_garage_absolute_luftfeuchtigkeit')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified
2024-10-03 14:34:33.795 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ ( float(states('sensor.thermal_comfort_garage_absolute_luftfeuchtigkeit')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}' but no default was specified') while processing template 'Template<template=({{ ( float(states('sensor.thermal_comfort_garage_absolute_luftfeuchtigkeit')) - float(states('sensor.thermal_comfort_draussen_absolute_humidity')) ) | float | round (2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.absolute_luftfeuchtigkeit_unterschied_garage_aussen'

@f45tb00t f45tb00t changed the title Issues after update to 2023.12, even with v2.2.0 - Template error: float got invalid input 'unavailable' when rendering template Issues after update to 2024.9 even with v2.2.0 - Template error: float got invalid input 'unavailable' when rendering template Oct 3, 2024
@f45tb00t
Copy link
Author

f45tb00t commented Oct 9, 2024

Any direction please to fix this issue?

@DenisLanz
Copy link

I've stumbled over the same issue, that I'm unable to utilize the sensor data in an automation. The return value can't be handled:

Template error: float got /alid input 'unknown' when rendering template 'K (float(states('sensor.tc_office_absolute_humidity')) - float(states('sensor.tc_outside_absolute_humidity'))) | float | round (2) }}' but no default was specified')

@f45tb00t
Copy link
Author

@rautesamtr @dolezsa Any advise how we can fix that?

@DenisLanz
Copy link

Still struggling to use thermal comfort for automations. Can we somehow support to debug and resolve this?

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

3 participants