
Keba P40
The Keba P40 is an AC EV wallbox designed for home, fleet, and semi-public charging at up to 22 kW. This Modbus TCP template reads active power, cumulative session energy, power factor, maximum and hardware-rated current limits, error codes, and phase-switch state. Write registers let your energy management system set the charging current, toggle charging on or off, trigger single-to-three-phase switching, and define session energy limits. Connecting the Keba P40 to the ModbusCloud Gateway gives installers live charging data, remote control, and failsafe-timeout visibility in one portal.
- Protocol
- Modbus TCP
- Connection
- Ethernet, Modbus TCP
- Registers
- 19, read and write
- Brand
- Keba
- Last updated
Registers (19)
13 read, 6 write
| Name | Unit | Access | Address (Hidden until you enter your email) | Function (hidden) | Type (hidden) |
|---|---|---|---|---|---|
| error_code | Read | ||||
| serial_number | Read | ||||
| firmware | Read | ||||
| active_power | W | Read | |||
| active_production_energy | Wh | Read | |||
| power_factor | % | Read | |||
| max_charging_current | A | Read | |||
| max_supported_current | A | Read | |||
| energy_session | Wh | Read | |||
| phase_switch_source | Read | ||||
| phase_switch_state | Read | ||||
| failsafe_current_setting | A | Read | |||
| failsafe_timeout_setting | s | Read | |||
| set_charging_current | A | Write | |||
| set_energy_limit | Wh | Write | |||
| set_unlock_plug | Write | ||||
| set_enable | Write | ||||
| set_phase_switch_source | Write | ||||
| set_trigger_phase_switch | Write |
Loading registers…
Send your device list
If a device is not in the library yet, we build the template for free as soon as we have the register data.
Use cases
- Monitor active power in real time to verify the Keba P40 stays within contracted grid capacity.
- Track cumulative session energy per charge event to produce billing reports for fleet managers.
- Alert on non-zero error codes to detect faults before drivers report a failed session.
- Compare max_charging_current against max_supported_current to confirm no derating is active.
- Verify phase_switch_state after triggering set_trigger_phase_switch to confirm successful single-to-three-phase transitions.
Installation
Enable Modbus TCP on the Keba P40 by opening the KEBA eMobility app, navigating to the Modbus settings section, and activating both the Enable and Enable RFID options; for phase switching also set the communication channel to Modbus.
Connect the Keba P40 to your local LAN via its RJ45 port (connector X3), and ensure the ModbusCloud Gateway is on the same network segment so it can reach port 502 on the wallbox.
In the ModbusCloud portal, add the ModbusCloud Gateway, import the Keba P40 template, enter the wallbox IP address, set the unit ID to 255, and confirm port 502.
Spot-check the connection by reading the active_power register (address 1020) while a vehicle is charging; a non-zero watt value confirms the template is polling correctly.
Things to watch for
Modbus TCP times out and no registers are readable. What should I check?
Confirm that Modbus TCP is explicitly enabled in the KEBA eMobility app under Modbus settings; the interface is disabled by default. Also verify that no other system (OCPP backend, energy manager, or app) is holding an open connection, as the P40 supports only one Modbus TCP client at a time. Ensure the unit ID is set to 255 and the port is 502.
The power_factor value looks wrong. How is it scaled?
The power factor register returns cos phi in units of 0.1 percent. Divide the raw integer by 1000 to get a standard 0.0 to 1.0 value. For example, a raw reading of 998 means a power factor of 0.998. This scaling follows the same convention as the Keba P30 Modbus specification.
Phase switching is not triggering via set_trigger_phase_switch. Why?
Phase switching via Modbus requires firmware version 1.3.0 or later on the Keba P40. In addition, the phase-switching feature must be enabled under Photovoltaic Optimized Charging settings in the app, and set_phase_switch_source must be configured to assign control to Modbus before set_trigger_phase_switch will be accepted.
Is it safe to write to set_charging_current or set_enable at any time?
Use write registers with care. Writing 0 to set_enable terminates an active session immediately, which may surprise the vehicle driver and disrupt RFID-based authorization workflows. Setting set_charging_current below the vehicle minimum (typically 6 A) can cause the vehicle to stop charging without an explicit session end. Always confirm the failsafe_current_setting so the wallbox falls back to a safe current if Modbus communication is interrupted.
More Keba templates
Want to see how it works?










