Niko Home Control II

I have been incomplete in my instructions to use this. You need a recent openHAB 2.4 snapshot or milestone release. If you already have the Niko Home Control binding installed, you will need to uninstall it before putting the new binding version in the addons directory.
The binding relies on the v2 mqtt transport. As long as the new binding version is not part of the release (i.e. the code has not been merged yet), you will need to make sure this is available in your system. You can do that by manually installing the feature in the karaf console (feature:install esh-io-transport-mqtt) or by installing the mqtt v2 binding. Just having the binding there without configuration will fulfill the pre-requisite.

Not working here unfortunately. Also showing 2 IP addresses. 192.168.0.199 is the CoCo.

   ==> /var/log/openhab2/openhab.log <==
2018-11-25 23:35:25.945 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho693666196230231 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-25 23:35:25.949 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.165'. Next attempt in 10000ms
2018-11-25 23:35:25.958 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.165' with clientid paho693606189004898 and file store '/var/lib/openhab2/mqtt/192.168.0.165'
2018-11-25 23:35:25.961 [WARN ] [l.nhc2.NikoHomeControlCommunication2] - Niko Home Control: error in mqtt communication, {}
org.eclipse.smarthome.io.transport.mqtt.MqttException: MqttException with reason 0
	at org.openhab.binding.nikohomecontrol.internal.protocol.nhc2.NhcMqttConnection2.startConnection(NhcMqttConnection2.java:125) ~[?:?]
	at org.openhab.binding.nikohomecontrol.internal.protocol.nhc2.NikoHomeControlCommunication2.startCommunication(NikoHomeControlCommunication2.java:112) ~[?:?]
	at org.openhab.binding.nikohomecontrol.internal.handler.NikoHomeControlBridgeHandler.lambda$0(NikoHomeControlBridgeHandler.java:74) ~[?:?]
	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) [?:?]
2018-11-25 23:35:26.020 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-25 23:35:26.025 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho693546224164985 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-25 23:35:29.046 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms

@cwegh Sorry about this.
How did you configure the binding? Did you do it through PaperUI? Did you set any parameters? Do you have any ip reservation for your CoCo in you router? Are you sure there was no bridge already configured before addinga new one?

I would suggest trying to clear the cache before trying again.

The only reason I would expect different ip addresses is when the CoCo switches ip at some point in time. I have seen that behaviour with v1, so the dhcp lease durations did not seem to respected. I am not surpised it does not work if it finds two different ip addresses (it should recover though).
Can you provide a full log from starting the binding to the point above? I want to see the discovery part. Make sure you remove the current bridge before doing that.

Thanks,

Mark

Hi Mark

  1. Through Paper UI
  2. Manual set the IP address (although it sometimes gets overwritten)
  3. I use fixed IP address using MAC reservation in DHCP
  4. I did a fresh install

I am hosting Openhab on a Ubuntu server. Also I have seen this behavior in the previous version.

How to clear the cache?

I’ll completely uninstall openhab and I’ll provide the log. Which exact log do you want? openhab.log and/or events.log?

KR

C.

@cwegh,

Try not setting an ip in the binding. It is normal it gets overwritten if the CoCo updates the ip on its side.
I would need an openhab.log with debug enabled.

To clear cache, you can use the openhab-cli. I don’t know the command by heart, would need to look it up.

Hi Mark

Below the debug log. 192.168.0.199 is my Ubuntu server hosting Openhab, this is not CoCo (192.168.0.192).

2018-11-26 19:57:25.861 [DEBUG] [org.openhab.binding.nikohomecontrol ] - BundleEvent STARTING - org.openhab.binding.nikohomecontrol
2018-11-26 19:57:25.881 [DEBUG] [org.openhab.binding.nikohomecontrol ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=344, service.bundleid=190, service.scope=bundle, component.name=org.openhab.binding.nikohomecontrol.internal.NikoHomeControlHandlerFactory, component.id=203} - org.openhab.binding.nikohomecontrol
2018-11-26 19:57:25.890 [DEBUG] [ikoHomeControlBridgeDiscoveryService] - Niko Home Control: bridge discovery service started
2018-11-26 19:57:25.891 [DEBUG] [ikoHomeControlBridgeDiscoveryService] - Niko Home Control: Start background bridge discovery
2018-11-26 19:57:25.892 [DEBUG] [ikoHomeControlBridgeDiscoveryService] - Niko Home Control: discovery broadcast on 192.168.0.255
2018-11-26 19:57:25.893 [DEBUG] [nal.protocol.NikoHomeControlDiscover] - Niko Home Control: IP address is /192.168.0.199, unique ID is 302e302e302e
2018-11-26 19:57:25.894 [DEBUG] [ikoHomeControlBridgeDiscoveryService] - Niko Home Control: NHC II bridge found at /192.168.0.199
2018-11-26 19:57:25.899 [DEBUG] [org.openhab.binding.nikohomecontrol ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=345, service.bundleid=190, service.scope=bundle, component.name=org.openhab.binding.nikohomecontrol.internal.discovery.NikoHomeControlBridgeDiscoveryService, component.id=204} - org.openhab.binding.nikohomecontrol
2018-11-26 19:57:25.911 [DEBUG] [org.openhab.binding.nikohomecontrol ] - BundleEvent STARTED - org.openhab.binding.nikohomecontrol
2018-11-26 19:57:32.483 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:57:32.485 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:57:42.486 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:57:42.488 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:57:52.489 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:57:52.493 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:58:02.494 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:58:02.502 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:58:12.503 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:58:12.508 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:58:22.494 [DEBUG] [very.NikoHomeControlDiscoveryService] - Niko Home Control: discovery service org.openhab.binding.nikohomecontrol.internal.handler.NikoHomeControlBridgeHandler2@64c13af9
2018-11-26 19:58:22.496 [DEBUG] [org.openhab.binding.nikohomecontrol ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=346, service.bundleid=190, service.scope=singleton} - org.openhab.binding.nikohomecontrol
2018-11-26 19:58:22.510 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:58:22.512 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:58:25.895 [DEBUG] [ikoHomeControlBridgeDiscoveryService] - Niko Home Control: discovery broadcast on 192.168.0.255
2018-11-26 19:58:25.896 [DEBUG] [nal.protocol.NikoHomeControlDiscover] - Niko Home Control: IP address is /192.168.0.199, unique ID is 302e302e302e
2018-11-26 19:58:25.897 [DEBUG] [ikoHomeControlBridgeDiscoveryService] - Niko Home Control: NHC II bridge found at /192.168.0.199
2018-11-26 19:58:32.518 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:58:32.520 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:58:42.520 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:58:42.523 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:58:52.524 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:58:52.530 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:59:02.531 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:59:02.533 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:59:12.534 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:59:12.536 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:59:22.537 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:59:22.542 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:59:25.897 [DEBUG] [ikoHomeControlBridgeDiscoveryService] - Niko Home Control: discovery broadcast on 192.168.0.255
2018-11-26 19:59:25.899 [DEBUG] [nal.protocol.NikoHomeControlDiscover] - Niko Home Control: IP address is /192.168.0.199, unique ID is 302e302e302e
2018-11-26 19:59:25.899 [DEBUG] [ikoHomeControlBridgeDiscoveryService] - Niko Home Control: NHC II bridge found at /192.168.0.199
2018-11-26 19:59:25.909 [DEBUG] [andler.NikoHomeControlBridgeHandler2] - Niko Home Control: initializing NHC II bridge handler
2018-11-26 19:59:25.909 [DEBUG] [andler.NikoHomeControlBridgeHandler2] - Niko Home Control: touch profile Keuken
2018-11-26 19:59:25.912 [DEBUG] [l.nhc2.NikoHomeControlCommunication2] - Niko Home Control: initializing for mqtt connection to CoCo on 192.168.0.199:8883
2018-11-26 19:59:25.913 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho767106170535616 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:59:25.929 [WARN ] [l.nhc2.NikoHomeControlCommunication2] - Niko Home Control: error in mqtt communication, {}
org.eclipse.smarthome.io.transport.mqtt.MqttException: MqttException with reason 0
	at org.openhab.binding.nikohomecontrol.internal.protocol.nhc2.NhcMqttConnection2.startConnection(NhcMqttConnection2.java:125) ~[?:?]
	at org.openhab.binding.nikohomecontrol.internal.protocol.nhc2.NikoHomeControlCommunication2.startCommunication(NikoHomeControlCommunication2.java:112) ~[?:?]
	at org.openhab.binding.nikohomecontrol.internal.handler.NikoHomeControlBridgeHandler.lambda$0(NikoHomeControlBridgeHandler.java:74) ~[?:?]
	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) [?:?]
2018-11-26 19:59:32.542 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:59:32.544 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:59:42.545 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:59:42.547 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 19:59:52.547 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 19:59:52.551 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:00:02.554 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:00:02.559 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:00:12.561 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:00:12.562 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:00:22.563 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:00:22.565 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:00:25.914 [DEBUG] [ikoHomeControlBridgeDiscoveryService] - Niko Home Control: discovery broadcast on 192.168.0.255
2018-11-26 20:00:25.916 [DEBUG] [nal.protocol.NikoHomeControlDiscover] - Niko Home Control: IP address is /192.168.0.199, unique ID is 302e302e302e
2018-11-26 20:00:25.916 [DEBUG] [ikoHomeControlBridgeDiscoveryService] - Niko Home Control: NHC II bridge found at /192.168.0.199
2018-11-26 20:00:25.938 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:00:25.946 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho767106170535616 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:00:32.565 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:00:32.572 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:00:35.947 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:00:35.948 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho767106170535616 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:00:42.573 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:00:42.574 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:00:45.949 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:00:45.951 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho767106170535616 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:00:52.575 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:00:52.578 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:00:55.952 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:00:55.954 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho767106170535616 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:01:02.581 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:01:02.583 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:01:05.954 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:01:05.956 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho767106170535616 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:01:12.585 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:01:12.587 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:01:15.957 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:01:15.959 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho767106170535616 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:01:22.587 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:01:22.589 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:01:25.917 [DEBUG] [ikoHomeControlBridgeDiscoveryService] - Niko Home Control: discovery broadcast on 192.168.0.255
2018-11-26 20:01:25.919 [DEBUG] [nal.protocol.NikoHomeControlDiscover] - Niko Home Control: IP address is /192.168.0.199, unique ID is 302e302e302e
2018-11-26 20:01:25.919 [DEBUG] [ikoHomeControlBridgeDiscoveryService] - Niko Home Control: NHC II bridge found at /192.168.0.199
2018-11-26 20:01:25.960 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:01:25.961 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho767106170535616 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:01:32.589 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms
2018-11-26 20:01:32.591 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.199' with clientid paho766542489655099 and file store '/var/lib/openhab2/mqtt/192.168.0.199'
2018-11-26 20:01:35.962 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.0.199'. Next attempt in 10000ms

@cwegh
This is very strange. I did not touch the logic to find the ip for the controller from the v1 binding at all. And it works for all others.
Can you try removing the bridge from PaperUI? The bridge should then appear in the inbox again. Accept this bridge in the inbox. Post the log here.
Thanks,
Mark

Hello @cwegh and @wvanvlaenderen, glad to see people can finally benefit from the work @Mherwege and I have performed so far. It took a lot of time to understand how the NHC2 controller can be controlled by private MQTT messages. So far we are able to control lights and dimmers via MQTT. Based on this research and commands, @Mherwege wrote this first implementation.

@Mherwege, for me the lights are working but the dimmer still needs some more investigation.

I suspect it is a v1 problem, where I had the same behavior.

I’ll try your option and post the logs.

@cwegh I had a look at the discovery mechanism code again. I don’t understand how it can ever return the IP address of your Ubuntu server. The binding sends a UDP discovery packet to the broadcast address (in your case 192.168.0.255), port 10000. The CoCo listens on this port and responds with a packet. The source address of this packet is used as the address of the CoCo.
Is their something special in the firewall setup of your Ubuntu server that does something with the source address of incoming UDP packets?
You could try wireshark to debug this and look for an UDP broadcast packet being sent to port 10000 from the Ubuntu server, and the response to that.
Alternatively, try installing on a different machine and see if you have the same behaviour.

If you have Ubuntu, please check the status of your firewall with:

sudo ufw status verbose

In your case, sending hex 44 to 192.168.1.255 on port 10000 should give a reply like this:

… … … … … … C0 A8 01 10 FF FF FF 00 19 02 01 02 00 03 00 02 00 E3 22

It’s actually kind of impossible that your system running Openhab returns a packet with 02 as the value of the 16th byte :slight_smile:

private void setIsNhcII(DatagramPacket packet) {
    byte[] packetData = packet.getData();
    int packetLength = packet.getLength();
    // The 16th byte in the packet is 2 for a NHC II Connected Controller
    if ((packetLength >= 16) && (packetData[15] >= 2)) {
        this.isNhcII = true;
    } else {
        this.isNhcII = false;
    } 

You can easily check this yourself with Packetsender (https://packetsender.com/download) on Windows or Linux.

@Mherwege , maybe it’s possible to add other checks for NHC2, although I think your method should just work. In case the system running Openhab has 2 (or more configured) IP addresses in a different subnet, the right one can be determined by checking from which subnet there is an active connection to port 8080 (webinterface Openhab). We can assume that one has an active connection when configuring/installing the NHC binding right?

Another approach of finding the controller is checking the Mac address with ARP. I think all Niko devices start with 00:11:2A:xx:xx:xx but I can only verify this for my 550-00003 controller

Also, on a NHC2 device, multiple TCP ports are open. I cannot tell if this is the same on a NHC1 controller:

22,80,3579,3580,5060,5061,8001 and most importantly, port 8883 for the encrypted MQTT communication. This could be another extra check, just to be sure.

Btw, I discovered that sending the 0x44 UDP packet on port 5353 gives the same reply as sending it on port 10000 :wink:

Very nice that they basics voor nhc2 are working! I’ll now have a look when I can upgrade my installation to nhc2. Good job!

Hello,
Nhc2 binding can not control blinds yet? I
am looking to obtain gateway to upgrade to Nhc2, but the blinds are necessary for me.
Thank you.

@fcela, Niko Home Control 2 can control blinds, the binding in development cannot yet.

We are still looking for people with energy devices in their setup. Based on the parameters currently known to us we could probably get this kind of info from the coco:

ModelType (or EnergyModelType)
MacAddress
Channel
MeterType
FlowType
Segment
PulsesPerUnit
ClampType
ShortName
GasVolume
WaterVolume
ElectricalEnergy
ElectricalPower
ReportInstantUsage

For example, the mqtt payload for the live energy usage:

payload {“Method”:“devices.status”,“Params”:[{“Devices”:[{“Properties”:[{“ReportInstantUsage”:“True”}]
payload {“Method”:“devices.status”,“Params”:[{“Devices”:[{“Properties”:[{“ElectricalPower”:“526”}]

As this is “live” data (Electrical Power = 526Watts), we should be able to gather this info and process it in Openhab. Historical data like energy readings over a certain timespan are presumably saved in the Niko Core (cloud). So whenever you consult this kind of info, an encrypted connection is made through the touchscreen or the android/ios app.

Mark,

Great work, thx! Where can i download the new binding? dropbox link nog longer works… kr, Nicolas

We are running some final tests for the switches and dimmers. @Mherwege has done some initial work on the thermostats for nhc2 but we have not been able to test this yet.

We hope to be able to support:

  • switches
  • dimmers
  • thermostats
  • all on/off functions (with autoupdate=false integrated in the code so you can configure it as a pushbutton)
  • functions that are triggered by PIR sensors (same principle as all on/off function)
  • mood control pushbuttons (toggle the moods (sferen) that are created in the NHC2 software) More Info
  • notifications in NHC programming software (channel triggers for creating rules for push and informative messages) More Info
  • energy readings (live power readings with eventually data gathered over time in a database)
  • shutters

We are still looking for people with the following:

  • shutters
  • moods (sferen) programmed in their setup
  • gas/water meters

It would help a lot if you could help us provide the necesarry logs.

Please pm me if you want to help.

I still have NHC I, but the moods aren’t a special thing. They are just actions, which you probably connect to multiple lights/sockets. I also have the mood control, but this is just a display where you can toggle different actions. A mood can also just be one light eg. I don’t think this way of working is changed in NHC II.

I have just upoaded a new version ready for further testing. @bccrew has been a very big help in testing the alpha version of this binding. We had some challenges, but I hope we are getting closer. I still don’t have NHC II myself, so I very much depend on all of your testing and giving feedback.

What has been programmed:

  • on/off lights
  • dimmer lights
  • all off and scenes (as push buttons), whereby scenes have not specifically been tested
  • notifications
  • thermostats, initial implementation needs full testing

The up-to-date README is here.

You can download the latest binding jar here.

To reach feature parity with the NHC I functionality in the binding I am looking for someone willing to spend time providing inputs (logs) and testing the binding with rollershutters.
A nice extension beyond NHC I functionality, and already on the radar, is energy measurements.

I have energy measurements for water, gas and electricity (including solar power). Also have “sferen”. Also have thermostats. But I do not have a working OpenHAB system :slight_smile:

I’ll try to setup a RPI with Openhabian. Maybe the hypervisor layer does something weird in the virtual machine and that is way it is not working (installed Openhab on an ESXi VM). Had the same issue with v1.

If I get it working, I’ll provide some logs.