Skip to content

Keba Binding ​

This binding connects openHAB to KEBA KeContact EV charging stations.

Supported Models ​

Create one kecontact Thing per wallbox and enable interfaces supported by that model.

ModelEthernetUDPModbus TCPREST
P20 with network connectionYesFirmware 2.5+NoNo
P30 e-seriesSKU-dependentNoNoNo
P30 a-seriesSKU-dependentNoNoNo
P30 b-seriesSKU-dependentSKU-dependentSKU-dependentNo
P30 c-seriesYesFirmware 3.9.24+Firmware 3.10.16+No
P30 x-series and BMW wallboxYesYesFirmware 1.11+Yes
P40 / P40 ProYesNoYesYes

Support depends on the full product code, firmware and wallbox configuration.

Thing Configuration ​

Set ipAddress to the wallbox address or hostname. For a Modbus proxy, set modbusIpAddress; UDP and REST still connect directly to the wallbox.

GroupParameterDefaultDescription
CommonipAddress-Wallbox address used by UDP and REST, and by Modbus unless overridden
CommonrefreshInterval12 sFast polling interval; minimum 10 s
CommonrefreshIntervalSlow60 sSlow and supplemental polling interval; minimum 10 s
Modbus TCPmodbusEnabledtrueEnable Modbus TCP in the binding
Modbus TCPmodbusIpAddressipAddressOptional Modbus proxy address
Modbus TCPport502Modbus TCP port
Modbus TCPunitId255Modbus unit ID
UDPudpEnabledtrueEnable UDP
UDPudpDisplayOnlyfalseUse UDP only for display commands
RESTrestEnabledfalseEnable authenticated REST
RESTrestPort8443REST HTTPS port
RESTusernameadminREST username
RESTpassword-Required when REST is enabled
RESTverifyCertificatetrueVerify the REST certificate and hostname

The binding enables Modbus and UDP by default, but Modbus must also be enabled on the wallbox. On P20 models with firmware 2.5 or later, disable Modbus and use UDP. REST is optional and requires credentials. Disable verifyCertificate only for a trusted local wallbox with a self-signed certificate.

For display commands without UDP measurements, set udpEnabled=true and udpDisplayOnly=true. This mode keeps the display channel and setDisplay action available without UDP polling. UDP must remain enabled for display commands; udpDisplayOnly disables cyclic reports, not commands and actions. It does not provide UDP measurement fallback. Shared polling intervals must still be at least 10 seconds.

Availability and Polling ​

For shared values, the preferred source is Modbus, then REST, then UDP. The binding falls back to another enabled protocol when the preferred source is unavailable. refreshInterval controls primary operational data; refreshIntervalSlow controls slow and supplemental data.

The Thing stays online while an enabled protocol supplies operational data. After UDP or REST has connected, three consecutive failed operational polls mark that protocol unavailable. The next successful poll restores it. Initial connection failures are reported immediately and retried after five minutes. Items retain their last values during brief outages, so those values can be stale. Commands are not automatically retried.

The Thing properties modbusAvailable, udpAvailable and restAvailable show protocol status. Possible values include unknown, available, unavailable, disabled and unsupported. identification-only means UDP report 1 identified the wallbox, but command access is unavailable; check that DIP switch 1.3 enables UDP. display-only means UDP is configured for display commands without cyclic reports.

Channels ​

Available channels depend on enabled protocols and the detected wallbox model. Channels unsupported by the selected protocols or detected model are removed from the Thing.

The table lists each channel once; All means Modbus TCP, UDP and REST. Protocol support remains subject to the model and configured mode; REST requires a successful authenticated connection. Shared channels retain one ID and use protocol fallback where supported.

All Channels ​

Channel IDItem TypeRead-onlySupported ProtocolsDescription
stateNumberYesAllCurrent numeric operational state of the wallbox.
reststateStringYesRESTTextual operational state from REST, for example CHARGING or READY_FOR_CHARGING; retained alongside the numeric state.
enabledsystemSwitchYesUDPWallbox activation state imposed by the system. This is not the writable user enable command.
enableduserSwitchNoAllEnable or disable charging.
reservedSwitchYesRESTWhether the wallbox has an active reservation.
fastchargingstatusNumberYesModbus TCPRaw fast-charging status. Available only on P40.
activatefastchargingSwitchNoModbus TCPSend ON to activate fast charging. Available only on P40.
wallboxSwitchYesModbus TCP, UDPWhether the cable is plugged into the wallbox.
vehicleSwitchYesAllWhether a vehicle is connected.
lockedSwitchYesModbus TCP, UDPWhether the charging plug is locked.
unlockplugSwitchNoAllSend ON to unlock the charging plug. Charging must be stopped before unlocking.
permanentlylockedSwitchNoRESTEnable or disable permanent plug locking. This is a locking policy, not the current physical lock state.
maxsystemcurrentNumber:ElectricCurrentYesAllMaximum current supported by the wallbox hardware. This is not the user setpoint or actual vehicle current.
maxpilotcurrentNumber:ElectricCurrentYesAllMaximum current currently offered to the vehicle. The vehicle may draw less; I1, I2 and I3 report actual current.
maxpresetcurrentNumber:ElectricCurrentNoModbus TCP, UDPUser-requested maximum charging current in amperes. This is a setpoint, not measured current.
maxpresetcurrentrangeNumber:DimensionlessNoUDPPercentage representation of maxpresetcurrent, mapped between 6 A and the hardware current limit. Both channels control the same setpoint.
maxpilotcurrentdutycyleNumber:DimensionlessYesUDPControl-pilot PWM duty cycle, expressed as a percentage. It encodes offered current; it is not measured phase current.
currtimerNumber:ElectricCurrentYesUDPDelayed charging-current setpoint that takes effect when currtimertimeout expires. This is not measured current.
currtimertimeoutNumber:TimeYesUDPRemaining time in seconds before the delayed charging-current setpoint becomes active.
I1Number:ElectricCurrentYesAllActual current drawn by the vehicle on phase 1, in amperes; not a current limit or setpoint.
I2Number:ElectricCurrentYesAllActual current drawn by the vehicle on phase 2, in amperes; not a current limit or setpoint.
I3Number:ElectricCurrentYesAllActual current drawn by the vehicle on phase 3, in amperes; not a current limit or setpoint.
U1Number:ElectricPotentialYesAllMeasured voltage of phase 1, in volts.
U2Number:ElectricPotentialYesAllMeasured voltage of phase 2, in volts.
U3Number:ElectricPotentialYesAllMeasured voltage of phase 3, in volts.
powerNumber:PowerYesAllTotal measured active charging power, in watts.
powerfactorNumber:DimensionlessYesAllMeasured charging power factor (cos phi), expressed as a percentage.
totalconsumptionNumber:EnergyYesAllTotal energy reported by the wallbox meter, in watt-hours, accumulated after completed charging sessions.
externalmeterSwitchYesRESTWhether an external meter is present; this is not an external-meter energy reading.
temperatureNumber:TemperatureYesRESTInternal wallbox temperature, in degrees Celsius.
phaseswitchsourceNumberNoAllCommunication source allowed to control phase switching: disabled, OCPP, REST, Modbus or UDP.
phaseswitchstateNumberNoAllPhase-switch state: 0 deactivated, 1 single-phase or 3 three-phase charging. Commands require the selected phaseswitchsource.
togglephaseswitchSwitchNoRESTSend ON to toggle single- and three-phase charging through REST. OFF is ignored; the channel resets after success.
maxphasesNumberYesRESTMaximum number of charging phases supported by the wallbox.
phaseconfigurationStringYesRESTConfigured phase order, rather than just the number of active phases.
failsafecurrentNumber:ElectricCurrentNoModbus TCP, UDPCharging-current limit applied after the communication timeout, in amperes.
failsafetimeoutNumber:TimeNoModbus TCP, UDPCommunication timeout in seconds before failsafe current applies. This is not the delayed current-setpoint timer.
failsafepersistSwitchNoModbus TCP, UDPSend ON to save active failsafe settings permanently on a P30 wallbox.
sessionSwitchYesUDP, RESTWhether a charging session is active.
sessionidNumberYesUDP, RESTIdentifier of the current or latest charging session, retained after completion.
sessionstartDateTimeYesUDP, RESTStart time of the current or latest charging session, retained after completion. Requires a valid absolute timestamp.
sessiondurationNumber:TimeYesUDP, RESTElapsed or final duration of the current or latest charging session, in seconds, retained after completion.
sessionconsumptionNumber:EnergyYesAllEnergy delivered in the current charging session, in watt-hours.
sessionrfidtagStringYesModbus TCP, UDPHexadecimal RFID tag used for the last charging session. Available only when RFID is enabled.
sessionrfidclassStringYesUDPRFID authorization class used for the last charging session.
setenergylimitNumber:EnergyNoModbus TCP, UDPEnergy limit for an active or next charging session. Send an energy quantity, for example in watt-hours.
startSwitchNoRESTSend ON to request that REST starts a charging session.
stopSwitchNoModbus TCP, RESTSend ON to stop charging: Modbus TCP sets the charging current to 0 mA, otherwise REST stops the session.
udpstopStringNoUDPSend a UDP stop command with the explicitly supplied 16-digit session RFID tag.
authreqSwitchYesUDPWhether authentication is required before a charging session can begin.
authonSwitchYesUDP, RESTWhether charging authorization is enabled.
authenticateStringNoUDPAuthenticate and start a charging session using an RFID tag and class already accepted by the wallbox.
errorcodeNumberYesModbus TCPNumeric wallbox error code; zero means no error. Its encoding differs from REST error names and UDP error words.
errorStringYesRESTWallbox error-code name from REST, for example TEMPERATURE_DERATING. It is not numerically equivalent to the Modbus error code.
error1StringYesUDPRaw UDP Error1 diagnostic value. Interpret together with Error2 using KEBA error documentation.
error2StringYesUDPRaw UDP Error2 diagnostic value. Interpret together with Error1 using KEBA error documentation.
inputSwitchYesUDPState of the physical X1 enable input.
outputNumberNoUDP, RESTX2 output: 0 opens, 1 closes, and >=10 configures pulses per kWh. REST provides readback only. Commands require DSW1.2 OFF.
displayStringNoUDPTransient wallbox display text on supported models. setDisplay also supports display-duration limits.
backendSwitchYesUDPWhether communication with the charging backend is present.
uptimeNumber:TimeYesUDPSystem uptime since the wallbox was last reset, in seconds.
timequalityNumberYesUDPWallbox clock synchronization quality, from 0 to 3.
bootflagNumberYesUDPRaw boot diagnostic value; its meaning is not documented by KEBA.
dipswitch1StringYesUDPRaw hexadecimal value of DIP-switch block 1, including the UDP enable bit.
dipswitch2StringYesUDPRaw hexadecimal value of DIP-switch block 2.
dipswitchsettingsStringYesRESTRaw DIP-switch settings as a JSON array. Null entries are preserved.
dipswitchinterpretationStringYesRESTNamed DIP-switch settings as a JSON object.
rebootSwitchNoRESTSend ON to request a wallbox reboot.

REST State and Error Values ​

The REST reststate channel reports one of these values:

ValueMeaning
CHARGINGThe socket is charging.
IDLEThe socket is idling.
READY_FOR_CHARGINGThe socket is ready for charging.
RECOVER_FROM_ERRORThe socket is recovering from an error.
SERVICE_MODEThe socket is in service mode.
SUSPENDEDThe socket is suspended.
TOKEN_PROGRAMMING_MODEThe socket is in RFID programming mode.
UNRECOVERABLE_ERRORThe socket is in an unrecoverable error state.
UNAVAILABLEThe socket is out of order following a change-availability command.
OFFLINEThe wallbox is not currently connected to the CPM.
DEGRADEDThe wallbox has an error; check the error channel.

The REST error channel returns an error-code name. The OpenAPI specification lists these values but does not define their detailed causes:

TEMPERATURE_DERATING, POWER_CONTROL, ISO_COMMUNICATION_NOT_WORKING, PLUG_LOST, PLUG_UNDEFINED, OVERHEAT, LOCK_FAILED, OHMIC_LOAD, POWER_MISMATCH, IBN_MODE, SHORTCIRCUIT, CONFIGURATION_ERROR, HARDWARE_FAULT, VOLTAGE_OUT_OF_RANGE, OVERLOAD, PILOT_NOK, RCD, METERING_MALFUNCTION, CONTACTOR_FB_NOK, MISSIN_CFG, WATCHDOG_TRIGGERED, TEMPERATURE_THRESHOLD, WRONG_CONTACTOR_SWITCHING, FSM_STATE_CHANGE_FAILURE, UNKNOWN_STATE.

maxsystemcurrent is the wallbox hardware limit; maxpilotcurrent is the current offered to the vehicle; maxpresetcurrent is the writable user setpoint.

stop prefers Modbus TCP and writes 0 mA to register 5004, which suspends the charging session. The wallbox keeps this setpoint until a new charging current of at least 6000 mA is sent, for example via maxpresetcurrent or the setChargingCurrent action. Without Modbus TCP, stop uses the REST stop-charging request.

phaseswitchstate accepts 1 or 3 through REST, Modbus or UDP. Commands follow the reported phaseswitchsource: 2 uses REST, 3 uses Modbus and 4 uses UDP, without protocol fallback. Commands are ignored while the source is unknown, disabled (0), OCPP (1), or its selected protocol is unavailable. The state reads 0 while phase switching is deactivated (phaseswitchsource 0); otherwise it reports the active phase count. For REST, the binding sends POST /v2/wallboxes/{serialNumber}/phase-toggle?numberOfPhases=1 or numberOfPhases=3. The phase count is read back during polling rather than assumed after a command. KEBA requires a five-minute cooldown between UDP phase changes.

The UDP output command requires DSW1.2 to be OFF on wallboxes with that DIP switch. The binding accepts ON/OFF as aliases for 1/0, and integer values >=10 configure pulses per kWh. KEBA recommends pulse settings up to 150; pulse configuration is stored in EEPROM, so avoid repeated writes. The output channel uses a Number Item; replace existing Switch Items linked to it with Number Items. REST x2active supplies the preferred readback: false becomes 0 and true becomes 1. When REST is unavailable, the channel falls back to the numeric UDP Output readback. REST reports only the X2 switch status, not the pulse setting or phase count; commands always use UDP. With REST alone, output provides readback only.

Rule Actions ​

Use setDisplay to send transient display text through UDP. The REST API does not provide an equivalent transient display command.

The other actions require full-data UDP and are unavailable in display-only mode.

setDisplay Parameters ​

ParameterDescription
textText to show on the display, up to 23 ASCII characters. ~ represents Σ, $ inserts a blank, and , represents a comma.
durationMin (optional)Minimum display time in seconds before another display command can replace the text.
durationMax (optional)Maximum display time in seconds if no further display command arrives.

setChargingCurrent Parameters ​

ParameterDescription
currentCharging-current setpoint in milliamps: 0 to stop charging, or 6000 mA up to the wallbox limit (maximum 63000 mA).
delaySecondsNon-negative activation delay in seconds before applying the current setpoint; this is not a duration.

setFailsafe Parameters ​

ParameterDescription
currentFailsafe current in milliamps: 0, or 6000–63000 mA.
timeoutSecondsTimeout in seconds: 0 or 5–600 s.
persisttrue saves the supplied failsafe current and timeout permanently; false applies them without saving permanently.

Example ​

demo.Actions:

rules
rule "Set Display Text"
when
  System reached start level 100
then
  val keContactActions = getActions("keba", "keba:kecontact:1")
  keContactActions.setDisplay("TEXT$1")           // Default duration
  keContactActions.setDisplay("TEXT$2", 5, 10)    // Explicit duration set
  keContactActions.setChargingCurrent(16000, 10)  // 16 A in 10 sec
  keContactActions.setFailsafe(16000, 60, true)   // 16 A after 60 sec timeout, persistent
end

demo.Things:

dsl
Thing keba:kecontact:combined    [ipAddress="192.168.0.60", modbusEnabled=true,  udpEnabled=true, restEnabled=true, username="admin", password="secret"]
Thing keba:kecontact:restdisplay [ipAddress="192.168.0.61", modbusEnabled=false, udpEnabled=true, restEnabled=true, username="admin", password="secret", udpDisplayOnly=true]   // data via rest + display action
Thing keba:kecontact:p20         [ipAddress="192.168.0.62", modbusEnabled=false, udpEnabled=true]
Thing keba:kecontact:proxied     [ipAddress="192.168.0.63", modbusEnabled=true,  udpEnabled=true, restEnabled=false, modbusIpAddress="192.168.0.20", unitId=255]  // UDP via *.63, Modbus via *.20

demo.Items:

dsl
Number:Dimensionless      KebaCurrentRange      "Maximum supply current [%.1f %%]"        {channel="keba:kecontact:combined:maxpresetcurrentrange"}
Number:ElectricCurrent    KebaCurrent           "Maximum supply current [%.3f A]"         {channel="keba:kecontact:combined:maxpresetcurrent"}
Number:ElectricCurrent    KebaSystemCurrent     "Maximum system supply current [%.3f A]"  {channel="keba:kecontact:combined:maxsystemcurrent"}
Number:ElectricCurrent    KebaFailSafeCurrent   "Failsafe supply current [%.3f A]"        {channel="keba:kecontact:combined:failsafecurrent"}
Number                    KebaState             "Operating State [%s]"                    {channel="keba:kecontact:combined:state"}
Switch                    KebaEnabledSystem     "Enabled (System)"                        {channel="keba:kecontact:combined:enabledsystem"}
Switch                    KebaEnabledUser       "Enabled (User)"                          {channel="keba:kecontact:combined:enableduser"}
Switch                    KebaWallboxPlugged    "Plugged into wallbox"                    {channel="keba:kecontact:combined:wallbox"}
Switch                    KebaVehiclePlugged    "Plugged into vehicle"                    {channel="keba:kecontact:combined:vehicle"}
Switch                    KebaPlugLocked        "Plug locked"                             {channel="keba:kecontact:combined:locked"}
Number:Time               KebaUptime            "Uptime [%.0f s]"                         {channel="keba:kecontact:combined:uptime"}
Number:ElectricCurrent    KebaI1                                                          {channel="keba:kecontact:combined:I1"}
Number:ElectricCurrent    KebaI2                                                          {channel="keba:kecontact:combined:I2"}
Number:ElectricCurrent    KebaI3                                                          {channel="keba:kecontact:combined:I3"}
Number:ElectricPotential  KebaU1                                                          {channel="keba:kecontact:combined:U1"}
Number:ElectricPotential  KebaU2                                                          {channel="keba:kecontact:combined:U2"}
Number:ElectricPotential  KebaU3                                                          {channel="keba:kecontact:combined:U3"}
Number:Power              KebaPower             "Charging power [%.1f W]"                 {channel="keba:kecontact:combined:power"}
Number:Energy             KebaSessionEnergy                                               {channel="keba:kecontact:combined:sessionconsumption"}
Number:Energy             KebaTotalEnergy       "Energy during all sessions [%.1f Wh]"    {channel="keba:kecontact:combined:totalconsumption"}
Switch                    KebaInputSwitch                                                 {channel="keba:kecontact:combined:input"}
Number                    KebaOutput                                                      {channel="keba:kecontact:combined:output"}
Number:Energy             KebaSetEnergyLimit    "Set charge energy limit [%.1f Wh]"       {channel="keba:kecontact:combined:setenergylimit"}

demo.Sitemap:

dsl
sitemap demo label="Main Menu"
{
  Text label="Charging Station"
  {
    Text     item=KebaState
    Text     item=KebaUptime
    Switch   item=KebaEnabledSystem
    Switch   item=KebaEnabledUser
    Switch   item=KebaWallboxPlugged
    Switch   item=KebaVehiclePlugged
    Switch   item=KebaPlugLocked
    Slider   item=KebaCurrentRange
    Text     item=KebaCurrent
    Text     item=KebaSystemCurrent
    Text     item=KebaFailSafeCurrent
    Text     item=KebaSessionEnergy
    Text     item=KebaTotalEnergy
    Setpoint item=KebaSetEnergyLimit
  }
}

Troubleshooting ​

Enable DEBUG logging for org.openhab.binding.keba. For Modbus requests, also enable DEBUG logging for org.openhab.core.io.transport.modbus. UDP uses port 7090 on both the wallbox and openHAB host. On wallboxes equipped with DIP switches, switch 1.3 (0x20 in DIP-Sw1) enables UDP command access. Consult the model's installation manual for the switch's default setting and location. After changing DIP switches, power-cycle the station; a software reset may not apply the new configuration. The KeContact P40 has no DIP switches; enable Modbus TCP and configure its port and Unit ID via the KEBA eMobility App, OCPP or REST API. The default Modbus TCP port is 502 (configurable via the port parameter); the default Unit ID is 255 (configurable via the unitId parameter). The wallbox serves only one Modbus TCP client at a time, so an EMS cannot poll it in parallel with openHAB. Use a Modbus TCP proxy in that case and set modbusIpAddress to the proxy, while UDP and REST keep using ipAddress.

The REST API uses HTTPS and was tested with P30 x-series firmware 2.1.0 and KeMove API v2.5.0. For REST API access, authenticate with the wallbox's locally configured REST username and password. KEBA eMobility Portal credentials are not valid for local REST API access. Verify https://<ipAddress>:<restPort> reaches the wallbox.