danobot / meteorologic_metrics

This component calculates psychrometric states of moist air using ASHRAE 2009 Fundamentals formulations. Atmospheric pressure, and humidity must be given to calculate the other propreties.
https://danielbkr.net/projects
4 stars 2 forks source link

Entity has no attributes #2

Open wapebira opened 2 years ago

wapebira commented 2 years ago

This is my config, sensor:

getting no attributes but just "Unknown"

image

from the logs

`Logger: homeassistant Source: custom_components/meteorologic_metrics/helpers.py:9 Integration: meteorologic_metrics (documentation) First occurred: 08:51:39 (25 occurrences) Last logged: 09:03:39

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 734, in _update_entity_states await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 492, in async_update_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 541, in _async_write_ha_state extra_state_attributes = self.extra_state_attributes File "/config/custom_components/meteorologic_metrics/sensor.py", line 83, in extra_state_attributes "SI wet bulb temp C": round(toC(S[5]), 2), File "/config/custom_components/meteorologic_metrics/helpers.py", line 9, in toC return celsius - KELVIN_CONVERSION TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'`

danobot commented 2 years ago

It looks like the other sensors have Unknown values as well, this is what is causing the NoneType error.