API integration patterns between Enexa Platform and Amperio Middleware
Enexa Platform
Cloud-based optimization platform that manages asset registry, configuration, and dispatch scheduling. Sends commands to Amperio Middleware and receives telemetry data.Enexa is responsible for the platform, dashboards, and optimization algorithms.
Amperio Middleware
Centralized backend that handles communication with ADS-TEC ChargePost hardware. Exposes REST API for Enexa integration and translates commands to Modbus/TCP registers.Amperio Team is responsible for the middleware and all ChargePost communication.
The Modbus/TCP communication between Amperio Middleware and ChargePost units is internal to Amperio's implementation. Enexa only interacts with the Amperio Middleware REST API.
Asset Registry
Master data
Config Repository
Central settings
Optimization Engine
SOC / Arbitrage
Dashboards
Monitoring
REST API over HTTPS
Commands & Telemetry
API Gateway
Enexa integration
Modbus Client
Register read/write
Watchdog Manager
2-60s heartbeat
Modbus/TCP (Internal)
Port 502, Function Codes 03/04/06/16
Ultrafast charging (up to 300kW), integrated battery storage (2x 110kW units), grid metering - all via Modbus interface v2.6
Clean Separation of Concerns
Enexa handles optimization, configuration, and UI. Amperio handles all IoT communication and hardware control. The integration point is a well-defined REST API between the two platforms.
Enexa provides the API endpoint
Amperio calls these APIs to fetch data or push telemetry
api.enexa.io/*
Amperio provides the API endpoint
Enexa calls these APIs to dispatch commands
api.amperio.io/*
Enexa calls Amperio's API to send commands
// Amperio hosts this endpoint
POST https://api.amperio.io/v1/dispatch
Authorization: Bearer {token}
{
"site_id": "SITE001",
"command": "set_battery_power",
"params": { "power_kw": -25 },
"timestamp": "2024-01-15T10:00:00Z"
}
Amperio calls Enexa's API to push telemetry
// Enexa hosts this endpoint
POST https://api.enexa.io/v1/telemetry
Authorization: Bearer {token}
{
"site_id": "SITE001",
"timestamp": "2024-01-15T10:00:01Z",
"battery": { "soc_pct": 65, ... },
"grid": { "import_kw": 35, ... }
}
Amperio calls Enexa's API to fetch configuration
// Enexa hosts this endpoint
GET https://api.enexa.io/v1/config/{site_id}
Authorization: Bearer {token}
// Returns site configuration
{ "battery": {...}, "grid": {...} }
Each system exposes health endpoints
// Enexa hosts - Amperio calls to report status
POST https://api.enexa.io/v1/status
{ "site_id": "SITE001", "online": true }
// Amperio hosts - Enexa calls to check health
GET https://api.amperio.io/v1/health
Single Source of Truth: Enexa stores all asset master data, configuration, and firmware information. Amperio Middleware fetches this data via API, ensuring consistency across all sites and controllers.
List all sites accessible to the middleware
{ "sites": [{ "id": "SITE001", "name": "..." }] }
Get all equipment registered at a site
{ "battery": {...}, "chargers": [...], "meters": [...] }
Get controller details and assigned assets
{ "id": "CTRL001", "assets": ["BAT1", "CHG1"] }
Get equipment specifications (capacity, limits)
{ "capacity_kwh": 200, "max_power_kw": 100 }
Fetch full controller configuration
{ "version": 5, "settings": {...}, "limits": {...} }
Check if config has changed (for polling)
{ "version": 5, "updated_at": "2024-01-15T..." }
Get latest available firmware version
{ "version": "2.1.0", "url": "...", "sha256": "..." }
Report current firmware version to Enexa
{ "current_version": "2.0.5", "status": "ok" }
Register new controller with Enexa, receive credentials
Request: { "serial": "...", "site_id": "..." }
Response: { "api_key": "...", "config_url": "..." }
Fetch initial configuration for first-time setup
Response: { "config": {...}, "assets": [...] }
Confirm successful setup and go live
Request: { "status": "ready", "tests_passed": true }
Response: { "activated": true }
TLS Encryption
All API communication over HTTPS with TLS 1.3
OAuth 2.0 / API Keys
Bearer token authentication for all API calls
IP Allowlisting
Optional: restrict API access to known IPs
Token Expiry
Access tokens expire after 1 hour, refresh tokens for renewal
Audit Logging
All API calls logged with timestamp, source, action
Rate Limiting
API rate limits to prevent abuse (configurable)
When Enexa API is unreachable, Amperio Middleware must buffer data locally:
1. Telemetry Buffering
2. Event Logging
3. Local Autonomous Mode
4. Reconnection Flush
When connection is re-established after an outage, Enexa must perform additional steps to ensure optimal operation:
1. State Synchronization
2. Schedule Re-evaluation
3. Command Re-dispatch
4. Data Reconciliation
Note: The re-planning process adds complexity as the optimizer must account for state drift during the disconnection period. If the actual SOC diverges significantly from the planned SOC, the new schedule may differ substantially from the original plan.
200 OK
Success
401 Unauthorized
Invalid/expired token
429 Too Many Requests
Rate limited
503 Service Unavailable
System down