GrumpyTanker/fluke-3540-analyzer

GitHub: GrumpyTanker/fluke-3540-analyzer

Stars: 0 | Forks: 0

# fluke-3540-analyzer **Open-source parser, event detector, and chart generator for Fluke 3540 FC three-phase power-quality logger sessions.** Works on Windows, Linux, and macOS. Runs in your browser — no upload, no install. 🌐 **Live web app:** [grumpytanker.github.io/fluke-3540-analyzer](https://grumpytanker.github.io/fluke-3540-analyzer/) ## Why this exists The Fluke 3540 FC is a great little three-phase power logger, but the only official way to read its session files (`.fel` archives, containing `trend.bin`) is **Fluke Energy Analyze Plus** — Windows-only, closed-source, and limited in what you can export. There is no Linux/macOS client, no CLI for batch analysis, and no good way to script reports across many sessions. This project gives you: - **A documented binary format** for the 3540 FC's `trend.bin` file — see [`docs/FILE_FORMAT.md`](docs/FILE_FORMAT.md) - **A web app** that runs in your browser. Drag and drop a `trend.bin`, get charts, pick events, export CSV / XLSX / PNG. Nothing is uploaded — all parsing happens client-side in JavaScript. - **A Python CLI** for scripting, batch jobs, and publication-quality gnuplot output. `pip install -e .` and you're going. - **Auto event detection** — outages, voltage dips, swells, high-current peaks, frequency excursions, NEMA imbalance spikes, sudden load steps. - **CT reversal correction** — `--reverse-cts` flag handles iFlex probes installed backwards (extremely common mistake). See [`docs/CT_REVERSAL.md`](docs/CT_REVERSAL.md). ## Web app — no install Visit **[grumpytanker.github.io/fluke-3540-analyzer](https://grumpytanker.github.io/fluke-3540-analyzer/)** and drop your `trend.bin` (or the whole unpacked `ES.NNN/` session folder, so the asset name from `ES.NNN-config.json` is picked up too) onto the page. The browser parses the file locally in a Web Worker, runs event detection + insights analysis, and shows: - A summary panel (records, time range, asset) - An **Insights** section with severity-colored cards explaining what was found and what to do about it (see [`docs/INSIGHTS.md`](docs/INSIGHTS.md)) - An events table with severity, affected phases, search/filter, sortable columns, and one-click zoom - A snapshots list of quiet baseline windows - A **range select** mini-map — brush-drag to scope every chart and export to a time window - Charts with anomaly bands, drag-to-box-zoom, wheel zoom, Shift-drag pan - A chart picker (voltage / current / power / PF / frequency / THD) - Per-chart download to PNG or CSV - Full workbook (XLSX), self-contained HTML report, **PDF report**, and "Download everything (.zip)" bundle - IndexedDB caching: drop the same file twice → second time skips the parse - Keyboard shortcuts (press `?` to see them) and a dark mode toggle in the footer **No data ever leaves your machine.** Verify yourself in DevTools → Network: zero outbound requests after page load. The Insights engine is local + rule-based — no cloud LLM, no API key. ## Python CLI — for scripting + publication charts # From PyPI (v0.2.0+) pip install fluke-3540-analyzer # Or from source for development git clone https://github.com/GrumpyTanker/fluke-3540-analyzer cd fluke-3540-analyzer pip install -e "python/[dev]" You'll need [gnuplot](http://www.gnuplot.info/) for chart rendering (`apt install gnuplot` / `brew install gnuplot` / `choco install gnuplot`). The CLI auto-discovers it via `$GNUPLOT`, then `$PATH`, then `C:\Program Files\gnuplot\bin\gnuplot.exe`. # auto: parse + detect + render everything fluke-analyze path/to/ES.NNN -o output/ --reverse-cts # interactive: walk through event picker fluke-analyze path/to/ES.NNN -o output/ --interactive # parse only — write CSV + events.json + summary.txt, no charts fluke-analyze path/to/ES.NNN -o output/ --parse-only # plot only — reuse existing CSV + events.json, just (re-)render charts fluke-analyze path/to/ES.NNN -o output/ --plot-only --plot voltage,current # time-window slice + chart subset fluke-analyze path/to/ES.NNN -o output/ \ --from "2024-01-13T22:50:00" --to "2024-01-13T22:55:00" \ --events 0,3,5 --plot power,current --pre 60 --post 120 ### CLI flag reference | Flag | Default | What | |---|---|---| | `SESSION_DIR` | required | Path to an `ES.NNN/` session directory | | `-o`, `--output` | `_out/` | Output directory | | `--auto` | (default) | Parse + detect + render everything | | `--interactive` | | Prompt for which events / quantities to render | | `--parse-only` | | Just write CSV + events.json + summary.txt | | `--plot-only` | | Reuse existing CSV/events.json, render charts only | | `--from ISO_TIME` | | Restrict event scan & zooms to ≥ this time | | `--to ISO_TIME` | | Restrict event scan & zooms to ≤ this time | | `--pre SECS` | `30` | Pre-event zoom padding | | `--post SECS` | `60` | Post-event zoom padding | | `--events IDS` | all | Comma-separated event IDs to render | | `--plot QTYS` | `voltage,current,power,thd,pf,frequency` | Quantities to chart | | `--snapshots N` | `3` | Number of quiet snapshots to pick | | `--reverse-cts [PHASES]` | off | Negate P/Q/PF/DPF/Wh/VARh. Bare flag = all phases; pass `a` or `a,c` for selected phases (totals follow). See `docs/CT_REVERSAL.md` | | `--every K` | `1` | Emit every K-th record into the CSV | | `--max-csv-rows N` | off | Cap the full CSV at ~N rows for week-long sessions; stride is auto-raised and the downsampling is logged. 1-min CSV + analysis keep full resolution. | | `--anchor-start ISO_TIME` | off | Pin the real wall-clock **start** to correct a wrong meter RTC (shifts every timestamp). Mutually exclusive with `--anchor-end`. | | `--anchor-end ISO_TIME` | off | Pin the real wall-clock **end** (e.g. a known shutdown time). | | `--split-by PERIOD` | off | Partition into time buckets (`hour`\|`day`\|`week` or a duration like `30m`/`6h`/`2d`). Emits a full per-bucket report (`