Anel (PowerCtrol Hut) on Openhab 2.0

I’m trying to set up a Anel Powercontrol HUT on an openhab 2.0 system.

I have trouble to even recognize the device.

While I first thought it had to do with configuration of the HUT, I’m less sure. Even asking the name of the device does not work.
In my site map I have :
Text item=anelName
Text item=anel_Test
Text item=anelTemperature

In items I have

String anelName “Anel1 [%s]” {anel=“anel_00:NAME” }
//String anelName “Anel1 network name [%s]” { anel=“anel1:NAME” }
Number anelTemperature “Anel_00 temperature [%s]” { anel=“anel_00:TEMPERATURE” }
String anel_Test “test:[%s]” {anel=“anel_00.F1NAME” }

where anel.cfg has this

anel_00.host=192.168.1.130
anel_00.user=O
anel_00.password=O

yes correct IP and correct U & PW

What am I missing?

you could try to configure ports above 1024.

My “anel.cfg” in /conf/services looks like this (2 devices):

IP or network address (optional but recommended, defaults to ‘net-control’)
anel1.host=192.168.1.57
anel2.host=192.168.1.65

UDP receive port (optional, defaults to 77)
anel1.udpReceivePort=77
anel2.udpReceivePort=78

UDP send port (optional, defaults to 75)
anel1.udpSendPort=75
anel2.udpSendPort=76

User name (optional, defaults to ‘user7’)
anel1.user=xxxx
anel2.user=xxxx

Password (optional, defaults to ‘anel’)
anel1.password=xxx
anel2.password=xxx

Did you configure your Anel Powercontrol HUT with different ports than the default?

No, I did not change the default ports.

Patrick Why would I change the ports above 1024 ?
I assumed that the default parts should work.
Is that a wrong assumption?

Ports below 1024 are reserved ports and may not work on all systems. This is also noted on the binding page: https://github.com/openhab/openhab/wiki/Anel-Binding

What does the logfile say?

Thanks for the question. I had not found the log files in Openhab.

I tried a few more things:

  1. I move to post above 1024, there I noticed something strange in the anel default binding file

UDP receive port (optional, defaults to 77)

UDP send port (optional, defaults to 75)

Where actually in HUT the default for receiving is 75 and sending is 77
so I fixed that to set them both the same

  1. then I removed the _ from all my variables, as I read on another openhab2 post that the_ was bad for something (non related) yet I ask, why not…

  2. with the logging I found that I used String anelTest “test:xx[%s]xx” {anel=“anel00.F1NAME” }
    instead of String anelTest “test:xx[%s]xx” {anel=“anel00:F1NAME” }

then I removed everything else from my files to not have other logging

and then I saw nothing moving anymore in the log file.
When I made a small change to the anel.cfg file now I saw the following error on the logging

2016-07-13 01:21:39.776 [ERROR] [ab.binding.anel.internal.AnelBinding] - Could not read configuration for Anel binding: anel_00.NAME : Invalid config key

and this I don’t get, I though I did remove “_” everywhere.

so in non of the config files I have "anel_00.NAME"
I checked everywhere. I did reboot the raspberry (even by turning of electricity)
and still I get this error when booting the raspberry PI.

even more troublesome, is that I seem to get remarks to
2016-07-13 01:57:38.078 [INFO ] [home.event.ItemChannelLinkAddedEvent] - Link ‘yahooweather_weather_berlin_humidity-yahooweather:weather:berlin:humidity’ has been added.

where I have de-installed the weather bindings and did remove all links to the service.

is it possible that openhab2 still safes some of the configuration somewhere else?

Ok, I must admit that the port numbers are not documented properly. The ‘send’ and ‘receive’ ports depend on the configuring device. In the Anel device, 75 is the receiving and 77 the sending port. So on the openhab system, 77 is the receiving and 75 is the sending port. Does this make sense? I’ll adjust that as soon as I find some time.
And again, I recommend using higher ports such as 7777 and 7775.

Sorry but I can’t help you with the other issues. I’ve successfully tested the Anel binding with openhab 2 several month ago but personally I’m still running openhab 1.

And I’ve not yet heard about or encountered any problems with underscores or caching problems…

paphkoPatrick
Ah that makes sense, I should have thought of that.
I’ll rechange that tonight, maybe then it might work…

I have another raspberry PI laying around that I can install Openhab version one on.
I’ll do that the next days to see if that works…

when I swap send and receive back, I immediately get the following error in the log file:

could not read configuration for Anel binding: anel_00.NAME : Invalid config key

2 questions:
What config file?
where could anel_00.NAME come from:
It’s not in the anel.cfg file
it’s not in the sitemap
it’s not in the items file
nor in the rules or the things file

(it used to be in the first 3)

y

do I need other bindings like HTP or TCP to make the panel binding work?

I don’t know where your ‘anel_00.NAME’ problem is located. Did you try recursive full text search?

No, the Anel binding doesn’t need any other binding.

Yes I did use a recursive search on anything from openhab.

are you using an IP adres ofr the hostname to acces the HUT?
I’m asking as I just noticed I can ping to the IP adres, I can’t ping to the hostname.
Maybe the binding does not work with an IP adres and you are using a hostname?

'im using raspberry PI Jessie , the minimal setup, this means I had to install java myself, maybe it needs something else to get the panel binding work? (like a DNS server)

Now same here… :frowning:
With latest snapshot anel binding is not working anymore:

https://openhab.ci.cloudbees.com/job/openHAB-Distribution/

And I did not change my anel-configuration the last weeks.

BR
Michael

Hi Michael,

Same as in also “anel_00.NAME” or same as in: no longer working?

y

Actually I’m still on 1.8.3 but working in parallel on 2.0 with latest snapshots to learn how to configure. And today I updated to the latest nightly built and it’s not working anymore.

There should not be any other service needed. If DNS lookup is not working any longer, it may be caused by your DHCP server / router? In my config I use IP address, this should also be safer in case your device have static IPs.

The statement ‘not working anymore’ does not provide enough information so that others may help you.

Thanks Patrick for the clarity on the IP addresses.

For the no longer working, I think Michaels message that it did work before on Openhab 2 and since the latest nightly build, it no long works, might give you a lot of insights.

Michael, when was the last nightly build of Openhab 2 that you did use, that did work?

For me, there is no possibility to talk to the Anel device. When I give the right IP, and just ask the name of the device, I get NO answer. Nothing. No error message, but also no answer.

Yves

I’m working already with ip-addresses and it’s maybe 2 weeks ago. Don’t know exactly.

Update: OK, now I see this:

2016-07-18 17:23:19.665 [ERROR] [ng.anel.internal.AnelConnectorThread] - Error occured when received data from Anel device: 192.168.1.57
java.lang.Exception: java.net.SocketException: Socket closed
at org.openhab.binding.anel.internal.AnelUDPConnector.receiveDatagram(AnelUDPConnector.java:114)[214:org.openhab.binding.anel:1.9.0.201607180111]
at org.openhab.binding.anel.internal.AnelConnectorThread.run(AnelConnectorThread.java:234)[214:org.openhab.binding.anel:1.9.0.201607180111]
Caused by: java.net.SocketException: Socket closed
at java.net.PlainDatagramSocketImpl.receive0(Native Method)[:1.8.0_65]
at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:144)[:1.8.0_65]
at java.net.DatagramSocket.receive(DatagramSocket.java:812)[:1.8.0_65]
at org.openhab.binding.anel.internal.AnelUDPConnector.receiveDatagram(AnelUDPConnector.java:106)[214:org.openhab.binding.anel:1.9.0.201607180111]
… 1 more
2016-07-18 17:23:19.665 [ERROR] [ng.anel.internal.AnelConnectorThread] - Error occured when received data from Anel device: 192.168.1.65
java.lang.Exception: java.net.SocketException: Socket closed
at org.openhab.binding.anel.internal.AnelUDPConnector.receiveDatagram(AnelUDPConnector.java:114)[214:org.openhab.binding.anel:1.9.0.201607180111]
at org.openhab.binding.anel.internal.AnelConnectorThread.run(AnelConnectorThread.java:234)[214:org.openhab.binding.anel:1.9.0.201607180111]
Caused by: java.net.SocketException: Socket closed
at java.net.PlainDatagramSocketImpl.receive0(Native Method)[:1.8.0_65]
at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:144)[:1.8.0_65]
at java.net.DatagramSocket.receive(DatagramSocket.java:812)[:1.8.0_65]
at org.openhab.binding.anel.internal.AnelUDPConnector.receiveDatagram(AnelUDPConnector.java:106)[214:org.openhab.binding.anel:1.9.0.201607180111]
… 1 more

Here you can see the latest changes of the Anel binding: https://github.com/openhab/openhab/commits/master/bundles/binding/org.openhab.binding.anel
Nothing changed for at least two months, so I assume that some other change broke something in the core of openhab. This is always the risk using nightly builds!

How should anyone help with a ‘not working anymore’ statement? Imagine that I say ‘my car is not working since yesterday, how can I fix it?’ This is simply not enough information.
Not every developer is constantly developing for openhab and knows about all changes made in the code base. Please observe log output, maybe enable debug log for the respective binding. Maybe you can even find out yourself what the actual problem is.

Does the log file state that the Anel binding is started during startup? If connection failed, an exception should be written to the log.