Open kodbeeck opened 3 years ago
@pdemeyer help will be usefull. I just can't say with what at the moment. Just had my development environment set up the other day. I also don't have very much available time (2 kids and wife). @joleys I don't think thay HACS is the problem. It's just if the integration is included in HA itself, it would be easier to have updates instead of relying on the available time of 1 person. @filipvh has done a great job getting this together. No doubt about that and I don't want to "steal" this project. Just keeping it alive and making progressie. Probably the HACS version will stay for a long time because a first integration only van have 1 platform (lights, sensor,...)
I can't program, but I'm most willing to test. NHC2 has been a crucial part of my dashboard (without it I wouldn't have gotten the expensive Niko switches in the first place), and the scenes based on it the only ones my wife actually used, so I really want to see this working again!
Same here, I can't program. If necessary I will certainly help with testing
I got it finaly working.
TAKE A BACKUP!!!!
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
regards David
I did the same as @davidkinders and it worked for me too. Thank you very much for this!
I suppose this means you manually install nhc2-coco? Since my HA runs on in a container in Synology NAS, I would have to install it inside the docker. Can this be done?
It can be done but I think you will have to redo this with every upgrade of HA because the docker is being rebuilt then.You'll have to install the terminal add-on i thinkVerzonden vanaf mijn Galaxy -------- Oorspronkelijk bericht --------Van: minosrex @.> Datum: 30/10/2021 09:10 (GMT+01:00) Aan: filipvh/hass-nhc2 @.> Cc: nielsvissers @.>, Mention @.> Onderwerp: Re: [filipvh/hass-nhc2] not being able to install after update to HA 2021.6 (#22) I suppose this means you manually install nhc2-coco? Since my HA runs on in a container in Synology NAS, I would have to install it inside the docker. Can this be done?
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.
That's what I thought, reinstall with every new version with HA. So a temporary fix at most. Still supporting a 'structural' solution!
You can actually create a Docker file, which will use the HA container and let Docker automatically do the pip install for you.
That's how containers work. Not sure how this works with your setup and the container version of HA.
Op za 30 okt. 2021 09:10 schreef minosrex @.***>:
I suppose this means you manually install nhc2-coco? Since my HA runs on in a container in Synology NAS, I would have to install it inside the docker. Can this be done?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/filipvh/hass-nhc2/issues/22#issuecomment-955163415, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVZ2MOEFI5VYW2FXMPQQ5TUJOR7LANCNFSM46XKA3IA . 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.
@davidkinders I did the same, all went fine, but I still don't have entities from Niko showing up. And no errors in the logbook... something missing on my side?
Hallo @geertmeersman great that this worked for u.
Which entities are not showing, switches and sensors are not implanted at this moment.
I found that the Synology docker container has a terminal window, so I tried to manually install nhc2-coco using the commands above. However, I got the same error messages as HA itself gives me upon trying to import the library. The issue seems to be with the netifaces package:
"Unable to install package nhc2-coco==1.4.1: 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-cy8kvopu/netifaces/setup.py'"'"'; file='"'"'/tmp/pip-install-cy8kvopu/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-3rcg7jfv cwd: /tmp/pip-install-cy8kvopu/netifaces/ Complete output (19 lines): running bdist_wheel running build running build_ext checking for getifaddrs...found. checking for getnameinfo...found. checking for IPv6 socket IOCTLs...not found. checking for optional header files...netpacket/packet.h. checking whether struct sockaddr has a length field...no. checking which sockaddr_xxx structs are defined...in in6 un ll. 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 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_LL=1 -I/usr/local/include/python3.9 -c netifaces.c -o build/temp.linux-x86_64-3.9/netifaces.o netifaces.c:131:14: fatal error: linux/tipc.h: No such file or directory 131 | # include <linux/tipc.h> | ^~~~ compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1 ---------------------------------------- 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-cy8kvopu/netifaces/setup.py'"'"'; file='"'"'/tmp/pip-install-cy8kvopu/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-m8tv7oys/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/netifaces cwd: /tmp/pip-install-cy8kvopu/netifaces/ Complete output (19 lines): running install running build running build_ext checking for getifaddrs...found. checking for getnameinfo...found. checking for IPv6 socket IOCTLs...not found. checking for optional header files...netpacket/packet.h. checking whether struct sockaddr has a length field...no. checking which sockaddr_xxx structs are defined...in in6 un ll. 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 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_LL=1 -I/usr/local/include/python3.9 -c netifaces.c -o build/temp.linux-x86_64-3.9/netifaces.o netifaces.c:131:14: fatal error: linux/tipc.h: No such file or directory 131 | # include <linux/tipc.h> | ^~~~ compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cy8kvopu/netifaces/setup.py'"'"'; file='"'"'/tmp/pip-install-cy8kvopu/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-m8tv7oys/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.3.1 is available. You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command."
Which entities are not showing, switches and sensors are not implanted at this moment.
@davidkinders even the lights, I have no entities at all showing up :-(
Hi @minosrex , you need to install the headers too:
apk add libffi-dev
This is what I did:
apk add build-base python3-dev py3-pip libffi-dev
pip3 install nhc2-coco
That did the trick, thanks Geert! Now if the custom component would do the same, then it will continue to run when HA updates.
I got it finaly working.
TAKE A BACKUP!!!!
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
regards David
when I enter the above lines in the terminal and click on "check configuration" I get the message integration nhc2 not found
@p8ulus your indentation is incorrect, has to be
nhc2:
host: 192.168.1.16
port: 8884
username:
password:
Apart from the manual steps you did, I hope you did not forget to keep/install the custom component nhc2? The manual steps were only to install the nhc2-coco library on which the custom component relies.
@p8ulus Your username and password is not 'hobby' and the API Token. The alternative way to connect with a profile uses port 8883.
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.
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.
@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.
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"
any progress here ?
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?
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
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.
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. ;)
{answer:42} should work
Outlook voor iOShttps://aka.ms/o0ukef downloaden
Van: Murray112 @.> Verzonden: Saturday, January 29, 2022 9:29:48 PM Aan: filipvh/hass-nhc2 @.> CC: pdemeyer @.>; Mention @.> Onderwerp: Re: [filipvh/hass-nhc2] not being able to install after update to HA 2021.6 (#22)
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. ;)
— Reply to this email directly, view it on GitHubhttps://github.com/filipvh/hass-nhc2/issues/22#issuecomment-1024981052, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA6N6FQWHBWOPLJFB53WXV3UYRE3ZANCNFSM46XKA3IA. You are receiving this because you were mentioned.Message ID: @.***>
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?
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 ‘=‘?
I've tried several combinations .
{answer:42} too.
But it seems to be still wrong in my case. I miss something..
JSON syntax
{"answer":42}
Cheers, Geert
Op ma 31 jan. 2022 06:57 schreef Murray112 @.***>:
[image: image] https://user-images.githubusercontent.com/76228877/151745685-eb5c55c8-3ff3-48eb-9e07-c72fccf9da16.png I've tried several combinations . {answer:42} too. But it seems to be still wrong in my case. I miss something..
— Reply to this email directly, view it on GitHub https://github.com/filipvh/hass-nhc2/issues/22#issuecomment-1025404644, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOCG65ATNPIAS5FKHT6V2TUYYQGFANCNFSM46XKA3IA . 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 were mentioned.Message ID: @.***>
The correct answer to get your API token is actually:
{"answer"='The answer to Life, The Universe and Everything Else'}
Always worked for me, every time.
Fred
On Mon, 31 Jan 2022 at 07:59, Geert Meersman @.***> wrote:
JSON syntax
{"answer":42}
Cheers, Geert
Op ma 31 jan. 2022 06:57 schreef Murray112 @.***>:
[image: image] < https://user-images.githubusercontent.com/76228877/151745685-eb5c55c8-3ff3-48eb-9e07-c72fccf9da16.png
I've tried several combinations . {answer:42} too. But it seems to be still wrong in my case. I miss something..
— Reply to this email directly, view it on GitHub <https://github.com/filipvh/hass-nhc2/issues/22#issuecomment-1025404644 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAOCG65ATNPIAS5FKHT6V2TUYYQGFANCNFSM46XKA3IA
. 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
You are receiving this because you were mentioned.Message ID: @.***>
— Reply to this email directly, view it on GitHub https://github.com/filipvh/hass-nhc2/issues/22#issuecomment-1025433818, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVZ2MJ6NGKU3FA7LYQMUXLUYYXLZANCNFSM46XKA3IA . 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: @.***>
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
@Murray112 enter exactly what geert posted above. What you posted isn't valid json.
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
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_
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
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: https://github.com/filipvh/hass-nhc2/issues/22#issuecomment-955678809. 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: https://github.com/filipvh/hass-nhc2/issues/38. I myself managed to solve it by forcing the installation of the right version.
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?
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!
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) :
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.
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.
As far as i have seen, there is a difference between the json data for pir Action and normal button Actions. A pir is more a scene than a button. If the scenes are integrated so wil pir or vice versaVerzonden vanaf mijn Galaxy -------- Oorspronkelijk bericht --------Van: spaceman569 @.> Datum: 4/06/2022 09:29 (GMT+01:00) Aan: filipvh/hass-nhc2 @.> Cc: nielsvissers @.>, Mention @.> Onderwerp: Re: [filipvh/hass-nhc2] not being able to install after update to HA 2021.6 (#22) 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.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
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 :).
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
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.