- Detect fresh install vs update via systemctl is-enabled
- On update: pip install --upgrade picks up new dependency versions
- If service was active before running the script, restart it automatically
- Summary message adapts to install vs update context
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Change --diff from store_true to default=None so CLI presence is
distinguishable from the JSON default. If not given on CLI, reads
creds_data.get("diff", False). Updated install.sh template and README.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Switch from flat username/password keys to nested credentials block
and add interval_s, host, port, log_dir with their defaults.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- CLI table now shows which credentials file key each flag overrides
- Added --diff, --dry, --log-dir, -i/--interval, --host, --port
- New "Diff mode" subsection under Push server protocol
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-i/--interval, --host, --port, --log-dir can now be passed on the
command line; each overrides the corresponding credentials file value
when given. Defaults remain unchanged (300 s, 0.0.0.0, 9999, ./logs).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jay_merge_full/jay_merge_update mutates _state nested dicts in place.
The previously emitted dict(_state) was a shallow copy sharing those
nested dicts, so background-thread merges retroactively corrupted
already-emitted snapshots: timestamps were correct (strings are
immutable) but Y values all converged to the latest record's values.
Fix: emit copy.deepcopy(_state) so each snapshot is fully independent.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Server (collect.py --diff):
- History burst: first record sent full, subsequent as jay_diff_full diffs
- Live broadcast: each snapshot diffed against the previous one
- Diff payloads tagged with "_diff": true
Client (client.py --diff):
- Reconstructs full state via jay_merge_full before printing
GUI (Connector tab "Diff mode" checkbox):
- TcpReader.connect_to() accepts diff_mode; maintains _state dict
- Merges incoming diffs before emitting to Dashboard/Plot
- Checkbox state persisted to plot_settings.json
Both sides default to off; must be enabled consistently on server and client.
utils/__init__.py added so utils.jay_diff is importable as a package.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace direct _redraw() calls in PlotTab.update() with a 100 ms
single-shot QTimer. During a burst of incoming records (e.g. 500
history records on connect) only the data is accumulated; a single
redraw fires 100 ms after the last record arrives instead of once
per record (~4000 pyqtgraph redraws avoided).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When --dry is set, WeConnect login and data collection are skipped.
The push server still starts and serves preloaded 24 h history to
connecting clients — useful for GUI testing without a live vehicle.
Credentials are not required in dry-run mode.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Credentials file is now the single source for vin, interval_s, host,
port, log_dir; document new format with nested credentials block
- CLI reference trimmed to the remaining flags only
- Push server section: 24 h rolling window instead of same-day history
- GUI section: connection persistence, clear-on-reconnect, per-plot time
window spinner, x-axis fit when data < window size
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove --vin, --interval/-i, --output/-o, --host, --port from argparse.
All are now read from the credentials JSON (interval_s, host, port,
log_dir with sensible defaults). CLI flags -u/-p/-d still override the
file; log_dir replaces the old --output/auto-logs logic — logs_dir is
always used, no fixed output path option.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add PlotTab.clear_data() which resets _series and _units, then redraws.
Called in MainWindow._connect() before opening the socket so stale data
from a previous session never mingles with fresh history from the server.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Track the earliest timestamp across plotted traces (starting from None,
not cutoff) so setXRange uses the first real data point as the left
bound — no empty gap when data doesn't fill the full time window.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace load_today_records with load_last_24h_records which computes a
rolling 24 h cutoff, globs log files for both the current and previous
calendar day, and filters records by timestamp — so clients always
receive a full 24 h window regardless of when midnight falls.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Save host/port to plot_settings.json on connect; restore on startup
- Raise MAX_PLOT_POINTS from 200 to 2880 so 24 h of data is retained
even at 30 s polling intervals
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the single global toolbar spinbox with one QSpinBox per plot,
placed between the '+' button and the trace chips. Each plot has an
independent 1–24 h window; values are persisted in plot_settings.json
under 'time_windows'.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
A spinbox above the plot grid sets the visible x range for all 8 plots.
Data outside the window is excluded from each redraw; x axis is fixed to
[now - window, now]. Setting is persisted in plot_settings.json.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Creates .venv/ with python3 -m venv if not present, then installs/
updates requirements.txt into it before setting up the systemd service.
The service ExecStart always uses the venv Python.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Creates ~/.config/we_monitor/credentials.json template (mode 600),
writes ~/.config/systemd/user/we_monitor.service using the project
venv Python, enables linger for boot-time start, and enables the
service. Does not start until credentials are edited.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
README covers installation, collector CLI reference, push server protocol,
GUI client usage, and output format. conversation_recap documents the full
development history: features, bugs fixed, and design decisions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Color palette taken directly from nmea_client/gui/plot_widget.py:
- Background #1a1a2e / #12121e, borders #2a2a4a/#3a3a5e,
text #aaaacc/#ddddee, connected #4CAF50, error #F44336
- Trace colors: Material palette (blue, red, green, orange, …)
- Plot widget background overridden from "white" to #12121e
- pyqtgraph foreground set to #aaaacc
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Trace selection combos show short labels (_trace_label) with full key
stored as item data; width auto-adjusts to content (min 120 px)
- Extended plot grid from 4 to 8 (4×2) wrapped in QScrollArea
- Removed reset-zoom toolbar and cursor readout area
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
InfiniteLine was included in auto-range calculations, causing the view
to rescale on every cursor move. Add it with ignoreBounds=True in both
the initial setup and after each redraw.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace static combo grid with a control bar above each plot:
add-trace dropdown + "+" button; active traces shown as colored chips with
"×" to remove (max 4 per plot)
- Save trace selection to ~/.config/we_monitor/plot_settings.json on every
change; restore automatically once matching signals arrive from the server
- Remove tiny tick-font overrides so axis labels are readable at default size
- Show received record count in the status bar
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously load_today() was only called if in-memory records were empty,
which was never true once the first WeConnect poll had completed.
Now disk records are loaded unconditionally at startup and merged with
live in-memory records (dedup by ts) when a client connects.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
storage_helpers: load_today_records() scans logs/ for all files
matching today's UTC date and VIN, merges and sorts their records.
network: _accept_loop receives an optional load_today callable;
if store_ref["current"] has no records it calls load_today() to
replay the day's history from disk before adding the client.
collect: passes a load_today lambda (None when -o is used).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removed the QScrollArea wrapper and fixed figure-height calculation.
FigureCanvasQTAgg now fills the tab with an Expanding size policy so
all 8 subplots fit in the visible area at 1920x1200 without scrolling.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
create_connection(timeout=5) left a 5-second read timeout on the
socket. Any collection interval longer than 5 s caused recv() to
raise socket.timeout, which was caught as OSError and reported as
a lost connection. Switch to blocking mode with settimeout(None)
immediately after the connect handshake.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
data_model, log_config, network, storage_helpers, we_connect are now
under server/. collect.py stays in the project root and imports via
the server package.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Connector tab: host/port fields, connect/disconnect button, status
- Dashboard tab: live QTreeWidget of the full snapshot hierarchy;
physical values show value and unit in separate columns;
expand state preserved across refreshes
- Plot tab: matplotlib time-series subplots (2 columns) for every
physical {value, unit} field, scrollable, auto-layout on new keys
- TcpReader runs in a daemon thread and delivers messages via
Qt signals so the UI never blocks
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The server keeps the most recent snapshot in memory (under the same
lock as the client list). When a client connects it receives that
snapshot right away, then continues to receive live updates on each
collection cycle.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
auto_out_path, load_store, save_store moved out of data_model.py into
their own module. data_model.py now contains only value helpers and
domain extractors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
we_connect.py now only handles WeConnect login and vehicle selection.
All extract_*() functions, ALL_DOMAINS, and collect_snapshot() live
in data_model.py alongside the store and value helpers.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Connects to collect.py's push server and prints each incoming
snapshot as pretty-printed JSON, separated by a dashed line.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each connected TCP client receives every snapshot as a newline-
delimited JSON line the moment it is collected (no polling needed).
The server binds on --host/--port (default 0.0.0.0:9999).
Client connections are accepted in a daemon thread; dead connections
are pruned on the next broadcast.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When -o is not set, the collector detects a UTC date change at the
top of each collection cycle and opens a fresh timestamped file under
logs/. Explicit -o paths are never rotated.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When -o is omitted, the output file is auto-named from the run's
start timestamp and the vehicle VIN and placed under ./logs/,
which is created on demand. logs/ is gitignored.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All fields with a physical unit are now emitted as
{"value": <number>, "unit": "<unit>"} instead of encoding the unit
in the field name. Field names are renamed accordingly (e.g.
chargePower_kW → chargePower). Battery temperature field names are
also fixed to reflect the already-applied K→°C conversion.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>