A Python library for communicating with OpenEVSE chargers via the HTTP API on ESP8266 and ESP32-based WiFi modules.
- Asynchronous: Built on
aiohttpfor non-blocking I/O. - WebSocket Support: Real-time updates for charger status.
- Firmware Support: Compatible with ESP8266 (2.x) and ESP32 (4.x+) WiFi firmware.
- Comprehensive API:
- Query status and configuration.
- Manage manual overrides.
- Control charging claims and limits.
- Handle schedules.
- Shaper Toggle: Enable or disable the grid shaper feature (requires firmware 4.0.0+).
pip install python_openevse_httpimportasyncioimportaiohttpfromopenevsehttpimportOpenEVSEasyncdefmain():
asyncwithaiohttp.ClientSession() assession:
charger=OpenEVSE("192.168.1.30", session=session)
awaitcharger.update()
print(f"Charger State: {charger.status}")
print(f"Current Charge: {charger.charge_current}A")
ifcharger.shaper_active:
print("Shaper is active, disabling...")
else:
print("Shaper is inactive, enabling...")
awaitcharger.toggle_shaper()
awaitcharger.ws_disconnect()
if__name__=="__main__":
asyncio.run(main())If your OpenEVSE WiFi/ethernet module uses HTTPS, you can configure the client to connect securely using the ssl=True parameter:
# Connect securely using HTTPS (validating SSL/TLS certificates)charger=OpenEVSE(
"192.168.1.30",
session=session,
ssl=True,
)Warning
Disabling SSL certificate validation (ssl_verify=False) disables TLS verification and exposes the connection to Man-in-the-Middle (MITM) attacks. Only use this configuration when connecting to an OpenEVSE module with a self-signed certificate over a trusted local network.
To bypass certificate verification:
# Connect using HTTPS, and disable certificate verificationcharger=OpenEVSE(
"192.168.1.30",
session=session,
ssl=True,
ssl_verify=False,
)| Endpoint | Methods | Supported | Description |
|---|---|---|---|
/status | GET, POST | ✅ | Real-time status, sensors, and Vehicle SoC pushing |
/config | GET, POST | ✅ | System and WiFi configuration |
/override | GET, POST, PATCH, DELETE | ✅ | Manual charging overrides & current limits |
/claims | GET, POST, DELETE | ✅ | Client-based charging claims |
/schedule | GET, POST | Charging schedule management (Retrieval only) | |
/limit | GET, POST, DELETE | ✅ | Charge limits (Time, Energy, SoC) |
/shaper | POST | ✅ | Grid shaper control (v4.0.0+) |
/restart | POST | ✅ | Reboot WiFi gateway or EVSE module |
/divertmode | POST | ✅ | Solar divert mode control |
/r (RAPI) | POST | ✅ | Direct RAPI command interface |
/ws | GET | ✅ | WebSocket real-time updates |
/time | GET, POST | ❌ | RTC and NTP time settings |
/logs | GET | ❌ | System and debug event logs |
/emeter | DELETE | ❌ | Energy meter reset |
/wifi | GET, POST | ❌ | Network scanning and AP configuration |
/tesla | GET | ❌ | Tesla vehicle integration |
/certificates | GET, POST, DELETE | ❌ | SSL/TLS certificate management |
/schedule/plan | GET | ❌ | Schedule planning and optimization |
/update | POST | ✅ | Firmware update interface |
/rfid/add | POST | ❌ | RFID tag management |
✅ = Fully Supported |
This project is licensed under the Apache-2.0 License.