Skip to content

Device identity should be the serial, not the IP — and a path to multiple Wall Connectors #10

Description

@zebraengine

The DB has no device dimension: every table implicitly describes "the one charger" at --host. That assumption deserves to be made explicit and defended, because if a second Tesla device ever answers at the configured address (DHCP reshuffle, multi-WC household, power-sharing group), its telemetry blends silently into the thermal fit, degradation trend, sessions, and lifetime counters — per-install models corrupted with no warning.

Phase 0 — serial pinning (protective, cheap, benefits single-device installs today)

  • On first contact, store the device serial (from /api/1/version) in settings; verify on startup and periodically.
  • On mismatch: raise an alert and stop recording rather than blend histories.
  • Show the device (serial tail or user label) in the UI header and in notifications.
  • --discover (planned) lists all units found, never assumes one.
  • Once identity is serial-based, --host is just transport: on unreachable, discovery can re-find the charger by serial and heal the config.

Phase 1 — multiple WCs via process-per-device

  • One instance per charger: own DB, own port, systemd template unit (wallmonitor@<name>.service).
  • Keeps every model per-install by construction; needs docs + service template, no schema change.
  • Limitation: no cross-device dashboard.

Phase 2 — native multi-device (only if demand appears)

  • devices table keyed by serial; device_id on all sample tables; per-device pollers and calibrations; UI device switcher; migration backfills existing DBs as device 1.

Open question: power-sharing groups — per-unit vitals are fine, but automatic amp control against a group leader/followers needs design before anyone automates it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions