feat: Advisor 'Current Decision' sensor + dashboard banner (v1.14.0) - #17
Merged
Conversation
Decision transparency ported from HELIOS, rebuilt for AURUM's per-device model. sensor.aurum_current_decision (ENUM, translation_key, EN/DE) answers "what is AURUM doing right now, and why"; attributes carry a structured per-device reason list for dashboards. The sidebar panel renders a decision banner (headline via hass.formatEntityState) and translated per-device reason lines. - AdvisorManager: pure function of shared state, invoked from the update loop's finally block (single exit, covers startup grace) - No fast-changing numbers in attributes (no watts/timestamps) so idle periods generate no recorder writes - devices.py publishes authoritative off-reasons (disabled, condition_met); scheduling reasons are shared SCHED_REASON_* constants in const.py so producer and consumers can't drift - current_decision added to reserved device-name slugs - 17 unit tests; full suite green (189) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QLgEATa2NRuvft5vU4D5N3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Decision transparency for AURUM — a single sensor that answers "what is AURUM doing right now, and why?" Ported conceptually from the HELIOS parent project, rebuilt from scratch for AURUM's per-device model.
New:
sensor.aurum_current_decisiontranslation_key:running_solar,running_cheap_grid,running,waiting,battery_charging,startup,idlereasoncode each (solar_surplus,solar_pv,cheap_grid,manual_override,forced_deadline,runtime_done,program_done,program_paused,program_standby,battery_charging,below_soc_threshold,condition_not_met,disabled,waiting_surplus)New: Dashboard panel banner
☀️ Running on solar surplus · 2/3 active · ⚡ 1240 W · 💶 18.4 ct/kWhhass.formatEntityState()→ every HA language, EN/DE fallback for older frontendsscheduling_reasoncodesDesign guarantees
finallyblock (single exit — no future early-return can forget it, startup grace included)SCHED_REASON_*constants inconst.py;devices.pypublishes authoritative off-reasons (disabled,condition_met) so consumers don't re-derive control logiccurrent_decisionadded to reserved device-name slugsReview
8-angle multi-agent code review before commit caught and fixed pre-merge: a 100× price display bug (ct vs EUR unit), the default
surplus_availablereason not mapping torunning_solar(flagship case), attribute churn defeating the recorder design, an idle-flash on restart, and misleading off-reasons for disabled/condition-gated/SD-standby devices.Testing
node --checkon the panel JS🤖 Generated with Claude Code
https://claude.ai/code/session_01QLgEATa2NRuvft5vU4D5N3