tadasdanielius / daikin_altherma

Daikin Altherma custom component for home assistant
MIT License
71 stars 5 forks source link

Values not refreshing #68

Closed n-florin closed 1 year ago

n-florin commented 1 year ago

Hello, I have a BRP069A62 on a EHBH08DAV6 / ERGA08DAV3 heat pump with an external boiler connected via EKHY3PART. The values are retrieved only when reloading the integration. Otherwise I get the following error.

Do you know what could cause this?

Logger: homeassistant Source: custom_components/daikin_altherma/sensor.py:108 Integration: Daikin Altherma HVAC (documentation, issues) First occurred: April 18, 2023 at 8:24:11 PM (36012 occurrences) Last logged: 4:40:15 PM

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 193, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 341, in _async_refresh self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 142, in async_update_listeners update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 401, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 568, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 632, in _async_write_ha_state state = self._stringify_state(available) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 574, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 470, in state value = self.native_value File "/config/custom_components/daikin_altherma/sensor.py", line 108, in native_value return round(status, 2) TypeError: type NoneType doesn't define round method

tadasdanielius commented 1 year ago

Difficult to say why it is not getting new values but what you could try is to change the line and see which sensors are failing in your config folder go to custom_components/daikin_altherma find the file sensor.py and change the line 108 from

return round(status, 2)

to

return None if status is None else round(status, 2)

And then restart the HA. And check the sensors.

n-florin commented 1 year ago

I’ve added this change, the errors are gone and the sensors started to update. It looks like I get a value (instead of None) only when a sensor value changes from the previous state. Thus some sensors update every 30 seconds while others every 1-4 hours when there is a change.

If you need more data to better understand this I can help.

I am pleased with how it works now. When I find the time probably I will add some logs and see the data flow. Thank you!