peribeir / homeassistant-rademacher

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

Can't get integration added to HA 2022.02.03 #22

Closed michelde closed 2 years ago

michelde commented 2 years ago

After installing the integration in Version 1.4.0 with HACS and restarting HA I can see the following in the Home Assistant Log:

2022-02-09 07:44:52 INFO (MainThread) [custom_components.rademacher.config_flow] Starting DHCP Discovery with IP Address 192.168.178.20
2022-02-09 07:44:53 INFO (MainThread) [custom_components.rademacher.config_flow] Connection Test Successful (IP 192.168.178.20), no Password required
2022-02-09 07:44:53 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 203, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 230, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/rademacher/config_flow.py", line 183, in async_step_dhcp
    return await self.async_step_config()
  File "/config/custom_components/rademacher/config_flow.py", line 54, in async_step_config
    manager = await HomePilotManager.async_build_manager(
TypeError: async_build_manager() takes 1 positional argument but 2 were given

Also trying to add the integration manually is failing:

2022-02-09 07:47:05 INFO (MainThread) [custom_components.rademacher.config_flow] Starting manual config for IP 192.168.178.20
2022-02-09 07:47:05 ERROR (MainThread) [custom_components.rademacher.config_flow] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/rademacher/config_flow.py", line 112, in async_step_user
    await self.async_set_unique_id(self.host)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1261, in async_set_unique_id
    raise data_entry_flow.AbortFlow("already_in_progress")
homeassistant.data_entry_flow.AbortFlow: Flow aborted: already_in_progress

My Home Assistant installation is on RPI4 with HassOS (all latest version).

michelde commented 2 years ago

Created a PR for this problem. https://github.com/peribeir/homeassistant-rademacher/pull/23

peribeir commented 2 years ago

Great, I overlooked that when I did the change in the library.

I'll review the PR and approve.

Thanks @michelde

ustumm commented 2 years ago

Hello guys, I also can't connect to Homepilot. I am running HA 2022.2.6 with HACS in a Container. I tried Version 1.4.0, 1.4.1 and 1.5.beta3, but I get the following Error Message:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht Logger: custom_components.rademacher.config_flow Source: config_entries.py:1261 Integration: Rademacher HomePilot (documentation, issues) First occurred: 12:17:02 (1 occurrences) Last logged: 12:17:02

Unexpected exception Traceback (most recent call last): File "/config/custom_components/rademacher/config_flow.py", line 110, in async_step_user await self.async_set_unique_id(self.host) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1261, in async_set_unique_id raise data_entry_flow.AbortFlow("already_in_progress") homeassistant.data_entry_flow.AbortFlow: Flow aborted: already_in_progress

If I can help you, let me know Ulrich

peribeir commented 2 years ago

Hi @ustumm

Are you running HA container with the --network=host option? If you are, them the reason I can find for that error is that dhcp discovery is still ongoing and trying to setup the integration automatically, at the same time that you are trying to add it manually.

Is this happening right after restarting HA? If so, can you test waiting for some time after restarting HA (like 10 min or so), and only then add the integration?

ustumm commented 2 years ago

Hello Pedro,

i have installed (on synology NAS) with Taskmanager Script: docker run -d --name=home-assistant -p 8123:8123 -e TZ=Europe/Berlin -v /volume1/docker/home-assistant/config:/config --restart always homeassistant/home-assistant

I have testet, before with Host Network, but ist seems also a Problem to solve or route the IP-Adresse.

In HACS Dashboard the Rademacher Integration is downloaded and available. After I restart HA, before I try to add Integration I get the following Log:

Logger: homeassistant Source: custom_components/rademacher/config_flow.py:55 Integration: Rademacher HomePilot (documentation, issues) First occurred: 16:28:23 (1 occurrences) Last logged: 16:28:23

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 203, in async_init flow, result = await task File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 230, in _async_init result = await self._async_handle_step(flow, flow.init_step, data, init_done) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/rademacher/config_flow.py", line 181, in async_step_dhcp return await self.async_step_config() File "/config/custom_components/rademacher/config_flow.py", line 55, in async_step_config manager = await HomePilotManager.async_build_manager(api) File "/usr/local/lib/python3.9/site-packages/homepilot/manager.py", line 30, in async_build_manager manager.devices = { File "/usr/local/lib/python3.9/site-packages/homepilot/manager.py", line 31, in id_type["did"]: await HomePilotManager.async_build_device(manager.api, id_type) File "/usr/local/lib/python3.9/site-packages/homepilot/manager.py", line 46, in async_build_device return await HomePilotSensor.async_build_from_api(api, id_type["did"]) File "/usr/local/lib/python3.9/site-packages/homepilot/sensor.py", line 113, in async_build_from_api fw_version=device_map[APICAP_VERSION_CFG]["value"], KeyError: 'VERSION_CFG'

Homepilot Firmware 5.4.9 without password Uli

peribeir commented 2 years ago

Ok, that's clearer now.

Looks like VERSION_CFG is not available for every device. I'll add a test for the availability of this property in the next release.

I'm just waiting on confirmation on another issue, right after that I'll release a new version for you to test.

ustumm commented 2 years ago

Thanks, this is great.

peribeir commented 2 years ago

Can you try v1.5.0-beta.2 ?

ustumm commented 2 years ago

Perfect, the Version v1.5.0-beta3 is now recognise my homepilot automatically and I can add all my DuoFern und Z-Wave devices (42). :-) Thanks a lot.

peribeir commented 2 years ago

Wow, that's a lot of devices.

Good to know it works!!