Anel (PowerCtrol Hut) on Openhab 2.0

Ok, this is some useful information!
It typically means that the device cannot be reached. Check if you can access it from your openhab machine. Check if the ports are configured properly.

Arrrghhhh, shit. I have removed the bold marked part in the items:

Switch F1 “Entfeuchter (Solarview)” {anel=“anel1:F1”}

Working now!

Thx
Michael

Hi Michael

are you able to request the name of the HUT?

as in {anel=“anel1:NAME”}

Patrick I did work some years in IT support and yes I did help people with that little information.

I know it 's not much, yet sometimes that’s all end users have

in my case I have been telling multiple times that I get the message

2016-07-18 18:31:25.322 [ERROR] [ab.binding.anel.internal.AnelBinding] - Could not read configuration for Anel binding: anel_00.NAME : Invalid config key

I have never changed this and always used F1, F2, F3

My Items:

/* Anel */
Switch F1 “Entfeuchter (Solarview)” {anel=“anel1:F1”}
Switch F2 “Entfeuchter (openHAB)” {anel=“anel1:F2”}
Switch F3 “Anel Reserve” {anel=“anel1:F3”}

Switch R1 “Heizstab” {anel=“anel2:F1”}

anel1 and anel2 should be the same name as defined in anel.cfg

Hi Michael,

could you try with the name to see if that works?
Maybe the binding does not correctly support the name and I’m trying something bad?

I have another debugging tool for you: UDPTest.jar https://www.dropbox.com/s/vizcrip59zdi0ny/UDPTest.jar?dl=0
This is basiaclly the same code used in the Anel binding but as a standalone java console application.
You can run this from the same machine as openhab, but make sure that openhab with anel binding is not running otherwise the listening port is already blocked.

I already had a discussion with another user where this tool was quite helpful (in German): http://www.anel-elektronik.de/forum_neu/viewtopic.php?t=736&start=20

Please try this: sudo java -jar UDPTest.jar “wer da?” 7775 7777 30 -d
Output should be similar to the one in the linked forum.

To kill openhab I did a sudo ps -aef (to find the pid, to kill)
maybe not the best way, yet I found an interesting thing I found 2 instances of openhab running (I think)
is this normal?

openhab 672 1 0 jul15 ? 00:00:00 /bin/sh /usr/share/openhab2/runtime/karaf/bin/karaf server
ntp 713 1 0 jul15 ? 00:00:24 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 106:111
root 722 1 0 jul15 tty1 00:00:00 /sbin/agetty --noclear tty1 linux
openhab 822 672 0 jul15 ? 00:35:29 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab

I don’t speak any german, last time I tried they told me they don’t understand Dutch so a German conversation does not help me

I tried a little bit.

sudo java -jar UDPTest.jar “wer da?” 192.168.1.130 1075 1077 30 -d
listening on port 1077
sending to /192.168.1.130:1075 → wer da?
received (257): NET-PwrCtrl:130HUT00 :192.168.1.130:255.255.255.0:192.168.1.99:0.4.163.16.6.28:Stopcontact 1,0:Lichten,0:F1,0:Nr.4,0:Nr.5,0:Nr.6,0:Nr.7,0:Nr.8,0:0:80:IO-1,1,1:IO-2,1,0:IO-3,1,1:IO-4,1,1:IO-5,0,0:IO-6,0,0:IO-7,0,0:IO-8,1,1:25.8�C:NET-PWRCTRL_06.0:h:n

  1. → ‘NET-PwrCtrl’
  2. → '130HUT00 ’
  3. → ‘192.168.1.130’
  4. → ‘255.255.255.0’
  5. → ‘192.168.1.99’
  6. → ‘0.4.163.16.6.28’
  7. → ‘Stopcontact 1,0’
  8. → ‘Lichten,0’
  9. → ‘F1,0’
  10. → ‘Nr.4,0’
  11. → ‘Nr.5,0’
  12. → ‘Nr.6,0’
  13. → ‘Nr.7,0’
  14. → ‘Nr.8,0’
  15. → ‘0’
  16. → ‘80’
  17. → ‘IO-1,1,1’
  18. → ‘IO-2,1,0’
  19. → ‘IO-3,1,1’
  20. → ‘IO-4,1,1’
  21. → ‘IO-5,0,0’
  22. → ‘IO-6,0,0’
  23. → ‘IO-7,0,0’
  24. → ‘IO-8,1,1’
  25. → ‘25.8�C’
  26. → ‘NET-PWRCTRL_06.0’
  27. → ‘h’
  28. → 'n

all the info is coming from the HUT and it’s correct…
the good news is we can connect to it.

what does this tell is?

Two running instances of the Anel binding will definitely not work because it starts an exclusive listener on the receiving port (this is why openhab must be shut down for UDPTest). There are different ways to start openhab, personally I use a screen session (to be able to interact with openhab via the osgi console).

Your output looks alright, so I guess it’s your openhab / Anel binding configuration that is not working properly.
Did you try running openhab with root priviledges?
Did you try openhab 1.8?

when I shut down one instance, the other was gone too, so I guess that it
was one instance after all…

the configuration I’m using looks similar to the one that Michael has.
(I think)

I did not try with root privileges, will do that tonight

I have not tried 1.8 on this raspberry. I wanted to keep the device clean.

another Idea I had, I havenever stopped openhab even when I did changes to
the config file. maybe openhab is not picking up the changes correctly
(when I mad changes to the config I saw an error in the logs so I assumed
he picked them up

  • I did reboot the raspberry , I assumed that then Openhab is stopped and
    started, or is it possible openhab picks up where he left from saved
    memory, without rebooting ?
    (I doubt it, yet that could be a reason for seeing old config data)

y

I don’t know how OH2 does it, but for OH1, you must explicitly enable that config files may be reloaded during runtime! In OH1, the ‘openhab.log’ also lists reloaded config/item/rule/etc. files. I assume OH2 does the same somewhere…

I reinstalled my raspberry pi, using the document I created when I installed it in the first place
I downloaded the same configuration scripts , and now it works.

No idea what is different.

the good thing , it works.

1 Like

Great! :slight_smile:

1 Like

and HUT NR 2 works also.

I’m selecting ports related to IP addresses

anel hut 0
IP 192.168.1.130
portsend 1330
port receive 1430

anel hut 01
IP 192.168.1.131
portsend 1331
port receive 1431

That way I think it will make it easier to debug when I have lots of them.

Is that a good idea?

Definitely. This also makes the setup independent of most dns and dhcp problems.

1 Like

My question was (badly) two questions into one

first your replied to, aka the idea of a port per device is a good idea

The second part (not clearly stated) was are ports in the 13xx and 14xx range ok?

Ah ok. Yes, good idea. Just make sure your ports are not used by any other service you might be running: https://en.m.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

1 Like

thanks that is indeed a list i needed.

what I noticed is that in the java file that you send me you are retrieving other information then the official bindings that the anel binding is giving me, like IP adres, like version number etc

is that list document somewhere (other then the code)