peribeir / homeassistant-rademacher

This custom integration provides access to Rademacher Devices connected to a HomePilot (or Start2Smart) bridge.
GNU General Public License v3.0
55 stars 8 forks source link

Rademacher Componentes not available after Restart #99

Closed nicknol closed 7 months ago

nicknol commented 7 months ago

Problem statement: The devices and entities of the Rademacher integration are not available anymore after a restart of homeassistant.

Reloading the integration doesn't resolve the issue. Deleting the integration and do the integration again resolves the issue. All formerly existing devices and entities are available again, and the dashboards continue to work.

I am using the Homepilot Premium Gateway. And I think it's version 2.01 of the integration.

I can't see anything related Rademacher in the usual logs of homeassistant.

Happy to provide anything needed to sort out the issue

peribeir commented 7 months ago

Hi @nicknol

Let's try to debug... If you go to HA Logs after the unsuccessful restart, can you try Settings->System->Logs and then click "Load Full Logs" in the bottom? And see if there are any errors?

nicknol commented 7 months ago

@peribeir thanks a lot for caring that fast! Appreciated in the full log I only found one reference to 'Rademacher': 2023-11-26 20:22:53.597 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration rademacher which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant which is not pointing to an issue.

There is no reference to the IP address of the gateway, nor its name.

any hint what to look out for?

peribeir commented 7 months ago

You can try enabling debug logging.

You can add the integration. Then go to Settings->Devices&Services->Rademacher HomePilot and then click "Enable debug logging". Then restart, wait for HomeAssistant to finish loading. Then go again to Rademacher HomePilot and "Disable debug logging".

The browser should download the log file. Please attach it here. If you don't feel confortable posting the complete log, then you can filter for the lines with [custom_components.rademacher]

nicknol commented 7 months ago

@peribeir, thanks again for caring and supporting fast 🙏 please find the log lines mentioning 'rademacher'

2023-11-26 21:53:09.302 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration rademacher which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2023-11-26 21:53:39.364 INFO (MainThread) [custom_components.rademacher] Manager instance created, found 7 devices
2023-11-26 21:53:39.364 DEBUG (MainThread) [custom_components.rademacher] Device IDs: ['1', '2', '3', '4', '5', '6', '-1']
2023-11-26 21:53:39.901 DEBUG (MainThread) [custom_components.rademacher] Finished fetching rademacher data in 0.536 seconds (success: True)
2023-11-26 21:53:39.901 INFO (MainThread) [custom_components.rademacher] Starting entry setup for each platform
2023-11-26 21:53:42.737 INFO (MainThread) [custom_components.rademacher.cover] Found Cover for Device ID: 1
2023-11-26 21:53:42.738 INFO (MainThread) [custom_components.rademacher.cover] Found Cover for Device ID: 2
2023-11-26 21:53:42.738 INFO (MainThread) [custom_components.rademacher.cover] Found Cover for Device ID: 3
2023-11-26 21:53:42.738 INFO (MainThread) [custom_components.rademacher.cover] Found Cover for Device ID: 4
2023-11-26 21:53:42.738 INFO (MainThread) [custom_components.rademacher.cover] Found Cover for Device ID: 5
2023-11-26 21:53:42.738 INFO (MainThread) [custom_components.rademacher.cover] Found Cover for Device ID: 6
2023-11-26 21:53:42.756 INFO (MainThread) [custom_components.rademacher.button] Found Ping Command Button for Device ID: 1
2023-11-26 21:53:42.757 INFO (MainThread) [custom_components.rademacher.button] Found Ping Command Button for Device ID: 2
2023-11-26 21:53:42.757 INFO (MainThread) [custom_components.rademacher.button] Found Ping Command Button for Device ID: 3
2023-11-26 21:53:42.757 INFO (MainThread) [custom_components.rademacher.button] Found Ping Command Button for Device ID: 4
2023-11-26 21:53:42.757 INFO (MainThread) [custom_components.rademacher.button] Found Ping Command Button for Device ID: 5
2023-11-26 21:53:42.757 INFO (MainThread) [custom_components.rademacher.button] Found Ping Command Button for Device ID: 6
2023-11-26 21:53:42.780 INFO (MainThread) [custom_components.rademacher.switch] Found Ventilation Position Config Switch for Device ID: 1
2023-11-26 21:53:42.780 INFO (MainThread) [custom_components.rademacher.switch] Found Ventilation Position Config Switch for Device ID: 2
2023-11-26 21:53:42.780 INFO (MainThread) [custom_components.rademacher.switch] Found Ventilation Position Config Switch for Device ID: 3
2023-11-26 21:53:42.780 INFO (MainThread) [custom_components.rademacher.switch] Found Ventilation Position Config Switch for Device ID: 4
2023-11-26 21:53:42.780 INFO (MainThread) [custom_components.rademacher.switch] Found Ventilation Position Config Switch for Device ID: 5
2023-11-26 21:53:42.780 INFO (MainThread) [custom_components.rademacher.switch] Found Ventilation Position Config Switch for Device ID: 6
2023-11-26 21:53:42.780 INFO (MainThread) [custom_components.rademacher.switch] Found Led Switch for Device ID: -1
2023-11-26 21:53:42.849 INFO (MainThread) [custom_components.rademacher.number] Found Ventilation Position Config for Device ID: 1
2023-11-26 21:53:42.850 INFO (MainThread) [custom_components.rademacher.number] Found Ventilation Position Config for Device ID: 2
2023-11-26 21:53:42.850 INFO (MainThread) [custom_components.rademacher.number] Found Ventilation Position Config for Device ID: 3
2023-11-26 21:53:42.850 INFO (MainThread) [custom_components.rademacher.number] Found Ventilation Position Config for Device ID: 4
2023-11-26 21:53:42.850 INFO (MainThread) [custom_components.rademacher.number] Found Ventilation Position Config for Device ID: 5
2023-11-26 21:53:42.850 INFO (MainThread) [custom_components.rademacher.number] Found Ventilation Position Config for Device ID: 6
2023-11-26 21:53:42.864 INFO (MainThread) [custom_components.rademacher.update] Found FW Update Sensor for Device ID: -1

2023-11-26 21:53:53.674 DEBUG (MainThread) [custom_components.rademacher] Finished fetching rademacher data in 0.551 seconds (success: True)
2023-11-26 21:54:05.538 DEBUG (MainThread) [custom_components.rademacher] Finished fetching rademacher data in 1.994 seconds (success: True)

Here what I see in the UI of the integration after a restart: grafik

in Developer tools I see the following for one of the shutters: grafik

nicknol commented 7 months ago

ID: -1 looks a bit weird.

http://homepilot-gateway/hp/devices lists devices from 0 to 6, ID 0-5 are the shutters and ID 6 is the gateway. Please find the output of http://homepilot-gateway/hp/devices below

{
  "error_description": "OK",
  "error_code": 0,
  "payload": {
    "devices": [
      {
        "capabilities": [
          {
            "name": "CURR_POS_CFG",
            "value": "0",
            "min_value": "0",
            "max_value": "100",
            "step_size": "1",
            "read_only": false
          },
          {
            "name": "PROD_CODE_DEVICE_LOC",
            "value": "10122345",
            "read_only": false
          },
          {
            "name": "REACHABILITY_EVT",
            "value": "true",
            "read_only": true,
            "timestamp": 1700995167
          },
          {
            "name": "NAME_DEVICE_LOC",
            "value": "Rollladen Balkon OG",
            "read_only": false
          },
          {
            "name": "PROT_ID_DEVICE_LOC",
            "value": "401bf0_1",
            "read_only": false
          },
          {
            "name": "INTF_ID_DEVICE_LOC",
            "value": "3",
            "read_only": false
          },
          {
            "name": "ICONSET_LOC",
            "value": "iconset8",
            "read_only": false
          },
          {
            "name": "DEVICE_TYPE_LOC",
            "value": "2",
            "read_only": false
          },
          {
            "name": "ICONSET_INV_LOC",
            "value": "false",
            "read_only": false
          },
          {
            "name": "ID_DEVICE_LOC",
            "value": "1",
            "read_only": false
          },
          {
            "name": "VIS_DEVICE_LOC",
            "value": "true",
            "read_only": false
          },
          {
            "name": "OBSTACLE_DET_EVT",
            "value": "false",
            "read_only": true,
            "timestamp": 1700995167
          },
          {
            "name": "BLOCK_DET_EVT",
            "value": "false",
            "read_only": true,
            "timestamp": 1700995167
          },
          {
            "name": "DESCR_DEVICE_LOC",
            "value": "Schlafzimmer Rollladen TĂĽr ",
            "read_only": false
          }
        ]
      },
      {
        "capabilities": [
          {
            "name": "CURR_POS_CFG",
            "value": "100",
            "min_value": "0",
            "max_value": "100",
            "step_size": "1",
            "read_only": false
          },
          {
            "name": "PROD_CODE_DEVICE_LOC",
            "value": "10122345",
            "read_only": false
          },
          {
            "name": "REACHABILITY_EVT",
            "value": "true",
            "read_only": true,
            "timestamp": 1701012628
          },
          {
            "name": "NAME_DEVICE_LOC",
            "value": "Rollladen Hartmut OG ",
            "read_only": false
          },
          {
            "name": "PROT_ID_DEVICE_LOC",
            "value": "401bd9_1",
            "read_only": false
          },
          {
            "name": "INTF_ID_DEVICE_LOC",
            "value": "3",
            "read_only": false
          },
          {
            "name": "ICONSET_LOC",
            "value": "iconset8",
            "read_only": false
          },
          {
            "name": "DEVICE_TYPE_LOC",
            "value": "2",
            "read_only": false
          },
          {
            "name": "ICONSET_INV_LOC",
            "value": "false",
            "read_only": false
          },
          {
            "name": "ID_DEVICE_LOC",
            "value": "2",
            "read_only": false
          },
          {
            "name": "VIS_DEVICE_LOC",
            "value": "true",
            "read_only": false
          },
          {
            "name": "OBSTACLE_DET_EVT",
            "value": "false",
            "read_only": true,
            "timestamp": 1701012628
          },
          {
            "name": "BLOCK_DET_EVT",
            "value": "false",
            "read_only": true,
            "timestamp": 1701012628
          },
          {
            "name": "DESCR_DEVICE_LOC",
            "value": "Rollladen Hartmut OG",
            "read_only": false
          }
        ]
      },
      {
        "capabilities": [
          {
            "name": "CURR_POS_CFG",
            "value": "100",
            "min_value": "0",
            "max_value": "100",
            "step_size": "1",
            "read_only": false
          },
          {
            "name": "PROD_CODE_DEVICE_LOC",
            "value": "10122345",
            "read_only": false
          },
          {
            "name": "REACHABILITY_EVT",
            "value": "true",
            "read_only": true,
            "timestamp": 1701012789
          },
          {
            "name": "NAME_DEVICE_LOC",
            "value": "Rollladen Esszimmer EG",
            "read_only": false
          },
          {
            "name": "PROT_ID_DEVICE_LOC",
            "value": "401bda_1",
            "read_only": false
          },
          {
            "name": "INTF_ID_DEVICE_LOC",
            "value": "3",
            "read_only": false
          },
          {
            "name": "ICONSET_LOC",
            "value": "iconset8",
            "read_only": false
          },
          {
            "name": "DEVICE_TYPE_LOC",
            "value": "2",
            "read_only": false
          },
          {
            "name": "ICONSET_INV_LOC",
            "value": "false",
            "read_only": false
          },
          {
            "name": "ID_DEVICE_LOC",
            "value": "3",
            "read_only": false
          },
          {
            "name": "VIS_DEVICE_LOC",
            "value": "true",
            "read_only": false
          },
          {
            "name": "OBSTACLE_DET_EVT",
            "value": "false",
            "read_only": true,
            "timestamp": 1701012789
          },
          {
            "name": "BLOCK_DET_EVT",
            "value": "false",
            "read_only": true,
            "timestamp": 1701012789
          },
          {
            "name": "DESCR_DEVICE_LOC",
            "value": "Rollladen Esszimmer EG",
            "read_only": false
          }
        ]
      },
      {
        "capabilities": [
          {
            "name": "CURR_POS_CFG",
            "value": "100",
            "min_value": "0",
            "max_value": "100",
            "step_size": "1",
            "read_only": false
          },
          {
            "name": "PROD_CODE_DEVICE_LOC",
            "value": "10122345",
            "read_only": false
          },
          {
            "name": "REACHABILITY_EVT",
            "value": "true",
            "read_only": true,
            "timestamp": 1701012794
          },
          {
            "name": "NAME_DEVICE_LOC",
            "value": "Rollladen Wohnzimmer links EG ",
            "read_only": false
          },
          {
            "name": "PROT_ID_DEVICE_LOC",
            "value": "401b99_1",
            "read_only": false
          },
          {
            "name": "INTF_ID_DEVICE_LOC",
            "value": "3",
            "read_only": false
          },
          {
            "name": "ICONSET_LOC",
            "value": "iconset8",
            "read_only": false
          },
          {
            "name": "DEVICE_TYPE_LOC",
            "value": "2",
            "read_only": false
          },
          {
            "name": "ICONSET_INV_LOC",
            "value": "false",
            "read_only": false
          },
          {
            "name": "ID_DEVICE_LOC",
            "value": "4",
            "read_only": false
          },
          {
            "name": "VIS_DEVICE_LOC",
            "value": "true",
            "read_only": false
          },
          {
            "name": "OBSTACLE_DET_EVT",
            "value": "false",
            "read_only": true,
            "timestamp": 1701012794
          },
          {
            "name": "BLOCK_DET_EVT",
            "value": "false",
            "read_only": true,
            "timestamp": 1701012794
          },
          {
            "name": "DESCR_DEVICE_LOC",
            "value": "Rollladen Wohnzimmer links EG",
            "read_only": false
          }
        ]
      },
      {
        "capabilities": [
          {
            "name": "CURR_POS_CFG",
            "value": "0",
            "min_value": "0",
            "max_value": "100",
            "step_size": "1",
            "read_only": false
          },
          {
            "name": "PROD_CODE_DEVICE_LOC",
            "value": "10122345",
            "read_only": false
          },
          {
            "name": "REACHABILITY_EVT",
            "value": "true",
            "read_only": true,
            "timestamp": 1701023423
          },
          {
            "name": "NAME_DEVICE_LOC",
            "value": "Rollladen Wohnzimmer rechts EG",
            "read_only": false
          },
          {
            "name": "PROT_ID_DEVICE_LOC",
            "value": "401bbe_1",
            "read_only": false
          },
          {
            "name": "INTF_ID_DEVICE_LOC",
            "value": "3",
            "read_only": false
          },
          {
            "name": "ICONSET_LOC",
            "value": "iconset8",
            "read_only": false
          },
          {
            "name": "DEVICE_TYPE_LOC",
            "value": "2",
            "read_only": false
          },
          {
            "name": "ICONSET_INV_LOC",
            "value": "false",
            "read_only": false
          },
          {
            "name": "ID_DEVICE_LOC",
            "value": "5",
            "read_only": false
          },
          {
            "name": "VIS_DEVICE_LOC",
            "value": "true",
            "read_only": false
          },
          {
            "name": "OBSTACLE_DET_EVT",
            "value": "false",
            "read_only": true,
            "timestamp": 1701023423
          },
          {
            "name": "BLOCK_DET_EVT",
            "value": "false",
            "read_only": true,
            "timestamp": 1701023423
          },
          {
            "name": "DESCR_DEVICE_LOC",
            "value": "Rollladen Wohnzimmer rechts EG",
            "read_only": false
          }
        ]
      },
      {
        "capabilities": [
          {
            "name": "CURR_POS_CFG",
            "value": "100",
            "min_value": "0",
            "max_value": "100",
            "step_size": "1",
            "read_only": false
          },
          {
            "name": "PROD_CODE_DEVICE_LOC",
            "value": "10122345",
            "read_only": false
          },
          {
            "name": "REACHABILITY_EVT",
            "value": "true",
            "read_only": true,
            "timestamp": 1701012788
          },
          {
            "name": "NAME_DEVICE_LOC",
            "value": "Rollladen Andrea OG ",
            "read_only": false
          },
          {
            "name": "PROT_ID_DEVICE_LOC",
            "value": "401bce_1",
            "read_only": false
          },
          {
            "name": "INTF_ID_DEVICE_LOC",
            "value": "3",
            "read_only": false
          },
          {
            "name": "ICONSET_LOC",
            "value": "iconset8",
            "read_only": false
          },
          {
            "name": "DEVICE_TYPE_LOC",
            "value": "2",
            "read_only": false
          },
          {
            "name": "ICONSET_INV_LOC",
            "value": "false",
            "read_only": false
          },
          {
            "name": "ID_DEVICE_LOC",
            "value": "6",
            "read_only": false
          },
          {
            "name": "VIS_DEVICE_LOC",
            "value": "true",
            "read_only": false
          },
          {
            "name": "OBSTACLE_DET_EVT",
            "value": "false",
            "read_only": true,
            "timestamp": 1701012788
          },
          {
            "name": "BLOCK_DET_EVT",
            "value": "false",
            "read_only": true,
            "timestamp": 1701012788
          },
          {
            "name": "DESCR_DEVICE_LOC",
            "value": "Rollladen Andrea OG",
            "read_only": false
          }
        ]
      },
      {
        "capabilities": [
          {
            "name": "ID_DEVICE_LOC",
            "value": "0",
            "read_only": false
          },
          {
            "name": "PROD_CODE_DEVICE_LOC",
            "value": "",
            "read_only": false
          },
          {
            "name": "NAME_DEVICE_LOC",
            "value": "Gateway",
            "read_only": false
          },
          {
            "name": "PROT_ID_DEVICE_LOC",
            "value": "",
            "read_only": false
          },
          {
            "name": "INTF_ID_DEVICE_LOC",
            "value": "-1",
            "read_only": false
          },
          {
            "name": "ICONSET_LOC",
            "value": "",
            "read_only": false
          },
          {
            "name": "VIS_DEVICE_LOC",
            "value": "true",
            "read_only": false
          },
          {
            "name": "DEVICE_TYPE_LOC",
            "value": "0",
            "read_only": false
          },
          {
            "name": "ICONSET_INV_LOC",
            "value": "false",
            "read_only": false
          },
          {
            "name": "DESCR_DEVICE_LOC",
            "value": "Device Description",
            "read_only": false
          }
        ]
      }
    ]
  }
}
GB-1972 commented 7 months ago

As a workaround, you can add a new hub (with the IP of the existing one) to the integration without deleting the old one, which of course causes an error. You can then reestablish the connection via “Configure”. This works until the next restart of HomeAssistant.

peribeir commented 7 months ago

Hi

@nicknol - ID: -1 is actually created by the integration to represent the Gateway itself. Actually I was surprised to see the gateway in the response to /devices. I guess this is new behavior in Premium GW. I added the gateway in the code because the old gateways didn't report it. But it doesn't seem to be an issue anyway. The integration is ignoring the one you show in your response because it has an unsupportrf Device Type (=0). I find it very weird HA is showing Failed in the integration and then there is no error.

One question, how are you adding the hub? Manually or is it discovered automatically?

nicknol commented 7 months ago

One question, how are you adding the hub? Manually or is it discovered automatically?

@peribeir the gateway wasn't and isn't detected automatically. I do it manually by clicking "configure", enter the IP address of the gateway, don't exclude any device - that's all and all Rademacher/Homepilot devices are there (again).

If needed I could do a set of screenshots.

nicknol commented 7 months ago

As a workaround, you can add a new hub (with the IP of the existing one) to the integration without deleting the old one, which of course causes an error. You can then reestablish the connection via “Configure”. This works until the next restart of HomeAssistant.

This is similar but not equal to what I do at the moment: deletion of the configured gateway and adding/configuring the gateway again - everything is back :) the entities survive the activity

peribeir commented 7 months ago

Hi @nicknol @GB-1972

I think I found out what was wrong. I refactored the way HPPremium Gateways are loaded now. Next release should solve the restart issue. You'll have to delete and add the integration once more after the upgrade, but after that, the restarts should be ok.

nicknol commented 7 months ago

I think I found out what was wrong. I refactored the way HPPremium Gateways are loaded now. Next release should solve the restart issue. You'll have to delete and add the integration once more after the upgrade, but after that, the restarts should be ok.

Super good - many thanks 🙏 that was fast.