KEBA Binding - Does not refresh

you made my day @pirx - thank you very much! It’s working and I added some stuff (and some minor changes, because auf misspellings). Will post the config asap for others.

1 Like

so here my config - kudos to @Pirx


  • tcp1 binding
  • JSONPath Transformation
    -REGEX Transformation

Create udp.cfg (only tcp.cfg is automatically generated)

# all parameters can be applied to both the TCP and UDP binding unless
# specified otherwise

# Port to listen for incoming connections

# Cron-like string to reconnect remote ends, e.g for unstable connection or remote ends
#reconnectcron=0 0 0 * * ?

# Interval between reconnection attempts when recovering from a communication error,
# in seconds

# Queue data whilst recovering from a connection problem (TCP only)

# Maximum buffer size whilst reading incoming data

# Share connections within the Item binding configurations

# Share connections between Item binding configurations

# Share connections between inbound and outbound connections

# Allow masks in ip:port addressing, e.g.* etc

# Pre-amble that will be put in front of data being sent

# Post-amble that will be appended to data being sent

# Perform all write/read (send/receive) operations in a blocking mode, e.g. the binding
# will wait for a reply from the remote end after data has been sent

# timeout, in milliseconds, to wait for a reply when initiating a blocking write/read
#  operation

# Update the status of Items using the response received from the remote end (if the
# remote end sends replies to commands)

# Timeout - or 'refresh interval', in milliseconds, of the worker thread

# Timeout, in milliseconds, to wait when "Selecting" IO channels ready for communication

# Used character set

Rules (not yet finished - but my needs for report 2 and 3 mostly implemented)

    rule "Request Keba report"
       Time cron "*/30 * * * * ?"	// check every 5 seconds
    	Keba_send.sendCommand("report 2")
        Keba_send.sendCommand("report 3")

rule "Receive messages from the KEBA Wallbox"
    Item Keba_receive changed
    //  Messages, which starts with "TCH"  will be skipped
    if (Keba_receive.state.toString.substring(0,3) == "TCH" )

// requested reports always consists an "ID"

var String jvalue = transform("JSONPATH", "$.ID", Keba_receive.state.toString)
if ( jvalue.substring(0,1) != "{" ) {
    Keba_response.postUpdate( jvalue )
     if (jvalue == "2") {                 // Report 2
        KebaPlugState.postUpdate( transform("JSONPATH", "$.Plug", Keba_receive.state.toString) )
        KebaState.postUpdate( transform("JSONPATH", "$.State", Keba_receive.state.toString) )
        KebaSystemCurrent.postUpdate( Float.parseFloat(transform("JSONPATH", "$.['Max curr']", Keba_receive.state.toString)) / 1000 ) //reported in mA, transformed to Ampere
        KebaCurrent.postUpdate( Float.parseFloat(transform("JSONPATH", "$.['Curr HW']", Keba_receive.state.toString)) / 1000 ) //reported in mA, transformed to Ampere           
        KebaUptime.postUpdate( transform("JSONPATH", "$.Sec", Keba_receive.state.toString) ) 
     if (jvalue == "3") {                 // Report 3
        KebaI1.postUpdate( Float.parseFloat(transform("JSONPATH", "$.I1", Keba_receive.state.toString) ) / 1000 ) //reported in mA, transformed to Ampere
        KebaI2.postUpdate( Float.parseFloat(transform("JSONPATH", "$.I2", Keba_receive.state.toString) ) / 1000 )
        KebaI3.postUpdate( Float.parseFloat(transform("JSONPATH", "$.I3", Keba_receive.state.toString) ) / 1000 )
        KebaU1.postUpdate( transform("JSONPATH", "$.U1", Keba_receive.state.toString) )
        KebaU2.postUpdate( transform("JSONPATH", "$.U2", Keba_receive.state.toString) )
        KebaU3.postUpdate( transform("JSONPATH", "$.U3", Keba_receive.state.toString) )
        powKebaPower.postUpdate( Float.parseFloat(transform("JSONPATH", "$.P", Keba_receive.state.toString))/1000) //reported in mW, transformed to Watt
        eneKebaSessionEnergy.postUpdate( Float.parseFloat(transform("JSONPATH", "$.['E pres']", Keba_receive.state.toString))/10000) //reported in Wh + 1 decimal, transformed to Kilowatthours
        eneKebaTotalEnergy.postUpdate( Float.parseFloat(transform("JSONPATH", "$.['E total']", Keba_receive.state.toString))/10000) //reported in Wh +1 decimal, transformed to Kilowatthours

items added (please change to the IP of your wallbox)

String Keba_receive  "fromUDPnode [%s]" {udp="<[192.168.X.XXX:*:'REGEX((.*))']"}
String Keba_send    "toUDPnode" {udp=">[192.168.X.XXX:7090:]"}
String Keba_response	"Antwort [%s]"

Dimmer KebaCurrentRange "Max. Stromstärke [%.1f %%]" (gWallbox) 
Number KebaSystemCurrent "Max. Strom Hardware [%.1f A]" (gWallbox)  
   String KebaState "Wallbox [MAP(]" <wallbox> (gWallbox) 
   String KebaPlugState "Stecker: [MAP(]" (gWallbox)

DateTime KebaUptime "Uptime [%1$tY Y, %1$tm M, %1$td D,  %1$tT]" (gWallbox) 
Number KebaI1 "Phase 1 [%.1f A]" (gWallbox) 
Number KebaI2 "Phase 2 [%.1f A]" (gWallbox) 
Number KebaI3 "Phase 3 [%.1f A]" (gWallbox)
Number KebaU1 "Phase 1 [%.1f V]" (gWallbox) 
Number KebaU2 "Phase 2 [%.1f V]" (gWallbox) 
Number KebaU3 "Phase 3 [%.1f V]" (gWallbox) 
Number powKebaPower "Wallbox [%.1f W]" (gWallbox, gPower) 
Number eneKebaSessionEnergy "Session [%.1f kWh]" (gWallbox) 
Number eneKebaTotalEnergy "Gesamt [%.1f kWh]" (gWallbox, gEnergy)

1=Nicht bereit
5=Auth. Problem

0=nicht angesteckt
1=in der Ladestation
3=verriegelt in Ladestation
5=am Auto angesteckt
7=am Auto verriegelt

Hope it helps others. As next step I want to add a control (Dimmer item) for the current. As I am metering my total electricity consumption, I want to adapt the Current of the wallbox to not exceed a certain current for the whole house (could also be used for adapting the current to photovoltaics production.