[SOLVED] [Main] Konnected Binding

@Douglas_Wielfaert

No the konnected devices merely send data to openhab.

The blue light is an activity light on the wifi module. So that means it is sending data or trying to send data.

To debug please turn debug logging on and send me a complete log file when the problem is happening.

Also do you know how to login to the status page of the konnected device? If so please send me a screenshot of that page. (you access it at http://ipadressofdevice:secretport)

This address and port can be found under the discovered thing properties in paperUI.

So I suppose it took three weeks of reading posts, lurking in this thread and finally daring to post that led to a quick solution. I wondered about the power to the Konnected board and today Konnected support asked for the specs on the PS that I got from them. I found a quality 4 amp 12v PS from an old router and using that immediately stabilized the board! I may be circling back later to ask about Java errors, but for now, I’m good.

Thanks for your work on the binding!

@Douglas_Wielfaert glad you got it sorted.

Hello! Could you please send me the gerber/schematic files of the board you made?
Thank you!

https://easyeda.com/chemmings60/konnected-addon-board

EDIT: I tracked down the issue as an improper network setting in Configuration-System-Network. After properly setting the Primary IP address and Broadcast IP, everything started working. This must have inadvertently got changed during an update. Reading through this entire thread gave the clue where to look for the root cause. Thanks connoroh(Connor Robinson) for the insight.

I’ve been using the Konnected Interface Module and OpenHAB for more than a year without issue. Recently, the past few weeks, I noticed that OpenHAB was not updating the Konnected zones status. I’m struggling to determine if it is a hardware issue or binding software issue as both “appear” to be fine. I am running Konnected Firmware version 2.3.5 and OpenHAB 2.5.5. What I have done so far is downgraded OpenHAB to 2.5.0, incrementally moved to 2.5.5 (ie 2.5.1., 2.5.2,etc) Uninstalled and reinstalled the binding. Downgraded the firmware to 2.3.4, reset the wifi, all to no avail.

I see the Konnected LEDs change state when zones are updated (switches open or close) but OpenHAB does not update. I am able to use the Konnected App to see the pin status on Konnected Interface and they are all correct. I The OpenHAB binding is showing Konnected as Online and auto discovery works fine. I also am able to remotely ARM and DISARM the Alarm Panel through OpenHAB/Konnected, I just cannot read the zone states through OpenHAB. In OpenHAB my Zones are set as switches, and the channel ID’s are Zone_1, Zone_2, etc.

Any suggestions or ideas as to what might be causing my problem. As I said this combination of OpenHAB and Konnected has been working flawlessness for more than a year.

Hi. I’ve recently divorced my Samsung Smartthings and I’m porting all over to OpenHab. I’ve been dabbling in openhab for a long time, but just not committed. I’m running OH2.5.8 and the latest build of konnected from the bindings - org.openhab.binding.konnected-2.5.8.jar.

I’m running the latest firmware on the devices - 2.3.5 and I just cannot get the items bindings to work.

I can get the thing binding online, no worries. I create a zone channel to match the channel zone as it was on SmartThings and on the device, i.e. Zone_4. In this case its a motion sensor. I link a switch to the zone channel and boom I get an immediate exception. Everything else is working, I can see the handlers and information connecting up in debug logs, I can see the konnected device get reprogrammed and sees the new channel, I can even see the state change on the device via the /device page, however the data does not flow back to the item and the exception remains.

dependencies are installed, i’ve checked all that. At a loss.

I.e.

2020-09-16 22:31:01.800 [DEBUG] [ed.internal.handler.KonnectedHandler] - The channeltypeID is: konnected:switch

2020-09-16 22:31:01.800 [DEBUG] [ed.internal.handler.KonnectedHandler] - The payload is: {"sensors":[{"pin":6}],"actuators":[],"dht_sensors":[],"ds18b20_sensors":[],"token":"konnected:module:1635053","apiUrl":"http://10.30.1.50:8080/konnected","blink":true,"discovery":true}

2020-09-16 22:31:01.800 [DEBUG] [onnected.internal.KonnectedHTTPUtils] - The String url we want to put is : http://10.30.1.54:9635/settings

2020-09-16 22:31:01.801 [DEBUG] [onnected.internal.KonnectedHTTPUtils] - The payload we want to put is: {"sensors":[{"pin":6}],"actuators":[],"dht_sensors":[],"ds18b20_sensors":[],"token":"konnected:module:1635053","apiUrl":"http://10.30.1.50:8080/konnected","blink":true,"discovery":true}

2020-09-16 22:31:30.490 [DEBUG] [ed.internal.handler.KonnectedHandler] - The channelUID is: konnected:module:1635053:Zone_4 and the zone is : 4

2020-09-16 22:31:30.493 [DEBUG] [ed.internal.handler.KonnectedHandler] - getasstring: konnected:module:1635053:Zone_4 getID: Zone_4 getGroupId: null toString:konnected:module:1635053:Zone_4

2020-09-16 22:31:30.493 [DEBUG] [ed.internal.handler.KonnectedHandler] - The command payload  is: {"pin":6}

2020-09-16 22:31:30.494 [DEBUG] [onnected.internal.KonnectedHTTPUtils] - The String url we want to get is : http://10.30.1.54:9635/device

2020-09-16 22:31:30.495 [.ItemChannelLinkAddedEvent] - Link 'Zone4test-konnected:module:1635053:Zone_4' has been added.

==> /var/log/openhab2/openhab.log <==

2020-09-16 22:31:30.977 [ERROR] [ome.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $

	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224) ~[?:?]

	at com.google.gson.Gson.fromJson(Gson.java:888) ~[?:?]

	at com.google.gson.Gson.fromJson(Gson.java:853) ~[?:?]

	at com.google.gson.Gson.fromJson(Gson.java:802) ~[?:?]

	at com.google.gson.Gson.fromJson(Gson.java:774) ~[?:?]

	at org.openhab.binding.konnected.internal.handler.KonnectedHandler.sendSetSwitchState(KonnectedHandler.java:511) ~[?:?]

	at org.openhab.binding.konnected.internal.handler.KonnectedHandler.getSwitchState(KonnectedHandler.java:488) ~[?:?]

	at org.openhab.binding.konnected.internal.handler.KonnectedHandler.handleCommand(KonnectedHandler.java:106) ~[?:?]

	at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.channelLinked(BaseThingHandler.java:191) ~[?:?]

	at org.eclipse.smarthome.core.thing.link.ThingLinkManager.lambda$0(ThingLinkManager.java:267) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_265]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_265]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_265]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_265]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]

Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $

	at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385) ~[?:?]

	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:213) ~[?:?]

I cannot for the life of me get it wired up and working. I have tried fully removing and reinstalling everything and no change.

Thanks,
Matt

So i’ve made some progress this morning with fresh eyes. I looked at the talkback url on the device and its using the 8080 instance port of the default install. My installation is secured behind nginx on port 80 so 8080 wasn’t available. I modified my bindings and now the state changes are working.

I’ve also noticed that despite the error I previously reported, it still works. I found I had to cycle the binding to disabled and enabled again for it all to work, which is odd. But I at least have a working integration. Is there a way to modify the URl/URL for the endpoint to talk back to?

For those running openhab 3.0. (i don’t yet run it yet)

While the binding was automatically converted it seems that one of the classes that i used Smarthomeunits has changed to units. I discovered this when i was making changes to the version of the binding that adds support for the pro module. Here is a link to that thread: Konnected Alarm Panel Pro Thread In that thread i have a version of the binding that corrects that issue.

Keep in mind as I mentioned there are other changes that even if you don’t run a pro module due to some refactoring that i had to do will require you to delete and re-add your things.

!!Warning!!

  1. If you had the discovery setting turned to off (as in to disable discovery). Before deleting your things make sure to tick this checkbox back to the false position and then either restart openhab or use the update settings option on each thing. Otherwise your konnected devices will not be discovered by the new binding. Then you can uninstall the old binding and try this new version with 3.0.

I will be uploading the changes and having them pushed into the repository so evertually it will be a breaking change for everyone.

Thanks

@hewfish The binding gets its network information directly from openhab. If you have the port and ip address configured in the openhab settings the binding should pick up that information.

@John_Siemon glad you tracked it down.

Thanks for the update mate. Right now, for those of us on OH3, we can use the OH Network binding to link to an existing running version of OH, which is what im doing. Ill eventually re add the binding and link the things directly into OH3 when the binding is updated.

I’m running OH3 with the updated binding that @volfan6415 mentioned here. I’m also running an Alarm Panel Pro. Unfortunately when I attempt to configure the binding i receive the following errors:

2021-03-01 18:26:56.402 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.konnected.internal.handler.KonnectedHandler@
a14962': null
java.lang.NullPointerException: null
        at org.openhab.binding.konnected.internal.handler.KonnectedHandler.initialize(KonnectedHandler.java:293) ~[?:?]
        at jdk.internal.reflect.GeneratedMethodAccessor93.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
        at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]
2021-03-01 18:26:56.413 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'konnected:pro-module:517ba10ea7': null
java.lang.NullPointerException: null
        at org.openhab.binding.konnected.internal.handler.KonnectedHandler.initialize(KonnectedHandler.java:293) ~[?:?]
        at jdk.internal.reflect.GeneratedMethodAccessor93.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
        at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]

It’s not obvious to me at all what’s going on. I did recall coming across something about the binding getting address information from openHAB, but it wasn’t clear what this was referring to or how to fix it.

@jamgood96 can you post a full version of these logs?

I’ll see if I can sneak some free time to set this back up, but I ultimately had to go the route of flashing my Konnected alarm with ESPHome, as I was chasing my tail getting the binding to work. After some debugging on my end it appeared as though the HOST value was coming through null and making the binding unhappy. I think there’s something wonky with me running openHAB inside Kubernetes behind a proxy service. It’d be great if the binding didn’t care about this, or I could otherwise specify the callback host for the binding to send to the Konnected alarm so it could successfully reach openHAB instead of the binding having to detect the proper endpoint.

The binding gets the network information from the openhab host itself. So if that information is configured under the network setup tabs it should work.

Are you running OH3 or OH2?

I’m running OH3.

For network info, is it just grabbing the IP address and port number? What am I to do if the port openHAB is running is really just at the container level, but not what’s exposed?

I wonder if adding some config option to allow specifying your own callback url/ip/port would be beneficial?

It is pulling whatever network information the underlying instance of openhab thinks is the ip and port.

Ok i see the issue now. Let me look into this and i should be able to get a solution early next week.

@volfan6415 Thanks for the awesome tool and support! I’m getting an error trying to set it up and wondering if you can help

I just installed a brand new instance of OpenHab with the stable docker container. Using the add-on installer I added the Konnected add-on. I went to Things → + → Konnected binding → Add Manually → Create Thing. The status becomes UNITIALIZED and says HANDLER_INITIALIZING_ERROR

I turned on debug logging and this is what it shows:

21:06:50.465 [DEBUG] [cted.internal.KonnectedHandlerFactory] - The callback ip address obtained from the Network Address Service was:172.17.0.2
21:06:50.466 [DEBUG] [cted.internal.KonnectedHandlerFactory] - the port for the callback is: 8080
21:06:50.467 [DEBUG] [ted.internal.handler.KonnectedHandler] - The callback ip address is: 172.17.0.2:8080
21:06:50.468 [DEBUG] [cted.internal.KonnectedHandlerFactory] - Adding thinghandler for thing 20825b516b to webhook.
21:06:50.471 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'konnected:module:20825b516b' changed from UNINITIALIZED to INITIALIZING
21:06:50.474 [DEBUG] [ted.internal.handler.KonnectedHandler] - Checking configuration on thing konnected:module:20825b516b
21:06:50.475 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'konnected:module:20825b516b' changed from INITIALIZING to UNKNOWN
21:06:50.476 [DEBUG] [ted.internal.handler.KonnectedHandler] - The RequestTimeout Parameter is Configured as: 30
21:06:50.477 [DEBUG] [ted.internal.handler.KonnectedHandler] - The Retry Count Parameter is Configured as: 2
21:06:50.479 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.konnected.internal.handler.KonnectedHandler@43e72ca6': null
java.lang.NullPointerException: null
	at org.openhab.binding.konnected.internal.handler.KonnectedHandler.initialize(KonnectedHandler.java:293) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
21:06:50.482 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'konnected:module:20825b516b' changed from UNKNOWN to UNINITIALIZED (HANDLER_INITIALIZING_ERROR)
21:06:50.482 [ERROR] [.core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'konnected:module:20825b516b': null
java.lang.NullPointerException: null
	at org.openhab.binding.konnected.internal.handler.KonnectedHandler.initialize(KonnectedHandler.java:293) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]

I also ran:
feature:install openhab-transport-upnp
and repeated the process but got the same error. I tried click Scan too when adding the new thing but not much seemed to happen.

Is there a step I’m missing or anything I need to handle? Maybe somewhere I can manually put in the ip address and device id? My Konnected module does currently work with a separate Home Assistant instance that I have and it also shows up in the Konnected app.

Thanks!

Some progress. I don’t know if it was the right thing to do, but konnected’s website says to manually install a jar file and enable a feature in the console: OpenHAB: Konnected Binding beta : Konnected Help & Support

Once I did that, it shows it as online and no longer produces an error. Now I’m just trying to get the values from my door sensors and motion sensors.