Niko Home Control II

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.

Some updates:

Should not be touchprofile but profile it seems. Getting grip on the syntax now. Next step is adding all things and backing the files up. Also looking to using GIT and autocommit on Openhab server backend (already commiting the entire config folder). I want to have the flexibility to do a fresh install without losing all logic (and comments in the code).

Is pushbutton an official thing type? I thought it was only onOff, dimmer and blind?

Also:

  • NHC2 file is a sqllite file when unzipping. It includes among others a table named “Action” which contains a column “FifthplayId” which are the actionIDs (had already copy pasted it from discovery, but good to know).
  • Bought in promotion a Google Home Mini. Works a charm!

Thanks for noticing the documentation error. I will check it again.

pushButton is supported for nhc II for the specific actions linked to scenes, allOff and some others. Thermostat should also work. blind does not work for nhc II yet (nobody with blinds to test so far, and limited time on my side).

I will have a look again at documentation soon. This is a moving target.

@cwegh Also thanks for finding the id reference. Are you sure it isfifthPlayID? I noticed they use a different ID when communicating to their cloud vs locally. I see 2 ID’s in the json messages.

Just checked, the Ids I get from auto-discovery are definitely the fifthplayIds. The first columns also contains similar Ids, but those are not the correct ones.

OK good too know. I do see indeed the PIRs and Scenes are discovered as pushbuttons.

The nasty bugs are almost gone. Please give feedback on the newest version of the binding. There is currently a bug in the latest snapshots where it is impossible to install the required MQTT binding so please try latest 2.4.0 or the 2.5.0 Milestone1 (TESTING builds).

org.openhab.binding.nikohomecontrol-2.5.0-SNAPSHOT

Nice movie about Niko btw :wink: