-
-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Context
DOCSight currently uses the data.lua endpoint for all FritzBox communication (DOCSIS channels, device info, connection info). While functional, this approach has limitations:
data.luaresponses mix HTML and JSON depending on firmware version and page- Some data (e.g. segment utilization) is only available via the newer
/api/v0/REST API - The REST API likely exposes additional data that
data.luadoes not
Discovery
While investigating cable segment utilization (#182), we found the FritzBox serves a proper REST API:
| Endpoint | Purpose |
|---|---|
/api/v0/generic/box |
Box info |
/api/v0/generic/connections |
Connection details |
/api/v0/generic/time |
Time reference |
/api/v0/monitor/segment/subsets |
Segment utilization datasets |
/api/v0/monitor/segment/{0-4} |
Individual segment series (DS/US total + own share) |
The cable utilization page (#/cable/utilization) uses this API to display network-wide segment load as 0-100% over configurable timeranges (1h to 1y).
Problem
The /api/v0/ endpoints return permission denied (code 3001) when called with the standard SID authentication used by data.lua. The FritzBox SPA successfully loads these endpoints during page navigation, so there is a working auth mechanism - it just needs to be identified.
Goals
- Reverse-engineer
/api/v0/authentication by analyzing the FritzBox frontend JS (specifically/js3/views/internet/wan/utilization.htmland related modules) - Document all available
/api/v0/endpoints - map out what data is accessible - Evaluate migration path - identify which current
data.luacalls could be replaced with cleaner REST API equivalents - Enable segment utilization feature - this is the immediate use case, tracked separately
Why This Matters
- Cleaner, more reliable data access (structured JSON vs HTML/JSON mix)
- Access to data not available through
data.lua(segment utilization, spectrum, etc.) - Better foundation for future FritzBox features
- Reduces workarounds for firmware-specific
data.luaquirks (see fix: add TR-064 fallback for FritzBox device infoΒ #181, fix: prefer stable FritzBox device info pagesΒ #183)
Research notes
See docs/plans/2026-03-09-segment-utilization-research.md for detailed findings.