filipvh / hass-nhc2

Niko Home Control II Home Assistant Integration
MIT License
36 stars 26 forks source link

Can't add integration #33

Open hrtcdxfu opened 2 years ago

hrtcdxfu commented 2 years ago

Getting the following errors when trying to add the integration:

Logger: root Source: /usr/src/homeassistant/homeassistant/bootstrap.py:320 First occurred: 21:21:04 (5 occurrences) Last logged: 22:00:17

Uncaught thread exception Traceback (most recent call last): File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/local/lib/python3.9/threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.9/site-packages/nhc2_coco/coco_discover.py", line 49, in _scan_for_nhc while loops < 200 and ((not self._discovered_at_least_one) or loops < 20): AttributeError: 'CoCoDiscover' object has no attribute '_discovered_at_least_one'

image

image

If it gets through any further, i can fill in the IP address which is in a different subnet, but then i get the following error instead:

Logger: aiohttp.server Source: custom_components/nhc2/config_flow.py:143 Integration: Niko Home Control II (documentation, issues) First occurred: 21:25:22 (4 occurrences) Last logged: 21:28:53

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request resp = await self._request_handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle resp = await handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 138, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 157, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 246, in async_configure result = await self._async_handle_step(flow, cur_step["step_id"], user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 320, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/nhc2/config_flow.py", line 114, in async_step_manual_host return await self._show_user_config_form() File "/config/custom_components/nhc2/config_flow.py", line 143, in _show_user_config_form for i, x in enumerate(profiles): TypeError: 'NoneType' object is not iterable

image

Any idea what could be going wrong? All traffic is allowed from the HomeAssistant subnet to the Niko Home Control IP.

p8ulus commented 2 years ago

I get the same error message https://github.com/filipvh/hass-nhc2/issues/22

KarelKempenaers commented 2 years ago

Hi

Maybe this is a different thing, but I had this issue: I used nhc2 integration for almost a year now, without any problem. Yesterday, I changed something on my NHC2-controller and had to update the programming software/firmware of my nhc2-installation. Niko is forcing this update once a year, so I had no choice.

Since the update, my HA was no longer able to connect to the nhc controller. I deleted the integration and tried to add it again: having the same issue: not able to complete the flow.

I tried to connect using the manual way (configuration). No succes... in the past, the NHC2 component was not using the hobby API I think, but was connected using the 'default' profile.

As I kept getting the authentication rejection, I reactivated my hobby API-key. The moment I added this to my configuration, I'm able to use it again.

Maybe, Niko is no longer allowing the connection via profiles? And is this blocking the install-flow?

ddeconin-gh commented 2 years ago

Hi, Same issue here. How can this be fixed?

Gavergracht commented 2 years ago

As I kept getting the authentication rejection, I reactivated my hobby API-key. The moment I added this to my configuration, I'm able to use it again.

How did you reactivate without making a new account ?

KarelKempenaers commented 2 years ago

Hi, Same issue here. How can this be fixed?

Did you try the way I discribed? With the hobby api key?

KarelKempenaers commented 2 years ago

As I kept getting the authentication rejection, I reactivated my hobby API-key. The moment I added this to my configuration, I'm able to use it again.

How did you reactivate without making a new account ?

I just went to the Niko hobby platform and generated it. https://mynikohomecontrol.niko.eu/

https://www.niko.eu/nl-be/onze-producten/huisautomatisering/hobby-api

I did not need to create a new account. Just added the hobby API service and entered this information in the configuration of HA

Gavergracht commented 2 years ago

Karel,

Ik kan pas mijn hobby API vervangen een maand voor hij niet meer geldig is. Daarom mijn vraag of dit bij jou wel mogelijk was om een nieuwe code aan te maken ...

Sent with a Spark On 27 dec. 2021 21:02 +0100, KarelKempenaers @.***>, wrote:

As I kept getting the authentication rejection, I reactivated my hobby API-key. The moment I added this to my configuration, I'm able to use it again. How did you reactivate without making a new account ? I just went to the Niko hobby platform and generated it. https://mynikohomecontrol.niko.eu/ https://www.niko.eu/nl-be/onze-producten/huisautomatisering/hobby-api I did not need to create a new account. Just added the hobby API service and entered this information in the configuration of HA — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>

efiten commented 2 years ago

As I kept getting the authentication rejection, I reactivated my hobby API-key. The moment I added this to my configuration, I'm able to use it again.

How did you reactivate without making a new account ?

I just went to the Niko hobby platform and generated it. https://mynikohomecontrol.niko.eu/

https://www.niko.eu/nl-be/onze-producten/huisautomatisering/hobby-api

I did not need to create a new account. Just added the hobby API service and entered this information in the configuration of HA

Have the same over here (I think) : https://community.home-assistant.io/t/issue-when-adding-an-integration/376487

How do you add the API key to HA ?

I only have this :

`light:

But as you can see in the above link, I'm not even able to enter anything while installing.

KarelKempenaers commented 2 years ago

In your HA configuration you need to enter this information. You should not add it as a light, just as an separate integration. Like, at the bottom of the file.

nhc2: host: <your Controllers IP as 182.168.1.xxx> port: 8884 username: “hobby” password:

efiten commented 2 years ago

Looks like it's not accepting this for me :

checking the config results in :

Invalid config for [nhc2]: expected a dictionary for dictionary value @ data['nhc2']. Got [OrderedDict([('host', '192.168.1.133'), ('port', 8884), ('username', 'hobby'), ('password',

I added it like this :

`nhc2:

image

Gavergracht commented 2 years ago

I managed to install it  by adding An integration. But the day after they all get unavailable...

Sent with a Spark On 7 jan. 2022 12:44 +0100, efiten @.***>, wrote:

Looks like it's not accepting this for me : checking the config results in : Invalid config for [nhc2]: expected a dictionary for dictionary value @ data['nhc2']. Got [OrderedDict([('host', '192.168.1.133'), ('port', 8884), ('username', 'hobby'), ('password', I added it like this : `nhc2:

• host: 192.168.1.133 port: 8884 username: "hobby" password: "password"`

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>

efiten commented 2 years ago

@filipvh do you think you'll have the time somewhere to look at this integration ? Because I think many of us are depending on it (me for sure, my complete home runs on NIKO, and now my automation is gone).

Maybe we can setup a crowdfunding or so to 'buy' some of your time ?

pete0811 commented 2 years ago

I connect through a "default" touch panel profile. At first it didn't work at all and got those "config flow errors". By accident I did a modification in my Niko system with the Niko software and uploaded it (=niko controller restarts then). After that the integration worked. I think it's related to the restarting of the niko home controller ....

efiten commented 2 years ago

And how did you connect through that touch panel profile? I don't have a touch panel, what do I need to fill in, and where?

Erwin

Op ma 17 jan. 2022 om 20:01 schreef pete0811 @.***>:

I connect through a "default" touch panel profile. At first it didn't work at all and got those "config flow errors". By accident I did a modification in my Niko system with the Niko software and uploaded it (=niko controller restarts then). After that the integration worked. I think it's related to the restarting of the niko home controller ....

— Reply to this email directly, view it on GitHub https://github.com/filipvh/hass-nhc2/issues/33#issuecomment-1014818125, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUBHKR5VJEKDTZQ7LJAAY3UWRRP7ANCNFSM5INCYFFQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

pete0811 commented 2 years ago

In the niko home programming software you open your project and under menu "dashboard" you can create a profile for a touchscreen. Name this profile "default" and make a password for it (it didn't work without password). You should do an upload to the niko controller then. In my configuration.yaml file I have only: nhc2: host: 192.168.0.xxx port: 8884 username: "hobby" password: ""

Replace the 192.168.0.xxx with the correct IP adress of the niko controller.

efiten commented 2 years ago

OK, let's try this later today. But the password in your default profile, isn't used in the YAML file, the password over there is the API token, right ? ANd you have the YAML setup, before adding the integration?

Erwin

pete0811 commented 2 years ago

Add config yaml first. I have no api installed and have no token... It just works via the touchscreen at my place. I left the password blank in the config yaml.

Op di 18 jan. 2022 09:30 schreef efiten @.***>:

OK, let's try this later today. But the password in your default profile, isn't used in the YAML file, the password over there is the API token, right ? ANd you have the YAML setup, before adding the integration?

Erwin

— Reply to this email directly, view it on GitHub https://github.com/filipvh/hass-nhc2/issues/33#issuecomment-1015177915, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXFL26NSBVXV3WINKOO2VADUWUQLNANCNFSM5INCYFFQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>