Niko Home Control


(fcela) #22

Sorry Mark,
I replied by an e-mail and didn’t notice the links for the package.
I have found everything needed at https://github.com/openhab/openhab2-addons/pull/1589/commits/c6370a02665415780392ee71c2a91f5124a4a4e1 and going to test now.
Thank you.
BR.
Marek.


(Wesley Stroop) #23

hi mark,
I’m trying to get it up and running, but I’m very new to OpenHab2. Where do I need to put the nikohomecontrol binding?
And do i need to configure it somewhere?

Now I have put it in the addons folder, I can see in the event.log :

[ExtensionEvent ] - Extension ‘binding-nikohomecontrol’ has been installed.

But i don’t see it in the PAPER UI.

in the openhab.log I have the following error:

[WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command ‘ON’ for item ‘LivingRoom’ to handler for channel ‘nikohomecontrol:onOff:nhc:40#switch’, because no thing with the UID ‘nikohomecontrol:onOff:nhc’ could be found.

Thanks


(Mark Herwege) #24

@WesleyStroop Sorry for the late reply. I was away for a few days. Happy new year.
Make sure you are running beta5 or a recent snapshot. The binding will not work with beta4. You correctly put it i the addons folder. I see from your second log entry the bridge has been configured as you start getting the NHC messages. I believe you did not add things through a things configuration file or PaperUI. The easiest is through PaperUI. You should see things in your inbox in PaperUI. Add the things you want in OpenHab from the Inbox. If you have item linking - simple mode (default under configuration), items will be created automatically and should show up in the control section in PaperUI.
Let me know the result of your testing.


(Mark Herwege) #25

@fcela Happy new year. Good luck with testing and let me know how it goes.


(Wesley Stroop) #26

Hi Mark,

Happy Newyear to you too.

I’m using 2.0.0SNAPSHOT build 681, system:version 4.0.8. I assume this is the latest one, as I recently downloaded it from openhab.org. I’m using it on the latest debain version via a virtual machine.
The PAPERUI is not automatically showing the binding in my inbox.
“Inbox > Choose Binding” is empty.

in the addons.cfg:

package = simple
binding = nikohomecontrol

thanks,


(Mark Herwege) #27

@WesleyStroop You should not have to put anything in the addons.cfg file. I didn’t. The only thing to do is to copy the binding in the addons folder and openHab should pick it up automatically. If you then go to PaperUI, you should see the binding in the Configurations->Binding menu.
Then go to the Inbox menu and add the bridge manually. You do this by clicking search for things at the bottom and selecting Niko Home Control if it is already there. If so, it will scan and then give you the option to add a thing. Select the NikoHomeControl bridge. Note you should only have one bridge in your system. You can verify this in the Configuration->Things menu. If you already have one there, remove it first.
When the bridge gets added, you can scan for switches and dimmers through the automatic scan. These should appear in your inbox. When you then accept them, they become things and items.
If you want to start from scratch, the best approach is to stop openHab and remove the Jsondb files in userdata/jsondb. It will remove all your items and things.
If this does not work for you, can you try switching on debug logging from the karaf console and provide me the logfiles? This will give me more info on where it blocks. To set debug level, type the following in the karaf console: log:set DEBUG org.openhab.binding.nikohomecontrol, see here.


(Stefaan Bolle) #28

Does this binding also work for plain old Nikobus controllers with PC-module?


(Mark Herwege) #29

@stefaanbolle No, this is very different technology. I don’t have any knowledge about Nikobus. There is a Niko Home Control gateway between the two, but I would not know how much you would be able to control if you have that. I never looked into it in detail.


(Stefaan Bolle) #30

@Mherwege Thanks!


(Mark Herwege) #31

For all wishing to test, documentation is available in my git repo here.


(Wesley Stroop) #32

I reinstalled my virtual machine Debian, installed java 8, installed beta5 offline, moved the niko jar in the addons folder.
Started the openhab2 server, and went to the website, but no bindings could be found. When I manually add for example binding = sonos in addons.cfg, it shows me the sonos binding, but not the niko one.
I will try again tomorrow and then send you the log-files.
rgds,


(Mark Herwege) #33

@WesleyStroop Sorry to see you have problems with this. I am running this on a Windows 10 PC. I just tested again removing the jar file from the addons directory, removing the bundle from openhab, adding it back, and stopping and restarting openhab. The binding correctly goes away and is reinstalled. I don’t have to do anything in the configuration files.
Just a few suggestions:

  • Put the addons.cfg file back to its initial state. This file will indicate what gets started at the very first launch. Simple in your file means minimum addons (only things that can be managed through the user interface). If you launch the UI with the default file for the first time, it should come up with a selection screen to choose the package. Pick standard or advanced.

  • Add the binding to the addons directory.

  • Start openHab and type bundle:list in the karaf console. Do you see the Niko Home Control binding in the list? If so, the binding is installed.

  • If it is there, you could try uninstalling from the console using bundle:unistall id, where id is the id you get from bundle:list. Then stop openHab and start again. Check if the bundle is there. It should if you have it in your addons directory.

  • Did you put any configuration in the things or items files for Niko Home Control? Please remove these if you did. Rather try through PaperUI. Looking at your previous log file, it looked like the binding was there, but there was a mismatch between the thing and item. The thing should have been: nikohomecontrol:onOff:nhc:40, not nikohomecontrol:onOff:nhc as in the log file. See here for the binding documentation.

It is normal for the Sonos binding to be picked up when you have it in the addons.cfg file. This binding is already part of the distribution. The Niko Home Control binding is not, so that is probably the difference. That’s why manual loading is required.


(Wesley Stroop) #34

Hi Mark,

I did again a clean install of everything, new debain jessy/ new java8 / openhab2b5 / niko.jar in addons folder.
No adjustments to anything, as you recommended.

bundle:list shows me no NIKO, executed command

bundle:list | grep niko

after searching the openhab forums, it seems that I can install via this command:

openhab> bundle:install https://github.com/mherwege/niko-homecontrol/blob/master/addons/binding/org.openhab.binding.nikohomecontrol/org.openhab.binding.nikohomecontrol-2.0.0-SNAPSHOT.jar?raw=true
Bundle ID: 179

So it’s now installed.

openhab> bundle:list
179 | Installed | 80 | 2.0.0.201612210807 | NikoHomeControl Binding

But still no binding available in the Paper UI

When I run bundle:restart 179
I get in my error log following

2017-01-04 21:47:31.280 [DEBUG] [e.osgi.LoggingCommandSessionListener] - Command: ‘bundle:restart 179’ failed: org.apache.karaf.shell.support.MultiException: Error restarting bundles:
Unable to start bundle 179: Could not resolve module: org.openhab.binding.nikohomecontrol [179]
Unresolved requirement: Import-Package: org.openhab.core.library.types

2017-01-04 21:47:31.281 [ERROR] [apache.karaf.shell.support.ShellUtil] - Exception caught while executing command
org.apache.karaf.shell.support.MultiException: Error restarting bundles:
Unable to start bundle 179: Could not resolve module: org.openhab.binding.nikohomecontrol [179]
Unresolved requirement: Import-Package: org.openhab.core.library.types

   at org.apache.karaf.shell.support.MultiException.throwIf(MultiException.java:61)
   at org.apache.karaf.bundle.command.Restart.doExecute(Restart.java:56)[38:org.apache.karaf.bundle.core:4.0.8]

(Mark Herwege) #35

@WesleyStroop I can’t put my finger on this immediately. The dependency it refers to I believe to be a common dependency, not one created by the nikohomecontrol binding. So I am surprised to see karaf is not able to resolve that dependency. I am on a slightly older build and will try with a newer build in the next few days. I will keep you posted.


(Mark Herwege) #36

@WesleyStroop I upgraded my openHab install and tried again myself. I now had the same error at initial startup of openHab. However, when I stopped the openHab server and started again, all was fine.
I have updated the binding to better handle disconnects and reconnects to the IP interface. I have now put it on dropbox as gitHub sometimes causes corruption when downloading binary files. Can you try this version?


(Wesley Stroop) #37

It worked, now it automatically found the niko jar in the addons folder.

I will test further.

Thanks already for the efforts done,


(Wesley Stroop) #38

All seems to be working fine, automatically fills the inbox. But it seems that only the first setup is found. Later added switches are not found.
Also need to test the dimmers, for this i need to resetup the niko itself, which will take a bit more time.

Thanks already very much for this.


(Mark Herwege) #39

@WesleyStroop Do you mean you run openHab with the binding, and than change the configuration in the Niko Home Control controller to add switch or dimmer actions? The discovery does not run automatically. It runs when the binding is added, or when it is called for an existing binding from paperUI. I don’t think it makes sense to run this continously or as a scheduled job because you typically do not change the Niko Home Control setup a lot. When you start the discovery again from paperUI on the already configured bridge, all new actions should be found and ones that do not exist anymore should get removed. Things or items will not be touched.
Also note only actions in the Niko Home Control controller assigned to the Niko mobile app are visible to the binding. Can you check you see the action (switch or dimmer) in the Niko app?


(Wesley Stroop) #40

It seems all is discovered.

Only the “Turn off everything” is not found.

I just noticed that this is a different icon then the others. I can manually add it maybe, by using the numbers at the end, which are not available.

nikohomecontrol:onOff:088e7f33:55
nikohomecontrol:onOff:088e7f33:56
nikohomecontrol:onOff:088e7f33:58
nikohomecontrol:onOff:088e7f33:70
nikohomecontrol:onOff:088e7f33:71
nikohomecontrol:onOff:088e7f33:72
nikohomecontrol:onOff:088e7f33:73
nikohomecontrol:onOff:088e7f33:77


(Mark Herwege) #41

@WesleyStroop Is “Turn off everything” visible in the Niko app? If so, I would expect it to be discovered.
The numbers that are not available are, or not used, or not configured for the Niko app. I have notice in my setup there are numbers missing, most likely due to configuration changes. When an action is removed, you may have a hole in the numbering scheme.
If you are sure you see the action in the Niko app, could you try turning on DEBUG logging for the binding and get me a copy of the discovery part in the DEBUG log? See here how to do that. I am curious to see if there is a specific json string for this “Turn off everything” action the binding cannot interpret.