Tellstick binding for OpenHab2

I have seen something similar, I will try to investigate. I could do a retry before deciding that there is a communication error

I have created a new version that should retry 3 times before deciding to make the bridge/item offline.
This version also supports the refresh command, just send REFRESH to any tellstick live item and it will trigger a refresh from telldus live.
https://dl.dropboxusercontent.com/u/26815772/org.openhab.binding.tellstick-2.1.0-SNAPSHOT.jar

I have a problem with the binding. All five switches works, but when I execute a rule where four of them gets sendcommand OFF, I get a lot of errors and it takes at least a couple of minutes before all the lights are of. Same happens when I set the Lights group switch off. I use the latest snapshot, installed on a raspberry pi.

Here is a part of the log, efter the last error it’s just confirmations of sendCommands. Does anyone understand what’s happening? :slight_smile:

16:50.668 [ERROR] [andler.core.TelldusCoreBridgeHandler] - Fail
d to send msg:OFF to TellstickDevice [deviceId=45, name=vardagsrum
status=2, deviceType=DEVICE, data=null]
org.tellstick.device.TellstickException: vardagsrum: Could not con
ect to the Telldus Service
at org.tellstick.device.SwitchableDeviceImpl.off(Switchabl
DeviceImpl.java:21)[215:org.openhab.binding.tellstick:2.1.0.201702
21957]
at org.openhab.binding.tellstick.handler.core.TelldusCoreD
viceController.turnOff(TelldusCoreDeviceController.java:213)[215:o
g.openhab.binding.tellstick:2.1.0.201702121957]
at org.openhab.binding.tellstick.handler.core.TelldusCoreD
viceController.sendEvent(TelldusCoreDeviceController.java:171)[215
org.openhab.binding.tellstick:2.1.0.201702121957]
at org.openhab.binding.tellstick.handler.core.TelldusCoreD
viceController.access$0(TelldusCoreDeviceController.java:147)[215:
rg.openhab.binding.tellstick:2.1.0.201702121957]
at org.openhab.binding.tellstick.handler.core.TelldusCoreD
viceController$TelldusCoreWorker.run(TelldusCoreDeviceController.j
va:268)[215:org.openhab.binding.tellstick:2.1.0.201702121957]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
22:17:19.293 [ERROR] [andler.core.TelldusCoreBridgeHandler] - Fail
d to send msg:OFF to TellstickDevice [deviceId=47, name=koksfonste
, status=2, deviceType=DEVICE, data=null]
org.tellstick.device.TellstickException: koksfonster: Could not co
nect to the Telldus Service
at org.tellstick.device.SwitchableDeviceImpl.off(Switchabl
DeviceImpl.java:21)[215:org.openhab.binding.tellstick:2.1.0.201702
21957]
at org.openhab.binding.tellstick.handler.core.TelldusCoreD
viceController.turnOff(TelldusCoreDeviceController.java:213)[215:o
g.openhab.binding.tellstick:2.1.0.201702121957]
at org.openhab.binding.tellstick.handler.core.TelldusCoreD
viceController.sendEvent(TelldusCoreDeviceController.java:171)[215
org.openhab.binding.tellstick:2.1.0.201702121957]

Could you please run openhab with DEBUG level set on org.openhab.binding.tellstick ? The attach the log on a new thread here.

1 Like

Could we please open new thread for any new issue, this is now really long.

Will try it tonight. Thanks for your Quick answer!

Edit: Here is the thread: Tellstick binding creating lots of errors

Have you found a solution or are you still using your workaround? I’m facing the same issue. Switching works, but when sending a couple of commands at the same time with a rule the connection between the binding and tellduscore is lost.

I’m new to OpenHab. So this will probaly be a total beginner qeustion. But i have been searching and testing for 2 days now wihtout results so im hoping i can get an answer here. The devices that i add only get the channel switch functionality. Not a functionality to turn a device on or off. I have checken in the paperui in the control section and there is only switch witch switches its state from ON to OFF or visa versa. How do i get it to just send an ON or OFF command?

I’ve read your post a couple of times now trying to understand what you’re asking, but I really don’t…

It works like this:
You have a device that you can control from your Tellstick. This device will (assuming everything is working) appear as a Thing in openHAB. This thing has a channel named “switch”. To this channel you hook up an Item. This Item will then appear on the Control page in paperUI and from there you can switch it on or off and when you do, on or off signals will be sent to the Tellstick device. Does this answer the question?

Yes this answers my qeusion. I already thought it would work like this. But the beginner documentation on OpenHab2 is really slim and most of it is written bij experts.

Were can i find an example of a .item file where there is an on and off button added.

Thanks in advance.

Yep, I know. It’s not easy being an openHAB newbie :wink:

You normally don’t need to fiddle around with .item files, the easiest way of creating the Item is through paperUI. Where exactly do you want to show a button? If you want it on basicUI you’d want to edit a .sitemap file, see documentation here.

So I have currently setup a sensor at my door as a switch in tellstick.conf. I have then added this to openHAB. When I open the door tdtool -l gives “last command: ON”, closing again gives “last command: OFF”, but it does not update in openHAB. Is this functionality not implemented or is my setup broke?

Edit: Tellstick Duo by the way.

I think that’s supposed to work. At least it does for me. Never did any special fiddling and my OH status always reflects the one shown by tdtool. Always on Tellstick Duo. Does the OH log say anything when you open the door? Also try with the tellstick binding in debug log mode…

Btw, what OS? Linux here, but I guess the functionality should be the same on Windows as well…

It worked after a restart of openHAB somehow. Also Linux.

More problems with this binding, created new thread:

Thanks for your good work!

Hi!
I have been using the tellstick binding both on OH1.8 and now openHAB 2.2.0 Build #1109. The device is Tellstick DUO. I have both sensors and switches connected and they seem to work fine. Great job everybody that have contributed!

Now, I also have a Tellstick NET located far away, controling both switches and sensors. I have been able to connect that to OH using the tokens you request from Telldus.

My question is, can you connect both the DUO and the NET at the same time? I have tried it and it seems to work but it also seems like the things and items sometimes might get mixed up between the two and the connection is lost. It might also be due to pilot error… As it is a bit of a hassle to get things back together I thought I might just ask if it is planned to work this way before I make any more experiments?

I personally have a Duo and a .Net running against the same Openhab2, seems
to work fine. However I am not using the .Net much. I might be a good idea
to define these as bridges in a thing file.
Jarle

Thanks Jarle!
I’ll give it another try!
Gunnar

Hi all.
I just updated from snapshot 1103 to 1114 and something seems to be wrong with the Tellstick binding. The devices are UNINITIALIZED and the Tellstick Duo device is INITIALIZING.

First question: There is a setting on the gateway for location of the so file, is it supposed to point to the directory (/usr/lib) or the library file itself (/usr/lib/libtelldus-core.so.2)? Neither seems to work… I’ve never seen this setting before…

Secondly, anyone else got problems with this version and know what’s wrong? I get the following in the log when restarting the binding:

20:00:42.587 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'tellstick:telldus-core:1' changed from INITIALIZING to UNINITIALIZED
20:00:42.591 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.dispose()' on 'org.openhab.binding.tellstick.internal.core.TelldusCoreBridgeHandler@6032bb': null
java.lang.NullPointerException: null
        at org.openhab.binding.tellstick.internal.core.TelldusCoreBridgeHandler.dispose(TelldusCoreBridgeHandler.java:81) [213:org.openhab.binding.tellstick:2.2.0.201712052342]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        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:157) [112:org.eclipse.smarthome.core:0.9.0.201712011551]
        at org.eclipse.smarthome.core.internal.common.TrackingCallable.call(TrackingCallable.java:45) [112:org.eclipse.smarthome.core:0.9.0.201712011551]
        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) [?:?]
20:00:42.716 [ERROR] [home.core.thing.internal.ThingManager] - Exception occurred while disposing handler of thing 'tellstick:telldus-core:1': null
java.lang.NullPointerException: null
        at org.openhab.binding.tellstick.internal.core.TelldusCoreBridgeHandler.dispose(TelldusCoreBridgeHandler.java:81) [213:org.openhab.binding.tellstick:2.2.0.201712052342]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        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:157) [112:org.eclipse.smarthome.core:0.9.0.201712011551]
        at org.eclipse.smarthome.core.internal.common.TrackingCallable.call(TrackingCallable.java:45) [112:org.eclipse.smarthome.core:0.9.0.201712011551]
        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) [?:?]
20:00:42.844 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'tellstick:telldus-core:1' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
20:00:43.358 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'tellstick:telldus-core:1' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
20:00:48.361 [WARN ] [rnal.common.AbstractInvocationHandler] - Timeout of 5000ms exceeded while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.tellstick.internal.core.TelldusCoreBridgeHandler@5af8af'. Thread 'safeCall-27' (701) is in state 'RUNNABLE'
        at java.lang.Class.isArray(Native Method)
        at com.sun.jna.Function.isPrimitiveArray(Function.java:625)
        at com.sun.jna.Function.convertArgument(Function.java:498)
        at com.sun.jna.Function.invoke(Function.java:297)
        at com.sun.jna.Library$Handler.invoke(Library.java:212)
        at com.sun.proxy.$Proxy148.tdSensor(Unknown Source)
        at org.tellstick.device.TellstickSensor.getAllSensors(TellstickSensor.java:48)
        at org.openhab.binding.tellstick.internal.core.TelldusCoreBridgeHandler.rescanTelldusDevices(TelldusCoreBridgeHandler.java:136)
        at org.openhab.binding.tellstick.internal.core.TelldusCoreBridgeHandler.initialize(TelldusCoreBridgeHandler.java:111)
        at sun.reflect.GeneratedMethodAccessor56.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:157)
        at org.eclipse.smarthome.core.internal.common.TrackingCallable.call(TrackingCallable.java:45)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        ...
20:00:48.650 [WARN ] [home.core.thing.internal.ThingManager] - Initializing handler for thing 'tellstick:telldus-core:1' takes more than 5000ms.

Also tried with debug log on, got nothing more useful.

Is tdtool working as expected ?, the timeout there is really unexpected. I will commit a fix to the nullpointer in dispose