Skip to content

API Reference

The WattWächter REST API is available at http://ww.local/api/v1/ and provides full access to device data, settings, and control functions.

Authentication

The API uses Bearer tokens in the Authorization header:

Authorization: Bearer YOUR_TOKEN

There are two token levels:

  • READ Token — Read data (history, status, view settings)
  • WRITE Token — Change settings, start OTA, trigger reboot

Token Renewal

Tokens can be renewed via a two-phase process:

  1. POST /api/v1/auth/tokens/generate — Generates new tokens (not yet active)
  2. POST /api/v1/auth/tokens/confirm — Activates the new tokens (within 60 seconds)

This two-phase approach prevents lockout if the response is lost.

Endpoint Overview

System

Method Endpoint Auth Description
GET /api/v1/system/alive Health check
GET /api/v1/system/info READ System information
GET /api/v1/system/led READ LED status
GET /api/v1/system/wifi_scan WiFi scan
GET /api/v1/system/timezones READ Timezone list
POST /api/v1/system/reboot WRITE Reboot

History

Method Endpoint Auth Description
GET /api/v1/history/latest READ Latest reading
GET /api/v1/history/highRes?date=YYYY-MM-DD READ 15-min data for a day
GET /api/v1/history/lowRes?start=YYYY-MM-DD&days=7 READ Daily values

Settings

Method Endpoint Auth Description
GET /api/v1/settings READ Read settings
POST /api/v1/settings WRITE Update settings (partial)
POST /api/v1/auth/tokens/generate WRITE Generate new tokens
POST /api/v1/auth/tokens/confirm WRITE Activate tokens
GET /api/v1/mqtt/ca READ CA certificate status
POST /api/v1/mqtt/ca WRITE Upload CA certificate
DELETE /api/v1/mqtt/ca WRITE Delete CA certificate
POST /api/v1/cloud/pair WRITE Send cloud pairing token
DELETE /api/v1/cloud/pair WRITE Remove cloud pairing

OTA

Method Endpoint Auth Description
GET /api/v1/ota/check READ Check for update
POST /api/v1/ota/start WRITE Start update

Logs / Debug

Method Endpoint Auth Description
GET /api/v1/logs/rawdump READ SmartMeter ring buffer (binary)
GET /api/v1/logs/persistent READ Persistent CSV log file
GET /api/v1/logs/ram READ RAM log snapshot (CSV)
GET /api/v1/debug/listFS READ SPIFFS file listing

Interactive API Documentation

The full API specification in OpenAPI format:

Note

The API documentation is automatically generated from the firmware's OpenAPI specification.