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

Entity has no attributes #2

Open
wapebira opened this issue Feb 7, 2022 · 1 comment
Open

Entity has no attributes #2

wapebira opened this issue Feb 7, 2022 · 1 comment

Comments

@wapebira
Copy link

wapebira commented Feb 7, 2022

This is my config,
sensor:

  • platform: meteorologic_metrics
    name: "Meteorologic Metrics" # optional, use if you want to use mulitple instances
    temp: sensor.lumi_weather_outside_temperature_01 # celsius
    hum: sensor.lumi_weather_outside_humidity_01 # celsius
    dew: sensor.acasa_dew_point # required if you want WBT estimated with dewpoint depression
    pressure: sensor.lumi_weather_outside_pressure_01

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
Copy link
Owner

danobot commented Feb 10, 2022

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

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

2 participants