docs: settings API, per-inverter offline window, language

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 18:15:38 +03:00
co-authored by Claude Opus 5.5
parent 0b74842560
commit 9ac86e2588
+20 -7
View File
@@ -70,9 +70,11 @@ generate a Flutter client later).
| `GET` | `/api/inverters/{id}/latest` | Latest reading (plus derived DC power / efficiency) | | `GET` | `/api/inverters/{id}/latest` | Latest reading (plus derived DC power / efficiency) |
| `GET` | `/api/inverters/{id}/history` | `from`, `to` (ISO), optional `bucket` seconds, `field` (repeatable). Downsampled to ≤600 points | | `GET` | `/api/inverters/{id}/history` | `from`, `to` (ISO), optional `bucket` seconds, `field` (repeatable). Downsampled to ≤600 points |
| `GET` | `/api/inverters/{id}/daily` | Energy + peak power per local day (`days`, default 365, or `from`/`to` dates) | | `GET` | `/api/inverters/{id}/daily` | Energy + peak power per local day (`days`, default 365, or `from`/`to` dates) |
| `GET` | `/api/power` | AC power of all inverters over time (default 24 h) | | `GET` | `/api/power` | AC power of all inverters over time (default 24 h; `last_run=true` = since the inverters last woke up) |
| `GET` | `/api/energy/daily` | Energy per day per inverter + total (default 30 days) | | `GET` | `/api/energy/daily` | Energy per day per inverter + total (default 30 days) |
| `GET` | `/api/meta/fields` | Label / unit / group of every parameter — render from this | | `GET` | `/api/meta/fields` | Label / unit / group of every parameter — render from this |
| `GET` | `/api/settings` | Dashboard display options (comparison averaging / scale / reference, power chart range / smoothing, voltage display, default language) |
| `PUT` | `/api/settings` | Replace them — applies to every viewer (no accounts). `X-API-Key` required |
### Adding parameters ### Adding parameters
@@ -84,8 +86,10 @@ the chart picker without further changes.
### Health rules ### Health rules
- **Offline** — no reading for `ONLINE_WINDOW_SECONDS` (5 min) while the - **Offline** — no reading for `ONLINE_WINDOW_SECONDS` (5 min) — or 2.5× the
datalogger is still posting and the sun is up. At night that's **Sleeping**; inverter's own reporting interval if that is longer (INV5 comes from the
cloud every ~5 min → ~12 min) — while the datalogger is still posting and
the sun is up. At night that's **Sleeping**;
if the datalogger itself is silent the state is **No data** (and a banner if the datalogger itself is silent the state is **No data** (and a banner
says so). says so).
- **Fault** — the reading carries a non-zero `error_code`. No `error_code` - **Fault** — the reading carries a non-zero `error_code`. No `error_code`
@@ -104,10 +108,19 @@ Thresholds are in `.env`.
Daily energy uses, in order: the inverter's daily counter Daily energy uses, in order: the inverter's daily counter
(`daily_energy_wh`), the growth of its lifetime counter, or — while neither (`daily_energy_wh`), the growth of its lifetime counter, or — while neither
is decoded, which is the case today — AC power integrated over time is sent (INV1–INV4 today; only INV5 has real counters) — AC power
(trapezoid between consecutive readings, gaps over 5 min not bridged). The integrated over time (trapezoid between consecutive readings, gaps over 5 min
estimate is flagged (`estimated: true` in the API, "≈" on the dashboard). not bridged). The estimate is flagged (`estimated: true` in the API, "≈" on
Lifetime energy shows "not available yet" until `total_energy_wh` is sent. the dashboard). Lifetime energy only exists where `total_energy_wh` is sent;
the dashboard total says how many inverters it covers.
### Dashboard settings and language
The ⚙ page sets the display options above for everyone; the API key is asked
once and remembered on the device. The language (Greek / English) can be
switched per device from the header; devices that haven't picked one use the
shared default. Issue texts are translated client-side from each issue's
`code` + `params`, so new clients (Flutter) can do the same.
The current state of the register map is in `poller/README.md`. The current state of the register map is in `poller/README.md`.