Pyhass / Hive-Custom-Component

A custom version of the home assistant hive component
MIT License
33 stars 17 forks source link

[BUG] Error adding entities for domain climate with platform hive #83

Closed sym0nd0 closed 3 years ago

sym0nd0 commented 3 years ago

Describe the bug Having just carried out a fresh clean install of HA and reinstalled this custom component and the Hive integration, which all worked perfectly. However, following a restart of the server I've started to see the following in my HA logs and thermostats/TRVs showing as unavailable:

Logger: homeassistant.components.climate
Source: components/hive/climate.py:159
Integration: Climate (documentation, issues)
First occurred: 22:00:15 (2 occurrences)
Last logged: 22:00:15

Error adding entities for domain climate with platform hive
Error while setting up hive platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 322, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 429, in _async_add_entity
    capabilities=entity.capability_attributes,
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 192, in capability_attributes
    self.hass, self.min_temp, self.temperature_unit, self.precision
  File "/usr/src/homeassistant/homeassistant/components/hive/climate.py", line 159, in min_temp
    return self.device["min_temp"]
KeyError: 'min_temp'

I've also noticed that my devices are now going offline within the Hive app, following installation of this custom component and the Hive integration, resulting in the following errors in the log:

Logger: apyhiveapi.helper.logger
Source: /usr/local/lib/python3.8/site-packages/apyhiveapi/helper/logger.py:88
First occurred: 22:00:15 (9 occurrences)
Last logged: 22:00:15

Device offline could not update entity - Landing radiator
Device offline could not update entity - Lounge radiator
Device offline could not update entity - Office radiator
Device offline could not update entity - Upstairs
Device offline could not update entity - Washroom radiator

To Reproduce Steps to reproduce the behaviour:

  1. Install Home Assistant OS on Raspberry Pi 4 (4Gb)
  2. Install this custom component
  3. Install the Hive integration
  4. Rejoice, everything works as expected
  5. Restart server
  6. Wail as some, not all, thermostats/TRVs show unavailable
  7. Restart server
  8. Sob a little as it's still happening
  9. Reboot host
  10. Swear quite a lot and triple check everything
  11. Sink in to misery

Expected behaviour All thermostats and TRVs to display correctly and react within HA.

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

Additional context

I'm not really sure if I should have raised this here or core, so if it should be the other please let me know and I'll close this and reopen in the right place.

If you need any more info/data let me know.

Thanks

sym0nd0 commented 3 years ago

To add to this, I've since removed the custom component, uninstalled the integration and then, following a reboot of the host, installed the standard HA Hive integration alone and the errors are no longer occurring in my logs, I can fully control my heating through HA and none of my 'stats or TRVs are going offline in the Hive app.

Problem appears to be with the custom component.

KJonline commented 3 years ago

@sym0nd0 That’s interesting, I don’t think this is bug then and more of a situational issue at the time.

If you advise now that it works after removing the custom component. All the customs component does in 2021.4.0 is import the official integration code.

1E501A79-581E-4C53-81CA-264D4BC8432F