dolezsa / thermal_comfort

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

It stopped working after HA update #150

Closed fistac closed 2 years ago

fistac commented 2 years ago

Hi. I have been using this sensor for some time. Today I did an update of the home assistant to the 2022.3.8 version. And now the sensor is not working.

Here is an example error from the home-assistant.log

2022-03-29 18:55:48 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.fiord_absolutehumidity fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 535, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 744, in async_device_update
    raise exc
  File "/config/custom_components/thermal_comfort/sensor.py", line 444, in async_update
    self._attr_native_value = await getattr(self._device, self._sensor_type)()
  File "/config/custom_components/thermal_comfort/sensor.py", line 259, in wrapped
    return getattr(self, f"_{sensor_type}")
AttributeError: 'DeviceThermalComfort' object has no attribute '_absolute_humidity'
2022-03-29 18:55:48 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.fiord_dewpoint fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 535, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 744, in async_device_update
    raise exc
  File "/config/custom_components/thermal_comfort/sensor.py", line 444, in async_update
    self._attr_native_value = await getattr(self._device, self._sensor_type)()
  File "/config/custom_components/thermal_comfort/sensor.py", line 259, in wrapped
    return getattr(self, f"_{sensor_type}")
AttributeError: 'DeviceThermalComfort' object has no attribute '_dew_point'
2022-03-29 18:55:48 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.fiord_frostpoint fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 535, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 744, in async_device_update
    raise exc
  File "/config/custom_components/thermal_comfort/sensor.py", line 444, in async_update
    self._attr_native_value = await getattr(self._device, self._sensor_type)()
  File "/config/custom_components/thermal_comfort/sensor.py", line 259, in wrapped
    return getattr(self, f"_{sensor_type}")
AttributeError: 'DeviceThermalComfort' object has no attribute '_frost_point'
2022-03-29 18:55:48 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.fiord_frostrisk fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 535, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 744, in async_device_update
    raise exc
  File "/config/custom_components/thermal_comfort/sensor.py", line 440, in async_update
    level = await getattr(self._device, self._sensor_type)()
  File "/config/custom_components/thermal_comfort/sensor.py", line 259, in wrapped
    return getattr(self, f"_{sensor_type}")
AttributeError: 'DeviceThermalComfort' object has no attribute '_frost_risk'
2022-03-29 18:55:48 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.fiord_heatindex fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 535, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 744, in async_device_update
    raise exc
  File "/config/custom_components/thermal_comfort/sensor.py", line 444, in async_update
    self._attr_native_value = await getattr(self._device, self._sensor_type)()
  File "/config/custom_components/thermal_comfort/sensor.py", line 259, in wrapped
    return getattr(self, f"_{sensor_type}")
AttributeError: 'DeviceThermalComfort' object has no attribute '_heat_index'
2022-03-29 18:55:48 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.fiord_simmerindex fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 535, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 744, in async_device_update
    raise exc
  File "/config/custom_components/thermal_comfort/sensor.py", line 444, in async_update
    self._attr_native_value = await getattr(self._device, self._sensor_type)()
  File "/config/custom_components/thermal_comfort/sensor.py", line 259, in wrapped
    return getattr(self, f"_{sensor_type}")
AttributeError: 'DeviceThermalComfort' object has no attribute '_simmer_index'
2022-03-29 18:55:48 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.fiord_simmerzone fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 535, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 744, in async_device_update
    raise exc
  File "/config/custom_components/thermal_comfort/sensor.py", line 444, in async_update
    self._attr_native_value = await getattr(self._device, self._sensor_type)()
  File "/config/custom_components/thermal_comfort/sensor.py", line 259, in wrapped
    return getattr(self, f"_{sensor_type}")
AttributeError: 'DeviceThermalComfort' object has no attribute '_simmer_zone'
2022-03-29 18:55:48 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.fiord_perception fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 535, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 744, in async_device_update
    raise exc
  File "/config/custom_components/thermal_comfort/sensor.py", line 444, in async_update
    self._attr_native_value = await getattr(self._device, self._sensor_type)()
  File "/config/custom_components/thermal_comfort/sensor.py", line 259, in wrapped
    return getattr(self, f"_{sensor_type}")
AttributeError: 'DeviceThermalComfort' object has no attribute '_thermal_perception'

I tried to update the sensor to the newest version, but this didn't help.

rautesamtr commented 2 years ago

Hi, what configuration method do you use?

fistac commented 2 years ago

My first working configuration was like this:

sensor:
  platform: thermal_comfort
  sensors:
    fiord:
      friendly_name: Fiord
      temperature_sensor: sensor.t_h_fiord_temperature
      humidity_sensor: sensor.t_h_fiord_humidity
      unique_id: c080e7cd-9ec7-451f-b044-232604efbeee

After the Home Assistant update, it stopped working. I updated the sensor. That didn't help. Next I tried to configure it using this method: https://github.com/dolezsa/thermal_comfort/blob/master/documentation/config_flow.md

It still wasn't working. Then I checked the logs - there were errors I mentioned in the previous post. At this point, I opened this issue.

Next, I tried many things. I removed the integration from the UI, custom_components, removed sensor entities, and cleared the yaml. Did many restarts of the HA. Restarted the HA docker.

I copied the integration to custom_components again. After restart I'm not able to configure it via UI - there is no Thermal Comfort integration on the list. But, I inserted my old configuration to yaml and the sensors are working now! Unfortunately, I don't know why.