Skip to content

Repository files navigation

Codecov branchGitHub commit activity (branch)GitHub last commitGitHub release (latest SemVer)

python-openevse-http

A Python library for communicating with OpenEVSE chargers via the HTTP API on ESP8266 and ESP32-based WiFi modules.

Features

  • Asynchronous: Built on aiohttp for 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+).

Installation

pip install python_openevse_http

Quick Start

importasyncioimportaiohttpfromopenevsehttpimportOpenEVSEasyncdefmain():
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())

HTTPS and SSL Verification Options

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,
)

Bypassing SSL Verification (Self-Signed Certificates)

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,
)

API Support Matrix

EndpointMethodsSupportedDescription
/statusGET, POSTReal-time status, sensors, and Vehicle SoC pushing
/configGET, POSTSystem and WiFi configuration
/overrideGET, POST, PATCH, DELETEManual charging overrides & current limits
/claimsGET, POST, DELETEClient-based charging claims
/scheduleGET, POST⚠️Charging schedule management (Retrieval only)
/limitGET, POST, DELETECharge limits (Time, Energy, SoC)
/shaperPOSTGrid shaper control (v4.0.0+)
/restartPOSTReboot WiFi gateway or EVSE module
/divertmodePOSTSolar divert mode control
/r (RAPI)POSTDirect RAPI command interface
/wsGETWebSocket real-time updates
/timeGET, POSTRTC and NTP time settings
/logsGETSystem and debug event logs
/emeterDELETEEnergy meter reset
/wifiGET, POSTNetwork scanning and AP configuration
/teslaGETTesla vehicle integration
/certificatesGET, POST, DELETESSL/TLS certificate management
/schedule/planGETSchedule planning and optimization
/updatePOSTFirmware update interface
/rfid/addPOSTRFID tag management

✅ = Fully Supported | ⚠️ = Partial Support | ❌ = Not yet implemented

License

This project is licensed under the Apache-2.0 License.

About

Python Library for OpenEVSE HTTP API

Topics

Resources

Stars

7 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages