How sstangle73/ting-recorder works
ting-recorder is a self-hosted Ting sensor recorder: it authenticates to Whisker Labs, collects live readings and REST state, retains and analyzes them, then serves a web UI, read-only API, Prometheus metrics, and optional Home Assistant MQTT updates. The principal flow is account sign-in → per-sensor stream and REST polling → decoding and persistence → rollups/event inference → user-facing history and status. Edges reflect the supplied excerpts, SOURCE INDEX references, or README; unsampled subsystem details are represented only where documented.
Main entry points: main.py Recorder runtime · web.py Web UI and API · hub.py Live hub session · store.py SQLite store
Components 21
Ting Cloud Collection
- Cognito client
ting_recorder/cognito.py - Identity manager
ting_recorder/identity.py - Live hub session
ting_recorder/hub.py - SignalR protocol
ting_recorder/signalr.py - Ting REST client
ting_recorder/rest.py
Recording and Analysis
- Reading decoder
ting_recorder/decode.py - Recorder runtime
ting_recorder/main.py - Runtime settings
ting_recorder/config.py - Synthetic data
ting_recorder/demo.py - SQLite store
ting_recorder/store.py - Event inference
ting_recorder/infer.py - History queries
ting_recorder/queries.py
Web and API
- Web UI and API
ting_recorder/web.py - Request authentication
ting_recorder/auth.py - Browser interface
ting_recorder/static/app.js
Exports and Integrations
- Prometheus metrics
ting_recorder/metrics.py - MQTT publisher
ting_recorder/mqtt.py
Other components
- Recorder operator
- Ting cloud
- Prometheus
- MQTT broker
Connections 28
- Recorder operator → Recorder runtime: configures
README.md - Recorder runtime → Runtime settings: loads settings
ting_recorder/main.py - Recorder runtime → Identity manager: coordinates sign-in
ting_recorder/main.py - Identity manager → Cognito client: signs in
ting_recorder/identity.py - Cognito client → Ting cloud: authenticates with
ting_recorder/cognito.py - Recorder runtime → Ting REST client: polls state
ting_recorder/main.py - Ting REST client → Ting cloud: requests account data
ting_recorder/rest.py - Recorder runtime → Live hub session: starts sessions
ting_recorder/main.py - Live hub session → Identity manager: gets credentials
ting_recorder/hub.py - Live hub session → SignalR protocol: uses protocol
ting_recorder/hub.py - Live hub session → Ting cloud: streams sensor data
ting_recorder/hub.py - Live hub session → Reading decoder: decodes invocations
ting_recorder/hub.py - Recorder runtime → Reading decoder: handles readings
- Recorder runtime → SQLite store: records readings
ting_recorder/main.py - Recorder runtime → Event inference: runs inference
ting_recorder/main.py - Event inference → SQLite store: reads and writes events
ting_recorder/infer.py - Recorder runtime → Synthetic data: seeds demo data
ting_recorder/main.py - Synthetic data → SQLite store: writes synthetic data
ting_recorder/demo.py - Web UI and API → Request authentication: checks access
ting_recorder/web.py - Web UI and API → SQLite store: reads recorder data
ting_recorder/web.py - Web UI and API → History queries: queries history
ting_recorder/web.py - Web UI and API → Ting REST client: formats Ting state
ting_recorder/web.py - Browser interface → Web UI and API: requests pages and data
- Recorder operator → Web UI and API: views history and status
README.md - Web UI and API → Prometheus metrics: serves metrics
ting_recorder/web.py - Prometheus → Web UI and API: scrapes
README.md - Recorder runtime → MQTT publisher: starts publisher
ting_recorder/main.py - MQTT publisher → MQTT broker: publishes sensor state
README.md