Openhab 3 Anel NET-PwrCtrl Binding

Tags: #<Tag:0x00007fc8efbb6e48>

Hi,

Is there any chance the “Anel NET-PwrCtrl Binding” binding will be ported to Openhab v3 ?
Or what it would take?

Rgds,
Peter

This was also something I had to deal with last december with upgrade from OH2 to OH3. The only hint I can give you is my todays workaround:

It is possible to send commands to Anel-Devices with a simple URL-Command like this:

http://192.168.188.26?Sw=0x55,AAoIBQ8PCwkN
http://net-control?Sw=0b00001111,AAoIBQ8PCwkN

I got it from here (it is in German):
https://forum.anel.eu/viewtopic.php?t=888

In openHAB this can be achieved with the HTTP-Binding and a Thing like this:

Thing http:url:anelhut "Anel PowerHut" [baseURL="http://192.168.1.65"] {
    Channels:
        Type switch : Output "Switch" [commandExtension="/?%2$s", onValue="Sw_on=1,userandpassword(base64)", offValue="Sw_off=1,userandpassword(base64)", mode="WRITEONLY"]
}

userandpassword(base64) = user and password without space encoded to Base64

E.g.
User: test
Password: 1234
Base64: dGVzdDEyMzQ=

The above Thing would then look like this:

Thing http:url:anelhut "Anel PowerHut" [baseURL="http://192.168.1.65"] {
    Channels:
        Type switch : Output "Switch" [commandExtension="/?%2$s", onValue="Sw_on=1,dGVzdDEyMzQ=", offValue="Sw_off=1,dGVzdDEyMzQ=", mode="WRITEONLY"]
}

With that you can then use the channel in openHAB like a normal switch an send ON and OFF commands.

Hope this helps :slight_smile:

1 Like

Thanks for the workaround.
Unfortunatly also the input IO’s are needed, all my input push switches are connected to them.

How much time would it take for a developper to port the v1 binding to v3?

It would depend on how familiar they were with openHAB binding development in general. From a quick 2-minute look at the V1 code, it looks relatively simple, and the communication and parsing code can probably be re-used directly. So I don’t think a V3 port would be a major project.

My plan is to started writing an OH3 binding for the Anel devices within the next weeks (I’ve also written v1 of the binding).
I’ll keep you updated as soon as I have something ready for testing.

2 Likes