EvseManager is located at
modules/EVSE/EvseManager/ and provides the main evse_manager interface.Overview
EvseManager coordinates all aspects of EV charging:- State Machine Management - IEC 61851-1 and ISO 15118 state handling
- Authentication Integration - EIM, PnC, and Autocharge support
- Energy Management - Power limit negotiation and distribution
- Safety Monitoring - Over-current, over-voltage, and isolation monitoring
- Session Logging - Detailed charging session records
- HLC Support - High-Level Communication (ISO 15118) coordination
AC Charging
Basic charging (IEC 61851-1) with PWM control and optional HLC
DC Charging
High-power DC with ISO 15118-2, cable check, and pre-charge
Energy Management
Dynamic power limits and 1ph/3ph switching
Authentication
RFID, Plug & Charge, and Autocharge methods
Module Configuration
Basic Configuration
Connector ID of this EVSE manager
The connector type:
IEC62196Type2Cable, IEC62196Type2Socket, cChaoJi, cCCS1, cCCS2, etc.EVSE ID in ISO 15118 format
EVSE ID in DIN SPEC 91286 format
Charging mode:
AC or DCAC Charging Configuration
Nominal AC voltage between phase and neutral in Volts
Enable High-Level Communication (ISO 15118) for AC mode
Start with 5% PWM if HLC is enabled on AC. If false, start with X1 state.
Force HLC even with EIM authorization before plugin
Allow ventilated charging mode
DC Charging Configuration
Override DC voltage for isolation testing. 0 = auto-determine per IEC 61851-23
Number of isolation measurements to collect before trusting the value. Set to 10 for Bender IMDs that need 10s measurement time.
Enable IMD self-test during cable check (required for IEC 61851-23:2023 compliance)
Wait for voltage to drop below 60V before finishing cable check
Recommended default. Helps with power supplies without active discharge and prevents EV relay issues.
Authentication Configuration
Enable External Identification Means (RFID, mobile app)
Enable contract-based authorization (Plug & Charge)
Skip authentication and offer free charging
Enable Autocharge using MAC address. Disabled by default - use PnC instead.
Use SLAC EV MAC address for Autocharge instead of EVCCID from HLC
Energy Management Configuration
true: Request 0A when no car connected (better for multi-charger installations)false: Request normal current even without car (faster AC BASIC charging start)
Wait time in seconds when switching between 3-phase and 1-phase modes
CP state to use for phase switching:
X1 or FSession Logging
Enable session log file output
Output directory for session log files
Log full XML messages for HLC
String for log folder name.
session_uuid is replaced with actual session UUID.Safety Configuration
Allow N percent over-current during soft over-current checking (AC)
Current measurement noise margin in Amperes
Allow over-current for N milliseconds before triggering protection (minimum 6000ms)
Wait time before raising MREC5 when voltage exceeds negotiated limit
Maximum voltage spread between different measurement sources before fault
Time to stay in state F after fault (300ms per IEC 61851-1:2017). Set to 0 to skip state F (non-compliant).
Module Interfaces
Provided Interfaces
evse (evse_manager)
evse (evse_manager)
Main interface for EVSE management. Provides commands for:
- Enable/disable charging
- Get charging session info
- Pause/resume charging
- Set charging limits
- Get hardware capabilities
energy_grid (energy)
energy_grid (energy)
Energy tree leaf interface for energy supply hierarchy
token_provider (auth_token_provider)
token_provider (auth_token_provider)
Provides auth tokens for Autocharge and Plug & Charge
random_delay (uk_random_delay)
random_delay (uk_random_delay)
UK smart charging regulation random delay control
dc_external_derate (dc_external_derate)
dc_external_derate (dc_external_derate)
External DC power derating capabilities
Required Interfaces
bsp (evse_board_support)
bsp (evse_board_support)
Required: Board support package for hardware control
- Control Pilot (CP) PWM generation
- Relay/contactor control
- Hardware capabilities reporting
- Current/voltage measurements
hlc (ISO15118_charger)
hlc (ISO15118_charger)
Optional: High-level communication module
- ISO 15118-2 protocol implementation
- DIN 70121 support
- TLS and certificate handling
slac (slac)
slac (slac)
Optional: SLAC protocol for PLC communication
- Required for ISO 15118 HLC
- Manages SLAC matching and association
powermeter_grid_side (powermeter)
powermeter_grid_side (powermeter)
Optional: Grid-side power meter
- Used for energy management
- Used for billing if no car-side meter
powermeter_car_side (powermeter)
powermeter_car_side (powermeter)
Optional: Car-side power meter
- Preferred for billing when present
- More accurate than grid-side measurements
powersupply_DC (power_supply_DC)
powersupply_DC (power_supply_DC)
Optional: DC power supply control (DC mode only)
- Voltage and current control
- Pre-charge and cable check
- Bidirectional power transfer support
imd (isolation_monitor)
imd (isolation_monitor)
Optional: Isolation monitoring device (DC mode)
- Required for DC charging per IEC 61851-23
- Monitors insulation resistance
Configuration Example
State Machine Overview
EvseManager implements a complex state machine handling:Best Practices
Session Logging: Enable session logging during development and testing to debug charging issues. Consider disk space for production deployments.
Energy Management: Set
request_zero_power_in_idle: true for installations with multiple charging stations to optimize power distribution.Related Modules
Authentication
Authorization and access control
ISO 15118
High-level communication protocols
Energy Management
Power distribution and load balancing
Hardware Drivers
Board support packages
Source Code Reference
Key implementation files:modules/EVSE/EvseManager/EvseManager.cpp- Main module implementationmodules/EVSE/EvseManager/Charger.cpp- Charging state machine (103KB)modules/EVSE/EvseManager/IECStateMachine.cpp- IEC 61851-1 statesmodules/EVSE/EvseManager/ErrorHandling.cpp- Error managementmodules/EVSE/EvseManager/manifest.yaml- Module configuration