Skip to main content
The EvseManager module is the heart of EVerest’s charging logic. It implements the complete charging state machine for both AC and DC charging, manages authentication, coordinates with energy management, and handles all aspects of a charging session.
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
integer
required
Connector ID of this EVSE manager
connector_type
string
default:"Unknown"
The connector type: IEC62196Type2Cable, IEC62196Type2Socket, cChaoJi, cCCS1, cCCS2, etc.
evse_id
string
default:"DE*PNX*E1234567*1"
EVSE ID in ISO 15118 format
evse_id_din
string
default:"49A80737A45678"
EVSE ID in DIN SPEC 91286 format
charge_mode
string
default:"AC"
Charging mode: AC or DC

AC Charging Configuration

ac_nominal_voltage
number
default:"230"
Nominal AC voltage between phase and neutral in Volts
ac_hlc_enabled
boolean
default:"false"
Enable High-Level Communication (ISO 15118) for AC mode
ac_hlc_use_5percent
boolean
default:"true"
Start with 5% PWM if HLC is enabled on AC. If false, start with X1 state.
Most EVs will not perform SLAC/HLC on X1. Set to true for best compatibility.
ac_enforce_hlc
boolean
default:"false"
Force HLC even with EIM authorization before plugin
This violates ISO 15118-3. Use only for home charging, not public stations.
has_ventilation
boolean
default:"true"
Allow ventilated charging mode

DC Charging Configuration

dc_isolation_voltage_V
integer
default:"0"
Override DC voltage for isolation testing. 0 = auto-determine per IEC 61851-23
cable_check_wait_number_of_imd_measurements
integer
default:"1"
Number of isolation measurements to collect before trusting the value. Set to 10 for Bender IMDs that need 10s measurement time.
cable_check_enable_imd_self_test
boolean
default:"true"
Enable IMD self-test during cable check (required for IEC 61851-23:2023 compliance)
cable_check_wait_below_60V_before_finish
boolean
default:"true"
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

payment_enable_eim
boolean
default:"true"
Enable External Identification Means (RFID, mobile app)
payment_enable_contract
boolean
default:"true"
Enable contract-based authorization (Plug & Charge)
disable_authentication
boolean
default:"false"
Skip authentication and offer free charging
Only use for standalone testing without Auth module. Do not use with OCPP.
enable_autocharge
boolean
default:"false"
Enable Autocharge using MAC address. Disabled by default - use PnC instead.
autocharge_use_slac_instead_of_hlc
boolean
default:"false"
Use SLAC EV MAC address for Autocharge instead of EVCCID from HLC

Energy Management Configuration

request_zero_power_in_idle
boolean
default:"false"
  • true: Request 0A when no car connected (better for multi-charger installations)
  • false: Request normal current even without car (faster AC BASIC charging start)
switch_3ph1ph_delay_s
integer
default:"10"
Wait time in seconds when switching between 3-phase and 1-phase modes
switch_3ph1ph_cp_state
string
default:"X1"
CP state to use for phase switching: X1 or F
Some EVs may be permanently damaged when switching from 1ph to 3ph. The BSP must verify EV capabilities.

Session Logging

session_logging
boolean
default:"false"
Enable session log file output
session_logging_path
string
default:"/tmp"
Output directory for session log files
session_logging_xml
boolean
default:"true"
Log full XML messages for HLC
logfile_suffix
string
default:"session_uuid"
String for log folder name. session_uuid is replaced with actual session UUID.

Safety Configuration

soft_over_current_tolerance_percent
number
default:"10.0"
Allow N percent over-current during soft over-current checking (AC)
soft_over_current_measurement_noise_A
number
default:"0.5"
Current measurement noise margin in Amperes
soft_over_current_timeout_ms
integer
default:"7000"
Allow over-current for N milliseconds before triggering protection (minimum 6000ms)
internal_over_voltage_duration_ms
integer
default:"400"
Wait time before raising MREC5 when voltage exceeds negotiated limit
voltage_plausibility_max_spread_threshold_V
number
default:"50.0"
Maximum voltage spread between different measurement sources before fault
state_F_after_fault_ms
integer
default:"300"
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

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 tree leaf interface for energy supply hierarchy
Provides auth tokens for Autocharge and Plug & Charge
UK smart charging regulation random delay control
External DC power derating capabilities

Required Interfaces

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
Optional: High-level communication module
  • ISO 15118-2 protocol implementation
  • DIN 70121 support
  • TLS and certificate handling
Optional: SLAC protocol for PLC communication
  • Required for ISO 15118 HLC
  • Manages SLAC matching and association
Optional: Grid-side power meter
  • Used for energy management
  • Used for billing if no car-side meter
Optional: Car-side power meter
  • Preferred for billing when present
  • More accurate than grid-side measurements
Optional: DC power supply control (DC mode only)
  • Voltage and current control
  • Pre-charge and cable check
  • Bidirectional power transfer support
Optional: Isolation monitoring device (DC mode)
  • Required for DC charging per IEC 61851-23
  • Monitors insulation resistance

Configuration Example

active_modules:
  evse_manager:
    module: EvseManager
    config:
      connector_id: 1
      connector_type: IEC62196Type2Cable
      evse_id: DE*PNX*E1234567*1
      charge_mode: AC
      ac_nominal_voltage: 230
      ac_hlc_enabled: true
      ac_hlc_use_5percent: true
      payment_enable_eim: true
      payment_enable_contract: true
      session_logging: true
      session_logging_path: /var/log/everest/sessions
      request_zero_power_in_idle: true
    connections:
      bsp: yeti_driver
      powermeter_grid_side: pm_grid
      hlc: iso15118_charger
      slac: slac_module
      energy_grid: energy_manager

State Machine Overview

EvseManager implements a complex state machine handling:
1

Idle

No vehicle connected. Monitoring for plug-in events.
2

Waiting for Authentication

Vehicle detected. Waiting for authorization token.
3

Preparing

Authorization received. Negotiating charging parameters.
4

Charging

Active energy transfer. Monitoring safety limits.
5

Finished

Charging complete. Waiting for disconnect.
6

Error

Fault detected. Handling error conditions.

Best Practices

Authentication: Always use the Auth module in production. Only set disable_authentication: true for standalone testing.
Phase Switching: Ensure your BSP properly verifies EV support before switching between 1ph and 3ph to prevent vehicle damage.
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.

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 implementation
  • modules/EVSE/EvseManager/Charger.cpp - Charging state machine (103KB)
  • modules/EVSE/EvseManager/IECStateMachine.cpp - IEC 61851-1 states
  • modules/EVSE/EvseManager/ErrorHandling.cpp - Error management
  • modules/EVSE/EvseManager/manifest.yaml - Module configuration

Build docs developers (and LLMs) love