Keba binding resets maxpresetcurrent no matter

Hi all Openhab EV enthusiasts,

I finally got my keba binding up and running after upgrading to OH3 and pulling the jar file from the bug report over on Github. Now, I’m facing another weird behavior: I have set up the thing and items exactly as in the example in the docs (except for the IP address of course :smile: ).

Now every time I change either the item on keba:kecontact:1:maxpresetcurrentrange or on keba:kecontact:1:maxpresetcurrent, they immediately reset to the maximum value. I know I cannot set a maximum current below 6000 mA.

I can, however, enable and disable the wallbox via keba:kecontact:1:input, so I presume it’s a logic thing on my side. Do you have any hints or clues, maybe a rule snipped where you got it working?

Here’s what’s happening in the trace:

16:48:31.553 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'KebaCurrent' received command 7000
16:48:31.553 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'KebaCurrent' predicted to become 16000.0 A
16:51:37.621 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'KebaCurrentRange' received command 10
16:51:37.623 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'KebaCurrentRange' predicted to become 1.0 %

All right. This was odd. Since I was really struggling with this, I want to write down what I found out and what happened.

  1. the 3.0.1 version of the binding produced the usual - Ping timed out after '3003' milliseconds. I’m on a Ubuntu 18.04 box.
  2. grabbed the org.openhab.binding.keba-3.1.0-SNAPSHOT 2.jar from the discussion on GitHub, plugged it into /usr/share/openhab/addons/.
  3. that was the state when I posted the above problem.
  4. disabled IPv6 completely on that Ubuntu machine. That weirdly improved some things - before, I did not see any report 1, 2 or 3 coming in. Now I did. Clearly, there’s something broken on the network side of this plugin, all the rest works fine with IPv6 enabled.
  5. However, using tcpdump, I found out that nothing was sent when any of the writable current items was changed. No single bit of traffic generated.
  6. got ready to do some println debugging, pulled the addons and compiled them as a preparation for that. Just for the fun of it, I placed the freshly compiled jar file into the addon directory. And now it just miraculously worked:
2021-03-13 23:11:30.389 [DEBUG] [nternal.handler.KeContactTransceiver] - Sending 'curr 7000' on the channel '/192.168.254.51:53287'->'/192.168.254.55:7090'
2021-03-13 23:11:31.193 [DEBUG] [nternal.handler.KeContactTransceiver] - Received TCH-OK 
  1. So kids, take-home message here: don’t just pull binaries from the internet and put them to use. :wink:

Hi Joe,
i think i have the same issue.
I’m using openhabian 3.1.0.M4 and installed the keba binding via addons.cfg.
All values like power, locked and so on can be read via openhab.
Non-read-only attribute like enabled and display can be set by commandos like…

KebaDisplay.sendCommand("Schnellladen")
KebaSwitch(OFF)

and the command applies immediately.

When i try to set the value KebaCurrent, it will not work.

KebaCurrent.sendCommand(6000)
KebaCurrent.sendCommand(6)

I tried also the second command because i’m not sure if it is in A oder mA.

I installed Hercules SETUP utility | HW-group.com and try to submit the limitation manually.

curr 6000

It works perfektly. The charing stating reduce die Curr User value.

What i have to do with openhab? Can you please assist me? I’m not so mutch familar with linux and just a beginner in openhabian.

King regards

Sascha

Maybe the Keba binding isn’t sure either. Are you supposed to tell it? i.e. send a command with units. What type of Item is this?

Hi,

this is the items file:

Number:ElectricCurrent KebaCurrent               <text>          (OU_Garage)     {channel="keba:kecontact:1:maxpresetcurrent"}

How can i set a value with units (A)?

King regards

Sascha

KebaCurrent.sendCommand("6 A") is simplest.
That doesn’t mean the binding will do anything with it, but at least you will be sending a valid openHAB command for that Item type, which should get you further along.
KebaCurrent.sendCommand(6 | A) should be an alternative in DSL rules.
Any UI widget should be doing this for you already.

1 Like

OHHHHHHHH HOLY…it seems to work…
Rossko genius! I’ve tried it out and verified it via the herkules udp tool. It seems to work fine. Now i have to verify it with my car (but this is charged :wink: ).

Sending you a virtual beer and a lot of thx.

Let me ask you another question:
Is it possible to remove the :ElectricCurrent extension in the variable to set the variable as number? Because i have to calculate the value from my smartmeter. What is the advantage of using number:ElectricCurrent istead of number?

Thank you very very mutch! I let the community now if it’s working with my car, too.

1 Like

Because it comes with units. No more “i’m not sure if it is in A oder mA”, it tells you.
Have you tried sending a command
KebaCurrent.sendCommand(6000 | mA) or
KebaCurrent.sendCommand(0.006 | kA) ?
I’d expect those to work.

You can calculate with Quantity types. Don’t throw away information because it seems ‘easier’.

1 Like

Hi Rossko,

first of all, the Keba Wallbox accepted the command and i’m able to control the ampere value.
Again: Thank you very very mutch for your help!

If tried out the following commands:

KebaCurrent.sendCommand(6 | A)
KebaCurrent.sendCommand("6 A")

Both of them works fine.

But i’ve tried to send a variable instead of the number without luck.

KE_KebaCurrent.sendCommand((OH_PVUeberschuss.state as DecimalType / 610) | A))

Se also the error with appears in my code editor.


(my variable name has a prefix “KE_”)

I havn’t found the right syntax within the thread you have posted. Do you have any further advice to me?

King regards

Sascha

That’s just bad syntax.

You can make a string, that is acceptable to command

KE_KebaCurrent.sendCommand( (OH_PVUeberschuss.state as DecimalType / 610).toString + "A"))

this is just a rework of example
tempItemC.postUpdate("25°C")

Or you can calculate and post in QuantityTypes to begin with.
Sometimes you might need to convert a plain numeric variable to a Quantity using a unit designated by you, it’s a bit fiddly

var Number someNumeric = 22.7

var myQuantity = new QuantityType<ElectricalCurrent>(someNumeric, AMPERE)
currentItem.sendCommand(myQuantity)

result

2021-05-13 11:29:01.512 [ome.event.ItemCommandEvent] - Item 'currentItem' received command 22.7 A

Finally - for all who are interested and with a lot of thx to rossko - im decided to using this code:

Keba Wallbox c-series (don’t forget the DIP-Switch 1.3 :wink: )

Declaration(items)

Number KE_KebaSetEnergyLimit        "Set charge energy limit [%.1f Wh]"             <heating>       (AL_All)            {channel="keba:kecontact:1:setenergylimit"}
Number:ElectricCurrent KE_KebaCurrent                                               <text>          (AL_All)            {channel="keba:kecontact:1:maxpresetcurrent"}
String KE_Display                   "WB Info"                                       <text>          (AL_All)            {channel="keba:kecontact:1:display"}

To set the ampere statically (rule)

KE_KebaCurrent.sendCommand(6 | A) 

To set the ampere dynamically (rule)

KE_KebaCurrent.sendCommand(((OH_PVUeberschuss.state as DecimalType / 610).floatValue()).toString + " A")

To set a charging limit (rule) (for example 10KW, you have to preselect or during charging before you reached this amount)

KE_KebaSetEnergyLimit.sendCommand(10000)

To display a text on the Wallbox (replace spaces with $, max 23 char.)

KE_Display.sendCommand("Vorwahl:$Schnell$Laden")

This works perfektly fine.

Thx again…

Sascha

1 Like

Hi,

is this issue really solved for OH 3.1.0? I installed binding via MainUI. Sending events.sendCommand('Keba1_PresetCurrent', "7 A") leads to log message

2021-12-19 19:36:46.265 [DEBUG] [nternal.handler.KeContactTransceiver] - Sending 'curr 0' on the channel '/192.168.0.207:52740'->'/192.168.0.246:7090'

which in turn leads to 6 A for maxpresetcurrent, which is minimum for that value. Setting the value directly using UDP works fine. If there is an updated version for OH 3.1.0 please let me know. Thank you.

Thanks for the hint!
And by the way, if you want to have “kWh” shown on the display you need to type something like this:

KE_Display.sendCommand(“Loading$” + LOADKWH + “$kW,h”)

If one just types “kWh” the result is “—”.
The “,” does the trick … took me hours …