Ernst79 / degree-days

Integration that determines (weighted) degree days, gas consumption per degree day and a gas prognose for the current year based on weather info from the KNMI and your gas consumption.
MIT License
7 stars 3 forks source link

ValueError: Sensor sensor.gas_consumption_per_weighted_degree_day has device class 'gas', ..., but 'unavailable' #16

Closed bakboord4 closed 1 year ago

bakboord4 commented 1 year ago

Unable to use this integration. Sensors: sensor.gas_consumption_per_weighted_degree_day and sensor.gas_prognose are not available due to errors.

error log.

Logger: homeassistant.components.sensor Source: components/sensor/init.py:585 Integration: Sensor (documentation, issues) First occurred: 18 juni 2023 om 17:20:11 (2 occurrences) Last logged: 18 juni 2023 om 17:20:11

Error adding entities for domain sensor with platform degree_days Error while setting up degree_days platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 583, in state numerical_value = float(value) # type:ignore[arg-type] ^^^^^^^^^^^^ ValueError: could not convert string to float: 'Unavailable'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 471, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 749, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 850, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in _async_write_ha_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 596, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 585, in state raise ValueError( ValueError: Sensor sensor.gas_consumption_per_weighted_degree_day has device class 'gas', state class 'total' unit 'm³' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'Unavailable' (<class 'str'>)

System. Home Assistant 2023.6.2 Supervisor 2023.06.2 Operating System 10.2 Frontend-versie: 20230608.0 - latest

bakboord4 commented 1 year ago

I close this issue.

Ernst79 commented 1 year ago

I can confirm that this is an issue. Working on an update right now.