Skip to main content

OpenEVSE

Local-LAN driver for OpenEVSE Level-2 EV charging stations running the OpenEVSE WiFi v4 firmware (the ESP32-based gateway board). The driver polls /status and /config, surfaces telemetry as device attributes, and exposes control verbs (enable / disable / sleep / current-limit) via the unit's documented HTTP endpoints and the RAPI passthrough at /r?json=1&rapi=....

Prerequisites

  • OpenEVSE controller hardware with the OpenEVSE WiFi v4 firmware (formerly "OpenEVSE WiFi Gateway"). The earlier v1/v2 EmonCMS-only firmware exposes a different, smaller HTTP surface and is not supported by this driver.
  • The EVSE must be joined to the building LAN. The boot AP (SSID OpenEVSE_xxxx) is for commissioning only.
  • A DHCP reservation on the unit's MAC. The driver talks to a fixed IP — there is no mDNS resolution path.
  • If you set an HTTP password on the unit (Settings → Security on the EVSE web UI), record it for the username + password attributes here.

Setup steps

  1. Reserve the OpenEVSE's IP on your DHCP server.
  2. Verify the API in a browser at http://<ip>/status. You should see a JSON document with state, amp, voltage, and wh fields. If it returns a login challenge, the unit has a web password set.
  3. In GEM, Admin → Devices → Add Device, pick driver openevse, set ip. If the unit has a web password, also set username (default openevse) and password.
  4. Save. Telemetry attributes will populate after the first poll cycle (~10s).

Attribute reference

Required

AttributeTypeDescription
ipstringLAN IP of the OpenEVSE WiFi v4 controller.

Optional

AttributeTypeDefaultDescription
portint80HTTP port.
usernamestringopenevseHTTP basic-auth username. Ignored when no password is set.
passwordstring (secure)HTTP basic-auth password set in the OpenEVSE UI. Auto-encrypted by GEM's secure-attribute hook.
status_intervalint10000Poll interval in ms.
request_timeoutint10000HTTP request timeout in ms.

Telemetry attributes (set by the driver)

AttributeTypeSource
evse_statestring/status.state mapped to not_connected, connected, charging, sleeping, disabled, vent_required, diode_check_failed, gfci_fault, no_ground, stuck_relay, gfci_self_test_failed, over_temperature, over_current. Unknown codes pass through as state_<n>.
evse_state_codeintRaw /status.state numeric code.
charging_current_afloat/status.amp (milliamps) ÷ 1000.
voltage_vint/status.voltage. Some units without an active CT report 0 between sessions.
charging_power_wintcharging_current_a × voltage_v.
session_energy_whint/status.wh — energy delivered in current session.
session_secondsint/status.elapsed.
pilot_ampsint/status.pilot — current pilot signal duty cycle (amps).
ambient_temp_cfloat/status.temp1 ÷ 10 (skipped when the sensor returns the "no sensor" sentinel -2560).
mcp9808_temp_cfloat/status.temp2 ÷ 10.
ds3231_temp_cfloat/status.temp3 ÷ 10.
wifi_rssiint/status.srssi.
uptime_secondsint/status.up.
override_statestringCurrent manual override (active, disabled, sleeping, or absent).
charge_rateintCurrent configured charge rate in amps (/status.charge_rate).
divert_activeboolTrue when divert mode (solar) is currently sourcing — /status.divertmode == 2.

Commands

CommandArgsEffect
get_statusReturns /status JSON.
get_configReturns /config JSON.
enableEnable charging (RAPI $FE).
disableDisable charging entirely (RAPI $FD).
sleepSleep mode — allow plug-in but no charge (RAPI $FS).
set_current_limitamps (6–80)Set soft current limit (RAPI $SC <amps>). Clamped to panel max by the ESP.
overridestate (active/disabled/sleeping or null)POST /override. Null clears the override. Falls back to RAPI on older firmware that lacks /override.
restartPOST /restart — reboots the ESP.
rapicmd (string starting with $)Raw RAPI passthrough. Advanced — use sparingly.
refreshForce an immediate status poll.

Zone address format

This driver does not use zones (supports_zones: false). All telemetry and control live on the device row.

Known limitations

  • Current-limit clamping. set_current_limit is silently clamped to config.max_current_soft by the firmware. Requests above panel max appear to succeed but the unit holds the lower value.
  • voltage may read 0. Units without an active CT report 0 voltage between sessions. Treat 0 as "no measurement" rather than a fault.
  • Firmware quirk on /override. Older OpenEVSE WiFi v4 builds (pre-4.1.x) do not expose /override. The driver detects the 404 and falls back to the equivalent RAPI command. Pure v1/v2 firmware is not supported at all.
  • RAPI return strings, not JSON. RAPI replies are $OK/$NK strings; the driver normalizes them to {ok:true} / {error:'rapi NK'}. The raw ret string is included for debugging.
  • MQTT / Emoncms reporting paths are not used. The driver is HTTP-only. If you have an existing MQTT integration on the unit it will continue to publish in parallel.

Troubleshooting

  • 401 Unauthorized on /status or /config. The unit has a web password set but no password attribute is configured in GEM. Set both username and password.
  • charging_current_a flickers between 0 and a small value. Normal between sessions — the pilot duty cycle still draws a few mA on the CT. Use >= 1A thresholds for triggers.
  • evse_state stuck at disabled after a restart. Send enable (RAPI $FE); some firmware persists the disabled state across reboots.
  • set_current_limit appears ignored. Compare against max_current_soft in get_config — the ESP clamps silently.