dolezsa / thermal_comfort

Thermal Comfort sensor for HA (absolute humidity, heat index, dew point, thermal perception)
Other
619 stars 118 forks source link

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 11 months ago

f45tb00t commented 11 months ago

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 commented 11 months ago

Hi, you need to update to 2.2.0

f45tb00t commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 1 month ago

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 commented 1 month ago

Any direction please to fix this issue?

DenisLanz commented 1 month ago

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 commented 1 month ago

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

DenisLanz commented 2 weeks ago

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