Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not being able to install after update to HA 2021.6 #22

Open
kodbeeck opened this issue Jun 15, 2021 · 97 comments
Open

not being able to install after update to HA 2021.6 #22

kodbeeck opened this issue Jun 15, 2021 · 97 comments

Comments

@kodbeeck
Copy link

Hello, I have been using the nhc2 integration for a few months now and everything worked very good. After updating to 2021.6 the niko integration did not load, and I deleted the old integrations, updated the package to the latest version that contains the fix and tried reinstalling. However the installation takes forever and doesn't seem to do anything. All I can do is eventually refresh the page and nothing is installed.

@anvarit
Copy link
Collaborator

anvarit commented Jun 16, 2021

what errors do you have in HA log?

@filipvh
Copy link
Owner

filipvh commented Jun 16, 2021

If this is not resolved by next week, I might find the time to test with the latest HA.
I hope someone can help you earlier that that :(

@kodbeeck
Copy link
Author

Hi,
Thanks for the replies!
I do not see any errors in the log regarding nhc2. When trying to add the integration, nothing happens and I only see a spinning circle. Other integrations do install. I tried several browsers, rebooting, clear cache etc

Steps i did:
Upgraded to latest version of HA 2021.6.5
deleted old nhc2 installation, as it was not loading
Installed new nhc2 version through HACS
rebooted the machine
Tried installing new nhc2 version and nothing happens.

Hope this helps a bit.

@davidkinders
Copy link

davidkinders commented Jun 22, 2021

Same problem here, new install no errors in log.
when adding the integration in keeps showing with turning wheel “please wait while installing”
1FE8AAAB-0EC0-4A4E-92A6-8C5950F59EC4

@filipvh
Copy link
Owner

filipvh commented Jun 26, 2021

I upgraded today, without issue. First hacs and hass-nhc2, then HA.
I haven't installed a new 'nhc2' integration, so I'll try to setup a 2nd setup to test this.

@filipvh
Copy link
Owner

filipvh commented Jun 26, 2021

Btw, to see something is the logs, you might want to enable logging on custom components or hass-nhc2 specific.
see https://www.home-assistant.io/integrations/logger/ for details
I've got mine setup like this:

logger:
  default: warning
  logs:
    custom_components: debug

@kodbeeck
Copy link
Author

Hi Filip,

Thanks for trying to replicate the problem. I enabled logging of custom_components, as suggested. However, still nothing in the logs. It looks like it doesn't even try to install. It does show the spinning blue circle, but that keeps spinning indefinitely.

@filipvh
Copy link
Owner

filipvh commented Jun 27, 2021

@kodbeeck I assume you restarted HA after that config change 😄
I hope I get more lucky in finding the issue.
You do have the latest HA I hope? So we have similar results.
I'm on HA core-2021.6.6
In a previous post you mention core-2021.6.5

@nielsvissers
Copy link

nielsvissers commented Jun 29, 2021

i'm having the same problems
i'm trying to rebuild the custom component from scratch to see where the problem is

installing version 1.3.1 through HACS and adding "version":"1.3.1" to the manifest has succeeded
updatding directly to version 1.6.0 has also succeeded

installing version 1.4.0 has the same issues as direct install of 1.6.0
so i think the differences between 1.3.1 and 1.4.0 are causing the issues

removing 1.3.1 and installing 1.4.0 gives no issues, upgrading does

@2Fast2BCn
Copy link

2Fast2BCn commented Jul 4, 2021

I have the same problem.
Might this be related?
https://community.home-assistant.io/t/hacs-installing-problem-via-integration-error-config-flow-could-not-be-loaded/314501

There is a request that seem to time out:
Request URL: https://${PATH}/api/config/config_entries/flow
Request Method: POST
Status Code: 504
Data: {"handler":"nhc2","show_advanced_options":false}

@Tjaardv
Copy link

Tjaardv commented Jul 6, 2021

Same here

installed version 1.0.0 update to 1.6.0
Reboot server
installation succeeded

@2Fast2BCn
Copy link

2Fast2BCn commented Jul 14, 2021

I cannot get this to work.
I even purchased an Odroid N2+ thinking it would be better but no luck.
If I add:

nhc2:
  host: '192.168.0.196'
  port: 8884
  username: hobby
  password: password

Then it's visible in the integrations page but nothing is happening.
There is nothing in the logs as far as I can find.

@nielsvissers
Copy link

have you tried a restart of the host?
not just home assistant?

@2Fast2BCn
Copy link

At least 10 times already ;-)
ha core rebuild
full system reboot
reinstall
install 1.0.0 (but then you cannot add the integration and it doesn't recognize nhc2 in the configuration file?)
is there a way to show more logging
I currently have the advised

logger:
  default: info
  logs:
    custom_components.hacs: debug
    hacs: debug
    queueman: debug
    AIOGitHubAPI: debug

@nielsvissers
Copy link

first install v1.0.0, reboot, upgrade to v1.6.0, reboot
then it should work

@2Fast2BCn
Copy link

I installed 1.0.0
logs show

ERROR (SyncWorker_1) [homeassistant.loader] The custom integration 'nhc2' does not have a valid version key (None) in the manifest file and was blocked from loading. See https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes#versions for more details

then I did full system reboot (same error is shown in the logs which is normal I guess)
then I updated to 1.6.0
then I did full system reboot
then the logs show:

2021-07-14 17:29:52 DEBUG (MainThread) [custom_components.nhc2] Connecting to 192.168.0.198 with hobby

nothing else is happening no entities are registered nothing in the logs
trying to add the integration via the GUI results in the long running "Installation of the integration" resulting in the "config flow" error with nothing in the logs.

@Murray112
Copy link

Same problem here...
Tried with all the versions via hacs or manually, puting de folder inside custom_components. Update is done but it is impossible to add the integration. The never ending spinning wheel stays there.

I hope a fix will be found for this issue.
Anyways, I want to thank the developer because its a great addon. I use it since several months and I hope it will be available again pretty soon

@2Fast2BCn
Copy link

@joleys
Copy link
Contributor

joleys commented Jul 23, 2021

It might be related to the 'external_url'. Please read home-assistant/core#47449.

@Murray112
Copy link

Murray112 commented Jul 24, 2021

No changes with the last HA update. Still stuck in the spinning wheel and I see that other users have the same issue.
I have reviewed for the external url and in my case it doesn't change.
Have you tested to do a fresh install of NHC2 in the new version of HA? I wonder if all systems are affected with the new version or there are personal config elements conditioning this situation.

@nielsvissers
Copy link

in the logs i see next entry
2021-07-25 13:43:50 DEBUG (MainThread) [custom_components.hacs] <Integration filipvh/hass-nhc2> Running checks against 1.6.0
but not "checks passed"
maybe the initialization isn't complete?

@nielsvissers
Copy link

there seems to be an issue with getting the profiles
this function takes a long time
self._all_cocos = await disc.get_all_profiles()

has something changed here at Niko perhaps?

@nielsvissers
Copy link

found the issue
inside repository nhc2-coco the "done" function is never called because the function "_done_discovering_profiles_callback" is called too soon.
adding a while loop with a sleep fixed it on my installation

i'll try to make a pull request in the other repo soon

@Murray112
Copy link

Hi all, I've retested a fresh install with the new Ha update 2021.08 without luck.. I wonder if there are some news about the possible fix to the installation problem.

Thank you very much,

@nielsvissers
Copy link

nielsvissers commented Aug 5, 2021 via email

@86hakan
Copy link

86hakan commented Aug 26, 2021

How is it going with the pull request?

@nielsvissers
Copy link

nielsvissers commented Aug 26, 2021 via email

@minosrex
Copy link

Similar issue. NHC2 worked flawlessly for several months (awesome integration, thanks!), but when I upgraded to Home Assistant 2021.8.8 (from 2021.4.3, I believe), the integration won't load anymore. Updated HACS, NHC2 itself, with no effect. There go my sixteen light morning and evening scenes :-( Hope you can fix it!

The log gives me this:

Logger: homeassistant.util.package
Source: util/package.py:99
First occurred: 1:49:11 (1 occurrences)
Last logged: 1:49:11

Unable to install package nhc2-coco==1.3.3: ERROR: Command errored out with exit status 1: command: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qqsw4avw/netifaces/setup.py'"'"'; file='"'"'/tmp/pip-install-qqsw4avw/netifaces/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-kzms5yb7 cwd: /tmp/pip-install-qqsw4avw/netifaces/ Complete output (15 lines): running bdist_wheel running build running build_ext checking for getifaddrs...not found. checking for getnameinfo...not found. checking for socket IOCTLs...not found. checking for optional header files...none found. checking whether struct sockaddr has a length field...no. checking which sockaddr_xxx structs are defined...none! checking for routing socket support...no. checking for sysctl(CTL_NET...) support...no. checking for netlink support...no. building 'netifaces' extension gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -DNETIFACES_VERSION=0.10.9 -I/usr/local/include/python3.9 -c netifaces.c -o build/temp.linux-x86_64-3.9/netifaces.o error: command 'gcc' failed: No such file or directory ---------------------------------------- ERROR: Failed building wheel for netifaces ERROR: Command errored out with exit status 1: command: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qqsw4avw/netifaces/setup.py'"'"'; file='"'"'/tmp/pip-install-qqsw4avw/netifaces/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-9csyrady/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/netifaces cwd: /tmp/pip-install-qqsw4avw/netifaces/ Complete output (15 lines): running install running build running build_ext checking for getifaddrs...not found. checking for getnameinfo...not found. checking for socket IOCTLs...not found. checking for optional header files...none found. checking whether struct sockaddr has a length field...no. checking which sockaddr_xxx structs are defined...none! checking for routing socket support...no. checking for sysctl(CTL_NET...) support...no. checking for netlink support...no. building 'netifaces' extension gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -DNETIFACES_VERSION=0.10.9 -I/usr/local/include/python3.9 -c netifaces.c -o build/temp.linux-x86_64-3.9/netifaces.o error: command 'gcc' failed: No such file or directory ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qqsw4avw/netifaces/setup.py'"'"'; file='"'"'/tmp/pip-install-qqsw4avw/netifaces/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-9csyrady/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/netifaces Check the logs for full command output. WARNING: You are using pip version 20.2.4; however, version 21.2.4 is available. You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.

@minosrex
Copy link

Any news on this? My Niko lights still don't work in HA... Thanks.

@joleys
Copy link
Contributor

joleys commented Nov 1, 2021

@p8ulus
Your username and password is not 'hobby' and the API Token. The alternative way to connect with a profile uses port 8883.

@tommeysen
Copy link

Hi, I'm having the same issue. However I'm not able to solve this.
To my understanding, what is the difference between this nhc2 project and the nhc2-coco variant which seem to be proposed here as well?
I tried to install nhc through HACS as well, but also stays loading for hours.

Thanks for all the suggestions already.

@joleys
Copy link
Contributor

joleys commented Nov 2, 2021

Hass-nhc2 is the main integration for Home Assistant, which relies on nhc2-coco as dependency to provide communication with the NHCII controller. In other words: nhc2-coco knows how to communicate with your Niko installation and hass-nhc2 translates this knowledge into HA compatible entities, functions and variables.

If you install hass-nhc2 it will (or at least: should) install nhc2-coco in the background. From other replies in this discussion it seems this sometimes goes wrong.

@tommeysen
Copy link

@joleys thanks for your reply, that clears it all up to me!

The problem I'm still having right now is that I'm unable to install hass-nhc2 on Home Assistant again (always used it in the past, but due to issues thought reinstalling it was the best idea to solve it).
I tried to install it, by adding those required files manually on my home assistand and then installing it through the integrations. But Also tried it via HACS and then via integrations, but both give the same result being that my screen stays stuck and loading at "please wait while Niko Home Control II is being setup".

Does anyone still has any suggestions on how to solve this?
I also tried the suggestion from David, being:
"
Open a terminal.
apk add build-base
apk add alpine-sdk linux-headers libffi-dev
apk add python3-dev
pip3 install nhc2-coco

Add this to your configuration.yaml
nhc2:
host: 0.0.0.0
port: 8884
username: "hobby"
password: your key
"

But was also not able to get the integration installed then, and my Home Assistant system was very slow afterwards as well so had to restore it to the backup I took before.

@p8ulus
Copy link

p8ulus commented Nov 7, 2021

homeassistant reinstalled updated to latest version, above description performed.
Open a terminal.
apk add build base
apk add alpine-sdk linux-headers libffi-dev
apk add python3-dev
pip3 install nhc2-coco

Add this to your configuration.yaml
nhc2:
host: 0.0.0.0
postage: 8884
username: "hobby"
password: your key

I still get the same message "Unable to load config flow"

@Gavergracht
Copy link

any progress here ?

@minosrex
Copy link

For me, the solution of David Kinders (29 Oct) combined with Geert Meersman (31 Oct) on installing the headers, got it to work, which it does until today. However, I do not want to install a new version of HA because this will mess up the integration again. Niels, any view on a permanent fix?

@fierske
Copy link

fierske commented Jan 25, 2022

Hello,

I had a worked NHC2 with above steps. I added some rest_commands in my configuration.yaml
After rebooting HA to activate the rest_commads I get a error on my NHC2? I didn't changed anything on the parameters of NHC2. Error: not authorized? Can you only make one connection for a specific time? Someone an idea what's wrong?

Kind regards,
Dirk

Logger: root
Source: /usr/src/homeassistant/homeassistant/bootstrap.py:315
First occurred: 16:18:08 (1 occurrences)
Last logged: 16:18:08

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/paho/mqtt/client.py", line 3452, in _thread_main
self.loop_forever(retry_first_connection=True)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1779, in loop_forever
rc = self.loop(timeout, max_packets)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1181, in loop
rc = self.loop_read(max_packets)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1572, in loop_read
rc = self._packet_read()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2310, in _packet_read
rc = self._packet_handle()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2942, in _packet_handle
return self._handle_connack()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3029, in _handle_connack
self.on_connect(
File "/usr/local/lib/python3.9/site-packages/nhc2_coco/coco.py", line 118, in _on_connect
raise Exception(MQTT_RC_CODES[rc])
Exception: Connection refused - not authorised

@fierske
Copy link

fierske commented Jan 28, 2022

Hello,

I had a worked NHC2 with above steps. I added some rest_commands in my configuration.yaml After rebooting HA to activate the rest_commads I get a error on my NHC2? I didn't changed anything on the parameters of NHC2. Error: not authorized? Can you only make one connection for a specific time? Someone an idea what's wrong?

Kind regards, Dirk

FYI

I have installed the new HA 7.2 and reinstalled NHC2 and now everything works fine again.

@Murray112
Copy link

I've finally succeded to have the integration installed but I would like to know how to resolve the Niko problem to get the api token.

{"answer"=<the answer to Life, The Universe and Everything Else>}

I know the answer but no the correct JSOn syntax.

Can you help me to solve it? thanks again.

Lot of brainstorming to controle our lights from home assistant...

I will give a feedback if it works when pasted it. ;)

@pdemeyer
Copy link

pdemeyer commented Jan 30, 2022 via email

@Murray112
Copy link

Tried but it doesn't work. It asks to correct the syntax of the whole phrase. I've tried also replacing answer by 42 but it doesn't work.
Any ideas?

@joleys
Copy link
Contributor

joleys commented Jan 31, 2022

Tried but it doesn't work. It asks to correct the syntax of the whole phrase. I've tried also replacing answer by 42 but it doesn't work.
Any ideas?

Did you notice the small difference of ‘:’ versus ‘=‘?

@Murray112
Copy link

image
I've tried several combinations .
{answer:42} too.
But it seems to be still wrong in my case. I miss something..

@geertmeersman
Copy link

geertmeersman commented Jan 31, 2022 via email

@LinoxBE
Copy link

LinoxBE commented Jan 31, 2022 via email

@Murray112
Copy link

Murray112 commented Feb 1, 2022

I've tried...

{"answer"='The answer to Life, The Universe and Everything Else'}
{"answer"='The answer to Life, The Universe and Everything Else'}
{"42"='The answer to Life, The Universe and Everything Else'}
{"42"='The answer to Life, The Universe and Everything Else'}

But it still saying that my JSON is wrong...

Can you retry to see if it works for you?

Thanks again for your help,

Fernando

@sebakerckhof
Copy link

@Murray112 enter exactly what geert posted above. What you posted isn't valid json.

@Murray112
Copy link

Thank you all!!
I probably did a bad manipulation last day. I've retested Geert's answer and now it worked! I have my API token.
The problem now... is that I have no entities showing at the integrations page. I have the Niko integration with no entities. I'm using Geerts config:

nhc2: 
  host: Niko Hub IP
  port: 8884 
  username: hobby
  password: API token

I've tried putting "" to the username and pass also but nothing.

It's probably a silly thing but I can' get it finally working...

Thanks for your patience again ;)

Murray

@Murray112
Copy link

Little up!

After succesfully added the integration and the Holy API Token, I can't see any of my Niko ligths or sensors...
Have you found any solution for this? Even temporary to renew each HA update.
@geertmeersman @sebakerckhof ?

Thanks a lot.

Murray_

@spaceman569
Copy link

Hi All,

I've successfully installed the NHC2 integration via HACS, solved the Hobby API question to get access to my password, added the nhc2: lines in the configuration.yaml, rebooted HA, all this in various combinations but I still don't get any entities from the nhc2 integration. I wonder, is this working for anyone out there or should I give up trying?

Thanks,
Thomas

@minosrex
Copy link

Hi spaceman569, what does the log say when you start up?
I had to manually install the NHC2 Coco repository because it is needed and does not come with HA. Above, some nice people explained me how to do it. See: #22 (comment). Since I am running HA in a Docker on my Synology NAS, I had to execute these commands within that docker's terminal window -and I will have to re-do them for every installation of HA until someone integrates this update in HA. (I lack the skill to do this)

This worked for a while, but then stopped as well because you there was a dependencies issue. People solved it here: #38. I myself managed to solve it by forcing the installation of the right version.

@spaceman569
Copy link

spaceman569 commented May 21, 2022

Hi minosrex,

massive thanks for pointing me in the right direction. I thought this thread would not help me since I couldn’t see a clear working conclusion. However, tonight I got it to work by executing #22 and then #38. But since I have a fresh HA installation on a RPi I believe I could have merged the two instead of doing them in sequence (?).

I still have one question; I see only switches and lights, not virtual devices/outputs, mini pirs nor scenarios that I have in Niko. Do you know how to add them manually?

@minosrex
Copy link

Hi spaceman569, I never implemented anything within Niko beyond the electrician defining the lights when he did the installation. I had it installed with HA in mind -which is why I hope it keeps working!

@geertmeersman
Copy link

Hi, I have seen in the hobby api documentation that quite some features are possible to extract/interact with.
https://mynikohomecontrol.niko.eu/Content/hobbyapi/documentation.pdf

Also the PIR (@spaceman569) :
image

My proposal would be to add them to the addon, you could already play with it using an MQTT client, this is how I debugged things.

@spaceman569
Copy link

Hi geertmeersman, this looks interesting, thanks! I am aware of the documentation but haven't dug into it yet... it will probably take some time (family first :) ) before I see the Niko PIRs in HA. Maybe I go for the simpler solution and install parallel HW (PIRs or door switches) directly to HA. Not a sexy solution, but very fast. I'll post here if I go the long way through nhc2.

@nielsvissers
Copy link

nielsvissers commented Jun 4, 2022 via email

@spaceman569
Copy link

OK, that is also an interesting piece in the puzzle. I am missing the scenes as well so maybe I should focus on those and hopefully the PIRs will come automatically. I plan to spend some time on this in July, during my vacation on rainy days :).

@nielsvissers
Copy link

nielsvissers commented Jun 12, 2022

a default pir scene apparently doesn't send out a MQTT event when triggerd.
i have the generic routines available but not in this project for which i jet have to create a pull request for
this one has been abandoned and is continued on https://github.com/joleys/niko-home-control-II

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests