explosivo22 / rinnaicontrolr-ha

Rinnai Control-R integration for Home Assistant
Apache License 2.0
54 stars 4 forks source link

Entity unavailable issues and no updates #50

Closed davidcoulson closed 1 year ago

davidcoulson commented 1 year ago

Since updating to 1.3.6 my water_heater entity is 'unavailable' and my other entities are not updating correctly. I found this in the logs, but can't specifically track down what is wrong with the water_heater entitiy.

I'm running 2022.12.1, but it did the same thing with 2022.11.5.

Not sure how to get better debug info out of this integration?

2022-12-09 09:28:39.273 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.silver_tree_outlet_temperature fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 527, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 722, in async_device_update
    raise exc
  File "/config/custom_components/rinnai/entity.py", line 46, in async_update
    await self._device.async_request_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 175, in async_request_refresh
    await self._debounced_refresh.async_call()
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 82, in async_call
    await task
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 201, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 316, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 121, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/water_heater/__init__.py", line 243, in state_attributes
    is_away = self.is_away_mode_on
  File "/config/custom_components/rinnai/water_heater.py", line 97, in is_away_mode_on
    return self._device.vacation_mode_on
  File "/config/custom_components/rinnai/device.py", line 134, in vacation_mode_on
    return strtobool(str(self._device_information["data"]["getDevice"]["shadow"]["schedule_holiday"]))
  File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/util.py", line 353, in strtobool
    raise ValueError("invalid truth value {!r}".format(val))
davidcoulson commented 1 year ago

I rolled back to 1.3.4 and it works fine. 1.3.5 gives me this:

2022-12-09 09:52:10.866 ERROR (MainThread) [homeassistant.components.water_heater] Error while setting up rinnai platform for water_heater
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/water_heater/__init__.py", line 243, in state_attributes
    is_away = self.is_away_mode_on
  File "/config/custom_components/rinnai/water_heater.py", line 97, in is_away_mode_on
    return self._device.vacation_mode_on
  File "/config/custom_components/rinnai/device.py", line 130, in vacation_mode_on
    return strtobool(str(self._device_information["data"]["getDevice"]["shadow"]["schedule_holiday"]))
  File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/util.py", line 353, in strtobool
    raise ValueError("invalid truth value {!r}".format(val))
ValueError: invalid truth value 'none'
explosivo22 commented 1 year ago

Can you try out 1.3.7-beta? I am hoping this fixes your issue.

davidcoulson commented 1 year ago

Can you try out 1.3.7-beta? I am hoping this fixes your issue.

Looks good. Water heater entity shows data now. I'll test my automations and make sure everything is ad expected, but looks like this fixed it. Thanks!

explosivo22 commented 1 year ago

Great. I am glad it's working again for you. I will close this out as this fixed it and it will be included in the next full release as well.