Releases: poolski/homeassistant-outlier-cleaner
Release list
v0.1.19
v0.1.18 — Fix chart rendering
Bug fix
Fixes the before/after chart not rendering after a scan (blank space where the chart should appear).
Root cause: ha-chart-base needs to be connected to the DOM and have hass set before it can initialise its internal Chart.js instance. The previous release set chart data before appending the element and omitted hass.
Fix: Append the element to DOM first, then pass hass, then set chart data.
Note
I used Claude Code for some of these changes
v0.1.17 — Before/After Chart Preview
What's new
Before/after chart preview
After a scan, a line chart now appears above the outlier table showing the full time series:
- Dashed red line — current data (with spikes)
- Solid green line — simulated result after applying the fix
- Red dots on the before line mark flagged rows (filled = selected, hollow = unselected)
The green line updates live as you toggle checkboxes or change the replacement value. After applying a fix, the chart re-fetches from the database and re-renders to confirm the correction.
The chart uses ha-chart-base (HA's built-in Chart.js wrapper) and degrades gracefully if unavailable on older HA versions.
Note
I used Claude Code for some of these changes
v0.1.16
Fix
Sidebar disappears on mobile after navigating to the panel
Two root causes:
-
**
:hosthad noheight/overflowdeclaration — the panel content expanded the outer page height instead of scrolling within its own area. On mobile this caused the page to scroll, pushing HA's topbar (containing the hamburger/sidebar button) off screen. -
documentclick listener was never removed — the handler added to close the autocomplete dropdown was attached todocumenton each navigation but never cleaned up. It now uses a bound method removed viadisconnectedCallback.
v0.1.15
Fix
Restart spike after applying a fix — the previous release changed the state column on the spike row in statistics_short_term, which caused Home Assistant's recorder to miscompute the cumulative sum on restart (_sum += new_state - old_state). This produced a new spike every time HA restarted.
The fix: only cascade the sum column forward. The state column reflects the actual meter reading and must never be modified.
v0.1.14
What's Changed
UI/UX improvements
- Segmented method selector — replaced the dropdown with a 3-button control (MAD / Absolute / Top N)
- Confirmed selection state — selecting a sensor now shows a chip with its friendly name and entity ID, with a "✕ Change" button
- Scan result summary — 3-tile stats row (rows scanned / flagged / method) with statistical detail in a collapsible section
- Apply fix intent summary — pre-flight summary box showing exactly what will happen; dynamic "Apply to N rows" / "Preview N rows" button; clearer label "Replace each reading with"
- Fix history — removed Fix ID column; sensor cell now shows friendly name + entity ID
- No-outliers banner — themed success banner instead of a plain text message
- HA theme compatibility — all hardcoded colours replaced with
--success-color,--error-color,--warning-colorandrgba(var(--rgb-*-color))backgrounds
Backend
list_sum_statisticsnow enriches results withfriendly_namefromhass.stateswhen the recorder metadata has no name, enabling human-readable sensor search in the panel
v0.1.13
Bug fix
Fix lookback_days rejected by WebSocket API (ws_fetch_outliers)
The fetch_outliers WebSocket command was rejecting any message that included a lookback_days field with:
extra keys not allowed @ data['lookback_days']. Got <value>
The underlying scan_outliers() function already supported lookback_days (converting it to a start_ts cutoff), but the voluptuous schema on the WebSocket handler did not declare the field. HA's @websocket_command decorator validates with PREVENT_EXTRA, so the field was rejected before the handler ran.
lookback_days is now accepted as an optional integer (≥ 0, default 0) and passed through to scan_outliers(), consistent with the existing service call interface.
Note
I used Claude Code for some of these changes
v0.1.12
Bug fixes
MAD floor regression — The relative floor abs(median) * 1e-6 introduced in v0.1.10 caused genuine outliers to be silently skipped on sensors with large change values (e.g. median ≈ 1000 units/h, MAD = 0.0007, floor = 0.001 → spike hidden). Reverted to an absolute floor of 1e-9, which filters only floating-point noise without suppressing real variation.
nonzero_peers len-1 blindspot — When a spike was the sole non-zero reading in its time-of-day peer group, nonzero_peers had length 1 (truthy but insufficient), causing the candidate to be skipped via the len < 2 guard. Now requires len >= 2 before preferring the non-zero subset.
Date range TO field ignored — The TO date field was captured in the UI but never sent to the backend. The scan always ran to utcnow(). The FROM date was converted to an approximate lookback_days integer that drifted by up to 24 h per re-run. Both fields now send precise Unix timestamps (start_ts / end_ts); the WebSocket schema is updated accordingly.
Dead constant — Removed unused _5MIN_MS = 300_000.
Tests — Added two new regression tests and fixed a misleading comment.
v0.1.11
v0.1.10
Bug fix
MAD false positives from floating-point noise — HA computes change as sum[i] - sum[i-1]. For sensors with large accumulated sums (e.g. a solar meter at 10 000+ kWh), floating-point error is ~1e-12. When peer changes at a given time-of-day are nearly identical (consistent sunny noon slot), the peer group MAD was ~1e-13 instead of 0. Any legitimate change that differed by even 0.1 kWh would score z ~10¹¹, far above any MAD factor, flagging hundreds of normal values as outliers.
Fix: MAD values below max(1e-9, abs(median) × 1e-6) (1 part-per-million of the median) are now treated as degenerate and skipped. Genuine outliers — where peers show real spread — are unaffected.