Skip to content

v1.0.1

Choose a tag to compare

@nicois nicois released this 15 Apr 00:27
3078694

Added

  • WebSocket real-time data: optional ~5-second power data from the FoxESS Cloud WebSocket during smart sessions, reducing grid import risk from load spikes between 5-minute REST polls. Requires web portal credentials (optional config flow step). Connects automatically during paced discharge; ws_all_sessions toggle extends to all sessions.
  • Data source indicator on Lovelace cards: badge shows "WS", "API", or "Modbus" when multiple data sources are configured, so users know which source is driving displayed values. Immediately switches on WS connect/disconnect.
  • Deferred self-use for smart discharge: stays in self-use mode until a deadline calculation requires forced discharge, preventing grid import from low paced power
  • Peak consumption tracking: exponential decay (~4.3 min half-life at 1-min ticks), floors discharge power at peak × 1.5 to absorb inter-poll load spikes
  • End-of-discharge guard: suspends forced discharge ~10 min before window end when paced power would drop below house load
  • Discharge SoC unavailability abort: discharge sessions now abort after 3 consecutive SoC-unavailable checks, matching charge path behaviour
  • Safe state on failure: listener callbacks catch unexpected exceptions, cancel the session, and revert to self-use
  • Unreachable charge target detection: charge_target_reachable sensor attribute warns when even max power can't reach the target SoC in remaining time
  • Proactive error surfacing: session errors surfaced via sensor attributes (has_error, last_error, last_error_at, error_count) instead of log-only
  • Reconfigure flow: add or update web portal credentials without re-creating the config entry. Accepts both raw password and pre-computed MD5 hash.
  • Feed-in energy integration from WebSocket: trapezoidal integration between REST polls for more accurate cumulative energy tracking
  • Feed-in early-stop: schedules a one-shot stop based on observed export rate to prevent overshooting the feed-in energy limit

Changed

  • Session orchestration via adapter pattern: __init__.py reduced from 3056 to ~2030 lines (-34%). FoxESS-specific schedule merging encapsulated in FoxESSCloudAdapter and FoxESSEntityAdapter, delegating to brand-agnostic smart_battery/listeners.py.
  • WebSocket per-field unit handling: respects the unit property on each power field (some sent as kW, others as W within the same message) instead of assuming uniform units
  • REST fallback on poll failure: coordinator keeps last-known data when REST fails, preventing all entities flashing unavailable

Fixed

  • Taper-path consumption bypass: deferred start taper paths now account for household consumption, matching the linear path
  • WebSocket stale data filter: messages with timeDiff > 30 seconds are discarded
  • WebSocket grid direction: power-balance-derived direction replaces unreliable gridStatus field
  • Taper profile corruption: minimum actual power guard (50W) and plausibility check auto-reset corrupted profiles
  • Progress bars during inactive phases: hidden during charge "deferred" and discharge "scheduled" phases
  • House load greyed out at low values: overview card always shows actual value at full opacity
  • Reconfigure password whitespace: ensure_password_hash strips trailing newlines from pasted hashes
  • Session recovery start_soc: persisted for accurate progress bars after HA restart