- Router: gorilla/mux, strict slash
- Middleware: GZIP, CORS (
*), ETag caching, request logging, JSON headers, JWT auth - Timeouts: Read 5s, Write 10s, Idle 120s
- Static assets: embedded in binary (
fs.FS) - Default port: 7070
POST /buffersoc/{value},/prioritysoc/{value},/residualpower/{value}etc.GET /tariff/{tariff}β tariff ratesGET /sessionsβ charging historyGET /stateβ complete system state (supports jq filtering)
POST mode/{value}β off/now/minpv/pvPOST limitsoc/{value},limitenergy/{value}β charge limitsPOST mincurrent/{value},maxcurrent/{value}β current limitsPOST phases/{value}β phase configPOST priority/{value},batteryboost/{value}POST plan/energy/{value}/{time}β schedule planPOST vehicle/{name}β select vehiclePOST smartcostlimit/{value}β smart cost threshold
- CRUD for devices (chargers, meters, vehicles, tariffs)
- Template browsing and testing
- Site, loadpoint, circuit, HEMS, messaging config
GET /config/evcc.yamlβ YAML export
- Log viewing, cache clear, DB backup/restore/reset, shutdown
Generic handler[T] with type conversion, setter, getter.
Specialized: floatHandler, intHandler, boolHandler, durationHandler.
coder/websocket(RFC 6455)- Pub/sub via
SocketHub - Buffered channels (1024 per subscriber)
- Welcome message with full state snapshot
- Incremental updates as JSON key-value pairs with dot-notation keys:
{"loadpoints.1.mode": "solar", "site.gridPower": 1234} - Write timeout: 10s, compression (disabled for Safari)
- WS connects -> receives welcome with full state
- App emits
util.Paramon changes - Hub broadcasts to subscribers
- Frontend
store.update(msg)merges via dot-notation - Components reactively re-render
- JWT, 90-day lifetime
- HttpOnly cookie (
auth) withSameSite=Strict - Also accepts
Authorization: Bearer <token>header - Modes: Disabled, Locked (demo), Configured (password)
- Protects
/api/configand/api/system
- Publishes state changes to configurable broker
- Subscribes to control topics
- Retained messages for state persistence
server/http.goβ router setupserver/http_auth.goβ authenticationserver/http_site_handler.goβ state + request handlersserver/http_config_*.goβ config endpointsserver/http_loadpoint_handler.goβ per-loadpoint endpointsserver/socket.goβ WebSocket pub/subassets/js/app.tsβ Vue app entryassets/js/store.tsβ reactive state storeassets/js/api.tsβ Axios clientsassets/js/router.tsβ route definitions