Enigma2 Binding

Is there a way to prevent the binding to send many errors to the log all the time, when the enigma2-box isn´t powerd on?

My receiver is in deep sleep all the day, when everyone is at work. So there is no network connection in this time. It is only switched on in the evening.

Not yet. But i’ll have a look on it. I think it’s not that problem

edit:
I have updated the binding. Problem should be solved now.

Initializing my dm7020hd takes really long - is that a known issue, anything I can do to speed it up?

Hi Thomas, i appreciate your efforts in this binding. Works well with VU+ Solo 4k. I just noticed that after the last change my logfile keeps pushing warnings. I am using the latest 2.1.0.SNAPSHOT Any idea where the issue is? Binding keeps working despite the warnings, just that my logfile is flushed… :slight_smile:

"

2017-03-11 16:48:33.061 [WARN ] [gma2.internal.Enigma2CommandExecutor] - Error during send Command: {}
java.io.IOException: java.util.concurrent.ExecutionException: java.net.NoRouteToHostException: Keine Route zum Zielrechner
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:236)[113:org.eclipse.smarthome.io.net:0.9.0.b4]
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:130)[113:org.eclipse.smarthome.io.net:0.9.0.b4]
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:86)[113:org.eclipse.smarthome.io.net:0.9.0.b4]
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:65)[113:org.eclipse.smarthome.io.net:0.9.0.b4]
	at org.openhab.binding.enigma2.internal.Enigma2Util.executeUrl(Enigma2Util.java:58)[215:org.openhab.binding.enigma2:2.1.0.SNAPSHOT]
	at org.openhab.binding.enigma2.internal.Enigma2CommandExecutor.getPowerState(Enigma2CommandExecutor.java:283)[215:org.openhab.binding.enigma2:2.1.0.SNAPSHOT]
	at org.openhab.binding.enigma2.handler.Enigma2Handler.updateCurrentStates(Enigma2Handler.java:161)[215:org.openhab.binding.enigma2:2.1.0.SNAPSHOT]
	at org.openhab.binding.enigma2.handler.Enigma2Handler.getUpdate(Enigma2Handler.java:212)[215:org.openhab.binding.enigma2:2.1.0.SNAPSHOT]
	at org.openhab.binding.enigma2.handler.Enigma2Handler$Refresher.callAllListener(Enigma2Handler.java:237)[215:org.openhab.binding.enigma2:2.1.0.SNAPSHOT]
	at org.openhab.binding.enigma2.handler.Enigma2Handler$Refresher.run(Enigma2Handler.java:244)[215:org.openhab.binding.enigma2:2.1.0.SNAPSHOT]
Caused by: java.util.concurrent.ExecutionException: java.net.NoRouteToHostException: Keine Route zum Zielrechner
	at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118)[69:org.eclipse.jetty.client:9.2.19.v20160908]
	at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:110)[69:org.eclipse.jetty.client:9.2.19.v20160908]
	at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:655)[69:org.eclipse.jetty.client:9.2.19.v20160908]
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:219)[113:org.eclipse.smarthome.io.net:0.9.0.b4]
	... 9 more
Caused by: java.net.NoRouteToHostException: Keine Route zum Zielrechner
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)[:1.8.0_65]
	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)[:1.8.0_65]
	at org.eclipse.jetty.io.SelectorManager.finishConnect(SelectorManager.java:341)[72:org.eclipse.jetty.io:9.2.19.v20160908]
	at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:676)[72:org.eclipse.jetty.io:9.2.19.v20160908]
	at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:645)[72:org.eclipse.jetty.io:9.2.19.v20160908]
	at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:612)[72:org.eclipse.jetty.io:9.2.19.v20160908]
	at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:550)[72:org.eclipse.jetty.io:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)[83:org.eclipse.jetty.util:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[83:org.eclipse.jetty.util:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[83:org.eclipse.jetty.util:9.2.19.v20160908]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]

@chris400 no this is not a known issue. What does long mean for you?
@muelli1967 no i’m sorry. I don’t know why this happens. But i found some little bugs in the last days, that i have fixed now. Maybe this will help you too.

Initializing takes minutes, not seconds. OpenHAB2 is running on a pi3. Haven’t used your binding in the last weeks. Any hints on getting logs esp. on initializing?

Ok minutes are really long. I had improved the binging the last few days. After a restart of openHab it will take at least one minute to get all channels initialized. This is necessary cause of an improvement of the update action.
But this should not be a problem.
I dont have an idea why it takes so long for you. There are only some simple http requests, they should not take long. Maybe you give the updated version a chance.

I tried to use the binding with the OH2 stable distribution. As soon as I copied org.openhab.binding.enigma2_2.1.0.SNAPSHOT.jar in my addons directory and restarted OH2 I got a bunch of errors and warnings started with this

11:50:47.853 [INFO ] [smarthome.event.ThingAddedEvent     ] - Thing 'enigma2:device:41c89b2a' has been added.
11:50:47.902 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'enigma2:device:41c89b2a' changed from UNINITIALIZED to INITIALIZING

11:50:47.945 [ERROR] [gma2.internal.Enigma2CommandExecutor] - Error during initialization: {}
java.io.IOException: java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:236)[113:org.eclipse.smarthome.io.net:0.9.0.b4]
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:130)[113:org.eclipse.smarthome.io.net:0.9.0.b4]
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:86)[113:org.eclipse.smarthome.io.net:0.9.0.b4]
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:65)[113:org.eclipse.smarthome.io.net:0.9.0.b4]
	at org.openhab.binding.enigma2.internal.Enigma2Util.executeUrl(Enigma2Util.java:58)[230:org.openhab.binding.enigma2:2.1.0.SNAPSHOT]
	at org.openhab.binding.enigma2.internal.Enigma2Util.generateServiceMaps(Enigma2Util.java:75)[230:org.openhab.binding.enigma2:2.1.0.SNAPSHOT]
	at org.openhab.binding.enigma2.internal.Enigma2CommandExecutor.initialize(Enigma2CommandExecutor.java:395)[230:org.openhab.binding.enigma2:2.1.0.SNAPSHOT]
	at org.openhab.binding.enigma2.internal.Enigma2CommandExecutor.<init>(Enigma2CommandExecutor.java:57)[230:org.openhab.binding.enigma2:2.1.0.SNAPSHOT]
	at org.openhab.binding.enigma2.handler.Enigma2Handler.initialize(Enigma2Handler.java:52)[230:org.openhab.binding.enigma2:2.1.0.SNAPSHOT]
	at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:713)[105:org.eclipse.smarthome.core.thing:0.9.0.b4]
	at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:1)[105:org.eclipse.smarthome.core.thing:0.9.0.b4]
	at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:179)[98:org.eclipse.smarthome.core:0.9.0.b4]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_131]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
	at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
Caused by: java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused
	at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118)[69:org.eclipse.jetty.client:9.2.19.v20160908]
	at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:110)[69:org.eclipse.jetty.client:9.2.19.v20160908]
	at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:655)[69:org.eclipse.jetty.client:9.2.19.v20160908]
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:219)[113:org.eclipse.smarthome.io.net:0.9.0.b4]
	... 15 more
Caused by: java.net.ConnectException: Connection refused
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)[:1.8.0_131]
	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)[:1.8.0_131]
	at org.eclipse.jetty.io.SelectorManager.finishConnect(SelectorManager.java:341)[72:org.eclipse.jetty.io:9.2.19.v20160908]
	at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:676)[72:org.eclipse.jetty.io:9.2.19.v20160908]
	at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:645)[72:org.eclipse.jetty.io:9.2.19.v20160908]
	at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:612)[72:org.eclipse.jetty.io:9.2.19.v20160908]
	at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:550)[72:org.eclipse.jetty.io:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)[83:org.eclipse.jetty.util:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[83:org.eclipse.jetty.util:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[83:org.eclipse.jetty.util:9.2.19.v20160908]
	... 1 more

Can anyone help?

did you set username and password in enigma itself? You’ll need to add it in the binding then.

I did set UID / PW in enigma and in the thing definition in the PaperUI. Is there another way to set it in something like a .cfg file for the binding?

The strange thing is that below the error in the log i get those two lines and everything on ‘enigma2:device:cf19a964’ seems to work.

19:27:50.831 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'enigma2:device:cf19a964' changed from UNINITIALIZED to INITIALIZING
19:27:50.847 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'enigma2:device:41c89b2a' changed from INITIALIZING to ONLINE

Why are there different device ids?

Its interessting. The device id should be something like 1921680188 for IP of device 192.168.0.188 and not a hex hash code

Strange …

Here my next task :wink:

I want to build a remote control via Habpanel for my enigma2 based VU+ SOLO 4K

I want to use the enigma2 binding for simulating pressing a key. Icould use the HTTP binding as well, but I do like the binding and I do not want to send UID/PW via HTTP. There is a code for each Key I can send to the enigma web interface via http or via the binding. For example 401 is for the “blue” button.

I do not want any logic in the UI. No sending of codes though Habpanel only pressing buttons. So I could use the same functionality from a sitemap or via amazon echo as well. With the HTTP binding this works like

Switch 	vusolo4kRemoteBlue {http=">[ON:GET:http://IP-Address:Port/web/remotecontrol?command=401]", autoupdate="false"}

And then connect a button Panel to the switch.

Is there a similar way to do it with the binding without writing extra rules? I have a String item in the binding which I can send the codes to trigger the action

String  	vuSolo4k_RemoteKey { channel="enigma2:device:cf19a964:remoteKey" }

To simulate pressing the blue button on the Remote this would work like

vuSolo4k_RemoteKey.sendCommand(401)

But in this case i would have to send the code fron the Widget what i do not want.

Another way would be to define a virtual Switch and a rule

Switch 	vusolo4kRemoteBlue {autoupdate="false"}
rule “VuSolo4k press blue button”
when
	Item vusolo4kRemoteBlue received command ON
then
	vuSolo4k_RemoteKey.sendCommand(401) 
end

What is quite annoying, because i need more than 20 buttons.

I could do it with lambdas or group filters like

gRemoteButtons.members.filter[i | i.state == ON].forEach[i | i.name.sendCommand( transform("MAP", “remote_code.map"))]

to make it more comfortable. But I try to get around this stuff.

So my Question again:
Is there a way to use the binding without a rule for my purpose. In other words: Is there a way to define a Switch that sends a predefined code the binding without using an additional rule?

Help would be really appreciated.

@chris400, @tiknx I got rid of the error message in the log. I struggled over the two different IDs. One was a first try still remaining in the OH" things database. Thanks for your help!

@tiknx the binding did not auto detect the VU+ so I had to fill in the data manually. The field with the ID was prefilled and I just let it like this.

public enum Enigma2RemoteKey {
// Source found on
// The dreambox WiKi has been retired
// but tests showed, that
// MENU is 139 instead of 141
// TV is 377 instead of 385
// RADIO is 385 instead of 377

POWER(116),
KEY0(11),
KEY1(2),
KEY2(3),
KEY3(4),
KEY4(5),
KEY5(6),
KEY6(7),
KEY7(8),
KEY8(9),
KEY9(10),
ARROW_LEFT(412),
ARROW_RIGHT(407),
VOLUME_DOWN(114),
VOLUME_UP(115),
EXIT(1),
MUTE(113),
CHANNEL_UP(402),
CHANNEL_DOWN(403),
INF0(358),
MENU(139),
LEFT(105),
RIGHT(106),
UP(103),
DOWN(108),
OK(352),
AUDIO(392),
VIDEO(393),
RED(398),
GREEN(399),
YELLOW(400),
BLUE(401),
PLAY(207),
PAUSE(119),
FAST_FORWARD(208),
FAST_BACKWARD(168),
TV(377),
RADIO(385),
TEXT(66),
HELP(138);

Im not really sure i understand what you want, but you can send on the “channel” channel those Keys. If you want, i can add a additional number channel, with the integer values as well.

Thanks for your help. My english is not that good, but I try to explain it in different words:

What I want is one Switch Item for each button on the remote control so that I could just send a ON-Command to the Switch Item to trigger the function.

In my example for the HTTP Binding

Switch 	vusolo4kRemoteBlue {http=">[ON:GET:http://IP-Address:Port/web/remotecontrol?command=401]", autoupdate="false"}
Switch 	vusolo4kRemoteGreen {http=">[ON:GET:http://IP-Address:Port/web/remotecontrol?command=399]", autoupdate="false"}

I could send an ON-Command to vusolo4kRemoteBlue. That gives me the possibility to connect a dump key Widget to the Item. In the background 401 is send to the enigma2 Web Interface what means Blue key pressed.
For hitting the Green key on the remote i could use another Item vusolo4kRemoteGreen and again send ON to the Item.

When I use the enigma2 binding

String  	vuSolo4k_RemoteKey { channel="enigma2:device:cf19a964:remoteKey" }

I have to send a BLUE (if I use your enumeration) or a 401 to the String Item (vuSolo4k_RemoteKey) to press the Blue key on the remote. For the Green key i have to use the same Item (vuSolo4k_RemoteKey) with another value GREEN or 399.

That’s not what I want.

The only way i see, is to create a own channel for each button

Hey Thomas,

yes, I think that’s what I need. Is there a way to do it without modifying the binding?

Thanks again!

No i don’t think so.

I’m currently running a PR for this binding. If this has passed to be official, we can talk about this again

That would be great, many thanks!

Hi there,

i’ve installed the binding in /usr/share/openhab2/addons

But the binding isn’t discovering my dm8000 with newnigma2 (maybe because of user/pass)?

Where do I configure the binding manualle to accept user/pass?

Greetings and thanks for your work!