home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.58k stars 29.91k forks source link

Issue with Hive Integrations and TRV valves #125956

Open uktricky opened 5 days ago

uktricky commented 5 days ago

The problem

Had an issue with HA Hive Integration, after a reload I noticed it was showing "No devices or entities" So removed the integration and attempted to re-add, logged into my Hive account and enter the 2FA code Now I am still getting the "No devices or entities" Everything was working fine ... Only change I've made is replacing a TRV after a failure of the old one.

Debug logs has: 2024-09-14 14:52:57.756 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry "MYEMAIL ADDRESS" for hive Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 390, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/hive/init.py", line 89, in async_setup_entry devices = await hive.session.startSession(hive_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/apyhiveapi/session.py", line 510, in startSession return await self.createDevices() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/apyhiveapi/session.py", line 534, in createDevices eval("self." + code) File "", line 1, in File "/usr/local/lib/python3.11/site-packages/apyhiveapi/session.py", line 131, in addList device = self.helper.getDeviceData(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/apyhiveapi/helper/hive_helper.py", line 98, in getDeviceData device = self.session.data.devices[product["props"]["trvs"][0]]



### What version of Home Assistant Core has the issue?

core-2023.7.0

### What was the last working version of Home Assistant Core?

core-2023.7.0

### What type of installation are you running?

Home Assistant Container

### Integration causing the issue

Hive Integration

### Link to integration documentation on our website

_No response_

### Diagnostics information

_No response_

### Example YAML snippet

_No response_

### Anything in the logs that might be useful for us?

_No response_

### Additional information

_No response_
uktricky commented 5 days ago

I've updated to 2024.9.1 without any difference - I suspect the issue is with the data held by Hive but the code should handle the problem?

home-assistant[bot] commented 5 days ago

Hey there @rendili, @kjonline, mind taking a look at this issue as it has been labeled with an integration (hive) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `hive` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign hive` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


hive documentation hive source (message by IssueLinks)

bushcraftytim commented 4 days ago

I've updated to 2024.9.1 without any difference - I suspect the issue is with the data held by Hive but the code should handle the problem?

Can you turn on and off the hive thermostat hot water? I can’t do that any longer.

uktricky commented 4 days ago

I've updated to 2024.9.1 without any difference - I suspect the issue is with the data held by Hive but the code should handle the problem?

Can you turn on and off the hive thermostat hot water? I can’t do that any longer.

Nothing Hive related is available in HA now. The Hive app appears to still control boiler, lights etc - I don't have separate Hot Water control/system.

uktricky commented 4 days ago

Hey there @Rendili, @KJonline, mind taking a look at this issue as it has been labeled with an integration (hive) you are listed as a code owner for? Thanks!

Code owner commands (message by CodeOwnersMention)

hive documentation hive source (message by IssueLinks)

This is the data Hive returns using another script I found - Other TRV's show an ID in the TRV [] and CONSUMERS [] if that helps your debugging of the issue? I've masked off the ID/Parent ID's

 "id": "fa201423-4634-43e7-a2f2-dcecd7xxxxxxx",
  "type": "trvcontrol",
  "sortOrder": 1,
  "created": 1724056415871,
  "parent": "07380078-9b03-4152-8e80-88c381xxxxxx",
  "props": {
    "online": false,
    "version": "00000000",
    "upgrade": {
      "available": false,
      "upgrading": false
    },
    "parent": "fa201423-4634-43e7-a2f2-dcecxxxxx",
    "capabilities": [
      "HOLIDAY_MODE",
      "BOOST",
      "TRV_AUTO_BOOST_READY"
    ],
    "maxEvents": 6,
    "pmz": "OK",
    "working": false,
    "trvs": [],
    "consumers": [],
    "previous": {},
    "zoneName": "Bedroom Radiator"
  },
  "state": {
    "name": "Bedroom Radiator",
    "frostProtection": 7,
    "schedule": {
      "monday": [
        {
          "value": {
            "target": 20
          },
KJonline commented 3 days ago

@uktricky would you know if this from hives product api or device api endpoint?

uktricky commented 3 days ago

@KJonline - I used "https://github.com/JonEllis/hivereader" which suggest the PyHiveAPI

uktricky commented 3 days ago

For info - hive removed the device from my account this morning and the integration loaded successfully afterwards so definitely a data handling issue for the null returns.