Pyhass / Hive-Custom-Component

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

Missing climate, sensor and switch entities #147

Open jay9883bea opened 1 year ago

jay9883bea commented 1 year ago

My Hive integration has suddenly stopped working. This happens occasionally and usually logging back in resolves the issue. However, in this case when I set the integration up again, only the Hub and a door sensor appear. The thermostat and a collection of plug sockets do not appear again, although I can see them in the Hive app.

Looking at the logs, I got the following message after a restart of HA:

2023-08-24 18:52:00.140 ERROR (MainThread) [homeassistant.components.climate] Error while setting up hive platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 362, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/hive/climate.py", line 64, in async_setup_entry
    entities.append(HiveClimateEntity(hive, dev))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/hive/climate.py", line 113, in __init__
    super().__init__(hive_session, hive_device)
  File "/usr/src/homeassistant/homeassistant/components/hive/__init__.py", line 157, in __init__
    model=self.device["deviceData"]["model"],
          ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'model'
2023-08-24 18:52:00.149 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up hive platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 362, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/hive/sensor.py", line 96, in async_setup_entry
    entities.append(HiveSensorEntity(hive, dev, description))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/hive/sensor.py", line 105, in __init__
    super().__init__(hive, hive_device)
  File "/config/custom_components/hive/__init__.py", line 148, in __init__
    model=self.device["deviceData"]["model"],
          ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'model'
2023-08-24 18:52:00.154 ERROR (MainThread) [homeassistant.components.switch] Error while setting up hive platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 362, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/hive/switch.py", line 43, in async_setup_entry
    entities.append(HiveSwitch(hive, dev, description))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/hive/switch.py", line 52, in __init__
    super().__init__(hive, hive_device)
  File "/usr/src/homeassistant/homeassistant/components/hive/__init__.py", line 157, in __init__
    model=self.device["deviceData"]["model"],
          ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'model'
AdamOConnor commented 1 year ago

Hey @KJonline any news on the fix for this issue? Currently having the same problem

dnedeltchev commented 1 year ago

Me too

TheWartron commented 11 months ago

Do you have more than one hub/thermostat on your account? I rung hive and removed my old hub/thermostat from my login and that fixed it

dnedeltchev commented 11 months ago

I have only one hub but multiple thermostats as I have multiple zones. It all worked fine until it just stopped. The integration didn't start after a restart so I did the usual, reload integration which mostly works and when it doesn't work, I usually remove the integration and then add it back on which works every time. However, it does not work any more. If I add just the HA integration, I get all thermostat devices but all I see is their battery levels. If I add the custom component via hacs, I see only 1 device, the hub, and that's all. And the silence from @KJonline is unfortunate. I hope @KJonline is OK though...

dnedeltchev commented 11 months ago

Do you have more than one hub/thermostat on your account? I rung hive and removed my old hub/thermostat from my login and that fixed it

THANK YOU!!!!! I contacted Hive and indeed I had 5 offline / orphaned devices that were removed long time ago and were not visible in my account. So I'm not sure what happened on the Hive side but support removed all of those offline devices and it's now all back to normal. Again, thank you!!!!!