Niko Home Control II

Hi Guys,

Revisited the thread after a while here, good lord, you guys got allot figured out in a short time.
I installed openhab on my server today but i dont get the Niko Bindings, I got the Jar file in the addon folder; restarted… not sure what i forget or doing wrong. is there a step by step somewhere to get me going?

Amazing work guys!

1 Like

@Bjorn_Embrechts Happy to see you join the testing.
We are not there yet. There is a lot working, but we also still see quite a few stability problems. But the more testing that is done, the more chance we have to figure it out.
The binding itself should work out of the box without much configuration. Don’t install the Niko Binding from the release (that is just NHC I). If you have already, uninstall that through PaperUI. Copy the binding jar, referenced up in this thread into the addons folder. Your CoCo should appear in your inbox. Accept it, and all your devices should appear in the inbo. Accept the ones you want to control.
Check the openhab.log and events.log file for any hints if this does not work.

You can switch logging to a higher logging level (DEBUG or even TRACE) to get more info. You can do that from the Karaf console, see up in this thread and the documentation. There currently is an issue when people switch back from DEBUG to DEFAULT log level. The bridge does not come back online anymore. I am curious if this is true for everyone, or just a timing issue for some users. Therefore also, please test if it comes online before switching logging to a higher level. Maybe it only happens when you switch back.

hi guys, love your work, i installed and linked everything.
if i can help let me know. i have energy devices

1 question, how do i get it to use it with homekit?
i installed the service, but the swithes dont show up.

maybe an example, its all new to me

Did you follow all instructions like described here:

Read a few posts back here where I described the correct tagging of items. It’s always best to manually create items instead of linking them through Paper UI.

Google Home and thermostats is a no-go. Below the code and a screenshot.

Group g_ThermostaatBeneden_TSAT "Living Thermostaat" [ "Thermostat", "Celcius" ]
    Number ThermostaatBeneden_Mode "Living Programma" (g_ThermostaatBeneden_TSAT) [ "homekit:HeatingCoolingMode" ] { channel="nikohomecontrol:thermostat:<id>:mode" }
    Number ThermostaatBeneden_Measured "Living Temperatuur" (g_ThermostaatBeneden_TSAT) [ "CurrentTemperature" ] { channel="nikohomecontrol:thermostat:<id>:measured" }
    Number ThermostaatBeneden_Setpoint "Living Gewenst" (g_ThermostaatBeneden_TSAT) [ "TargetTemperature" ] { channel="nikohomecontrol:thermostat:<id>:setpoint" } 

I don’t have thermostats, so cannot test. But I assume you have to create an extra item and some rules to map the Niko modes to the required homekit modes, as used by Google Assistant.
Here is an example for something similar for KNX: Google Home & openHAB connection How-To
The modes used by the binding for Niko are numbers, and documented in the binding doc (same for nhc I and II).

Didn’t know about the rules, I’ll try that.

Hello,

I found this thread because i was searching for a way to implement Amazon Alexa with my Niko connected controller. I use version NHC software 1.16.0.34.

At first i thought this wasn’t possible but after reading this thread, hope came back.

I have programmed moods (sferen), so i can help with testing if you still need this. One warning though: i’m an absolute noob in programming and everything is new.

I’ll try to follow the instructions in post 49. A big thanks to everyone who made this possible.

Ps. i’m dutch, so that explains the grammar mistakes.

niko is working on official integration with google assistant and alexa…
they replied on a tweet, no eta on when

and no word on homekit…

Got a link to the tweet?

sure, dutch tweet…

on the other hand,

my controller is found, but communication isn’t working
am i doing something wrong?

fresh install on debian

2019-01-20 21:44:43.187 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'nikohomecontrol:bridge2:443b00ee0538' to inbox.
2019-01-20 21:45:23.893 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '10.0.1.200' with clientid 10_0_1_251-nikohomecontrol_bridge2_443b00ee0538-public and file store '/var/lib/openhab2/nikohomecontrol/10_0_1_251-nikohomecontrol_bridge2_443b00ee0538-public'
2019-01-20 21:45:24.112 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '10.0.1.200' with clientid 10_0_1_251-nikohomecontrol_bridge2_443b00ee0538-profile and file store '/var/lib/openhab2/nikohomecontrol/10_0_1_251-nikohomecontrol_bridge2_443b00ee0538-profile'
2019-01-20 21:45:28.869 [WARN ] [l.nhc2.NikoHomeControlCommunication2] - Niko Home Control: exception waiting for connection start
java.util.concurrent.TimeoutException: null
	at java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1771) ~[?:?]
	at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915) ~[?:?]
	at org.openhab.binding.nikohomecontrol.internal.protocol.nhc2.NikoHomeControlCommunication2.communicationActive(NikoHomeControlCommunication2.java:186) ~[?:?]
	at org.openhab.binding.nikohomecontrol.internal.handler.NikoHomeControlBridgeHandler.lambda$0(NikoHomeControlBridgeHandler.java:81) ~[?:?]
	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) [?:?]

Yeah, there is still a bug. It should probably work if you turn on trace logging in the karaf console.

Probably a very simple question (and offtopic), where do i have to drop the .jar file? Paper UI, then bindings and then what? I searched the net for hours but i cant figure it out.

You need to copy that to:

/usr/share/openhab2/addons

Don’t install the binding through Paper UI as this one only supports nhc1

Not sure to drop this here, but I want everything configured in files e.g. things and items file instead of using PaperUI (so I can use git, have better documentation and I just prefer inline configuration now I better understand OpenHAB). However I am struggling on understanding how to configure things. I have a lot of things discovered in the inbox, but how to I map them in a things file?

Example: Add a switch which is discovered and showing up in the inbox. Tried below code, which does not work. I am also wondering that you should be able to identify what the switch exactly is, before you are able to map it. Just putting 01 in there is doing nothing according to me. I feel I am missing some basic understanding.

Bridge nikohomecontrol:bridge2: [ addr=“192.168.0.192” ] {
onOff 01 @ “Stopcontact living en TV-kast”[ actionId=01 ]
}

Anyone can help me to understand?

@cwegh I don’t use textual configuration myself, but it should work. I didn’t program anything special for it.
You are missing the touchprofile and password from your definition. You should also have an identifier for the bridge.
The important part is to get the actionId right. This is the interal Niko Home Control ID. The only easy way I know to find it is by using OH discovery. Discover you device in PaperUI, add it and edit the thing you just added. You will find a parameter Action ID. Copy the value of that action ID and keep it somewhere. Before you then add that thing to your configuration file, you need to again remove the thing accepted after discovery.

In the readme, there is an example. It should look something like this:

Bridge nikohomecontrol:bridge2:nhc2 [ addr="192.168.0.70", port=8883, touchprofile="openHAB", password="mypassword", refresh=300 ] {
    pushButton 1 "AllOff" [ actionId="12345678-abcd-1234-ef01-aa12bb34ee89" ]
    onOff 2 "Office" @ "Downstairs" [ actionId="12345678-abcd-1234-ef01-aa12bb34cc56" ]
    dimmer 3 "DiningRoom" [ actionId="abcdef01-abcd-1234-ab98-abcdef012345", step=5 ]
}

Exact the information I was looking for! I missed indeed the link with the actionID. The Niko Home Control ID does not change I presume?

No, it doesn’t change. This is the unique key all communication relies on. If Niko ever decides to chagne it, everything will break.