Niko Home Control II

In OH2 2.5.0 the embedded broker is called " MQTT Broker Moquette"

Hi!

Iā€™m trying to use the Niko Home Control II binding with openHAB in order to link it with homekit. I can install openHAB properly (tried once on ubuntu VM and on Mac), but keep getting ā€œOFFLINE - COMMUNICATION_ERRORā€ with the bridge binding. It finds the IP correctly (which if entered in a browsers goes to the niko interface correctly), but keep getting that error and therefor cannot go further.

Any help would be greatly appreciated!

Please provide a bit more information about which steps you followed to install Openhab.

Which version are you running? What do the debug logs say? (Scroll up for instructions on how to provide debug logging in the karaf console)

Already thank you for taking the time to reply!

ā€¢ Niko Controller software version: 2.5.4.9816, has IP 192.168.1.122

ā€¢ Running openHAB 2.4.0-1 (ā€œstandardā€ setup) on fresh ubuntu 18.04 install (at 192.168.1.7, VM on local server), following the steps at https://www.openhab.org/download/.

ā€¢ Went to paper UI > add-ons > bindings > installed Niko Home Control Binding (binding-nikohomecontrol - 2.4.0). Followed by Inbox > clicking the checkmark (adding new thing nikohomecontrol:bridge:443b00ee64e7). Not finding any ā€œthingsā€. When going to things, it shows up, but with OFFLINE - COMMUNICATION_ERROR. When clicking the pencil icon it does show the correct IP 192.168.1.122 from the niko home control.

Here is the latest output from log:display

13:13:49.764 [INFO ] [smarthome.event.ExtensionEvent       ] - Extension 'binding-nikohomecontrol' has been installed.
13:13:49.773 [INFO ] [ig.discovery.internal.PersistentInbox] - Added new thing 'nikohomecontrol:bridge:443b00ee64e7' to inbox.
13:13:49.774 [INFO ] [smarthome.event.InboxAddedEvent      ] - Discovery Result with UID 'nikohomecontrol:bridge:443b00ee64e7' has been added.
13:14:33.159 [INFO ] [smarthome.event.InboxRemovedEvent    ] - Discovery Result with UID 'nikohomecontrol:bridge:443b00ee64e7' has been removed.
13:14:33.174 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'nikohomecontrol:bridge:443b00ee64e7' changed from UNINITIALIZED to INITIALIZING
13:14:33.182 [WARN ] [protocol.NikoHomeControlCommunication] - Niko Home Control: error initializing communication from thread 207
13:14:33.190 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'nikohomecontrol:bridge:443b00ee64e7' changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): Niko Home Control: error starting bridge connection
13:14:33.264 [WARN ] [overy.NikoHomeControlDiscoveryService] - Niko Home Control: not connected.

Any more information I can / need to provide?

Hi, you will need to read this topic a bit more. Standard 2.4 setup requires the installation of the MQTT binding as well as one of the development jars of the NHC binding. The one you installed doesnā€™t support NHC2.

So, you either continue with OH 2.4 and install the MQTT binding and drop this jar in the addons folder.

Or you switch to one of the newest testing builds. (uninstall and reinstall the NHC binding)

Thank you very much for your help! Taking the router of installing the MQTT binding and adding the jar worked. First tried to create a new install with the latest snapshot, but kept getting not found errors from openHAB. Will look into that later.

Now all ā€œthingsā€ from my niko home control show up perfectly. Now the next challenge, homekit integration :sweat_smile: I know what to do this weekend.

Thank you once more!

Let uw know if you got it working. Others might learn from your efforts too :wink:

Just a quick follow up. Iā€™ve got it all working, except for the blinds. All switches and lights that are controllable with Niko are now also in HomeKit. The documentation is quite thorough and setup quite straightforward. I needed to read up a bit on the config files for items and such, but I guess thatā€™s a basic prerequisite if you want dive into openHAB :-). Thank you once more for the assistance and great binding!

Congrats @jonasvdc !

Can control the blinds from Openhab? Or just not from Homekit?

Works perfectly fine in openhab. Can control them without issues in the basicUI after creating the sitemap. Just not in homekit. Asked there in the support, but no answer as of now.

Actually I think that blinds are not really supported by homekit. I remember that some people use a workaround by configuring their blinds as a dimmer so they can ask Siri to open the blinds 50% etc.
Only problem with that is that when you use the all-off function from NHC2, it will probably also close your blinds :slight_smile:

Thank you for the tip, will give that a try!

I updated my installation to openHAB 2.5.0 M2 and my textual config is giving errors.
I did not change anything after the update, Iā€™m 100% sure it all worked before :slight_smile: (NHC1)

.things (took 1 as example)

Bridge nikohomecontrol:bridge:nhc [ addr="192.168.0.xxx", port=8000, refresh=300 ] {
    dimmer  bureau          "NHC bureau"          @ "NHC" [ actionId=1 ]
}

The thing stays in state INITIALIZING. The Bridge is ONLINE
When I add the thing via GUI (discovery) it works immediately.

Manual channel: nikohomecontrol:dimmer:nhc:1
GUI channel: nikohomecontrol:dimmer:nhc:bureau

I also removed everything, removed all Things and only added the following line (not nested anymore) + restarted, but gives the same error

Thing nikohomecontrol:dimmer:nhc:bureau "NHC bureau" @ "NHC" [ actionId=1 ]

Log:

2019-08-18 23:30:30.340 [WARN ] [me.config.core.internal.ConfigMapper] - Could not set field value for field 'actionId': Can not set java.lang.String field org.openhab.binding.nikohomecontrol.internal.handler.NikoHomeControlActionConfig.actionId to java.math.BigDecimal
java.lang.IllegalArgumentException: Can not set java.lang.String field org.openhab.binding.nikohomecontrol.internal.handler.NikoHomeControlActionConfig.actionId to java.math.BigDecimal
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[?:?]
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[?:?]
	at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) ~[?:?]
	at java.lang.reflect.Field.set(Field.java:764) ~[?:?]
	at org.apache.commons.lang.reflect.FieldUtils.writeField(FieldUtils.java:523) ~[42:org.apache.commons.lang:2.6.0]
	at org.apache.commons.lang.reflect.FieldUtils.writeField(FieldUtils.java:500) ~[42:org.apache.commons.lang:2.6.0]
	at org.apache.commons.lang.reflect.FieldUtils.writeField(FieldUtils.java:560) ~[42:org.apache.commons.lang:2.6.0]
	at org.eclipse.smarthome.config.core.internal.ConfigMapper.as(ConfigMapper.java:102) [138:org.openhab.core.config.core:2.5.0.M2]
	at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:80) [138:org.openhab.core.config.core:2.5.0.M2]
	at org.openhab.binding.nikohomecontrol.internal.handler.NikoHomeControlActionHandler.initialize(NikoHomeControlActionHandler.java:210) [239:org.openhab.binding.nikohomecontrol:2.5.0.M2]
	at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [133:org.openhab.core:2.5.0.M2]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [133:org.openhab.core:2.5.0.M2]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

2019-08-18 23:30:30.352 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: null
	at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) ~[?:?]
	at org.openhab.binding.nikohomecontrol.internal.handler.NikoHomeControlActionHandler.lambda$1(NikoHomeControlActionHandler.java:237) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

Try putting the actionId in quotes. I have changed the type to string for NHCII and didnā€™t see an impact when testing. But I didnā€™t try textual config.

Thanks, it solved the problem! Actually I should have know it, because the error pointed in that directionā€¦

btw, I also changed some onOff thing types to ā€˜pushButtonā€™. Was there a special reason to implement these stateless actions in another way?

@wars For consistency with nhcII again. If you ā€˜pushā€™ AllOff (or the same would apply for a scene I think), there really is no state change. Pushing AllOff a second time would do the same thing. So ideally you donā€™t get the state change in openHAB (autoupdate = false). It just pushes it through to Niko if you trigger from the openHAB side. If you trigger from the Niko side, openHAB should do nothing with it (so no state change).

Hmm, I have some strange behaviour.

I had a working bridge, dimmers, buttons etceteraā€¦ I thought I had some problems because my bridge stayed offline (eventually it was a stupid error in my LAN setup).

I tried to remove my bridge and add it again. It was after a while that I found the error in my LAN setup. My bridge was back online but I noticed all the dimmers and other things were not working anymore, although they show the status ā€œonlineā€.

I guessed it had to do with my new bridge so I removed a dimmer and added it again via the inbox where the dimmer showed up again.

Itā€™s still not working. Immediately after I add the dimmer via the inbox, the status is online, when I switch the dimmer to On it shows the error ā€œNiko Home Control: actionId 5e0a1093-2d12-4e82-922c-142d97a884d8 does not match an action in the controllerā€

Huh? I just added it to my system via the automatic discovery in the inbox, so the actionID must be right, no? Furthermore, I can find that ID in the logs of my Niko APP on my android phone, so it must be right no?

Can somebody help me? Do I have to delete some folder with some cache or something? Is there a way I can debug this further and give some extra information?

(Running OH 2.4 with the downloaded JAR file above)

Please clean your logs in /var/log of equivalent on windows and run a full startup of OH. Then post your logs here. Put the binding in debug mode too if you want.

@Dries_V Did you manage to solve your issues?

This morning, the Niko Home Control hobby API went live. Binding will get adapted soon after testing.

2 Likes