Wave 9 #114: Power mock-kill — strip rc_mock_power fallback (YAML-only slice) - #95
Open
bernardc6 wants to merge 1 commit into
Open
Wave 9 #114: Power mock-kill — strip rc_mock_power fallback (YAML-only slice)#95bernardc6 wants to merge 1 commit into
bernardc6 wants to merge 1 commit into
Conversation
…power_no_real_source banner
Context: Bernard priority 1 (chat #7562-7580) — 'power to be foolproof and
work reliably'. The existing power tile Jinja chains silently fell back to
input_number.rc_mock_power_* when no real sensor was present, which violates
Directive Rule 4 ('Don't mark successful if automated action can't be
verified') and Rule 8 ('No cloud/VPN/AI may be required for local van
operation' — mocks are an opaque lie). On a broken install the user saw a
plausible-looking tile that wasn't real.
Changes:
- homeassistant/packages/roamcore_power.yaml:
- Removed every input_number.rc_mock_power_* fallback from the 5 RC Power
tiles (battery_soc, solar_power, load_power, ac_in_power, ac_out_power)
and from all derived power sensors (battery_voltage, battery_current,
battery_power, battery_temperature, battery_state, battery_capacity,
battery_cycle_count, battery_health, solar_energy_today, solar_energy_total,
solar_panel_voltage, solar_panel_current, solar_efficiency, load_*,
inverter_output_*, shore_*, alt_*, inverter_status, shore_connected).
- Kept the sensor.vt_* → sensor.victron_* legacy fallback (some users still
have legacy Victron integrations).
- When both are unavailable/unknown → the tile surfaces as 'unavailable'.
- Added new binary_sensor.rc_power_no_real_source that aggregates the
unavailability of the 5 canonical vt_* sensors (any unavailable → on).
The RoamCore dashboard card will read this and show
'Power not connected — go to Setup' instead of a fake value.
- scripts/checks/power-no-mocks.sh (new): grep-fails on any rc_mock_power
reference in homeassistant/packages/roamcore_power.yaml.
- scripts/check.sh: +1 line wiring power-no-mocks.sh into the smoke chain.
Verification:
- python yaml.safe_load on the rewritten file → parses cleanly.
- python jinja2 Template parse on the rewritten file → parses cleanly.
- grep -c 'rc_mock_power' homeassistant/packages/roamcore_power.yaml → 0.
- bash scripts/check.sh --core-only → GREEN (exit 0; new smoke check passes).
- All 5 RC Power tiles still have their original unique_id (rc_power_*).
Rollback: revert this PR; the mock fallback returns and the tile will show
a plausible-but-fake value again (the previous behaviour Bernard flagged).
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.
Context: Bernard priority 1 (chat #7562-7580) — 'power to be foolproof and work reliably'. The existing power tile Jinja chains silently fell back to input_number.rc_mock_power_* when no real sensor was present, which violates Directive Rule 4 ('Don't mark successful if automated action can't be verified') and Rule 8 ('No cloud/VPN/AI may be required for local van operation' — mocks are an opaque lie). On a broken install the user saw a plausible-looking tile that wasn't real.
Note: A previous branch (subagent/power-mock-kill, commit 0cc8c10) was pushed with a larger scope (also added rc_power_offline_checking, rc_power_source_status, dashboard YAML wiring, and a pytest rig). This slice is intentionally narrower per the spec — YAML rewrite + 1 smoke script + 1 line in check.sh. The dashboard-side wiring is deferred to a follow-up slice; this one only exposes the binary_sensor.rc_power_no_real_source entity the dashboard will consume.
Changes:
Verification:
Rollback: revert this PR; the mock fallback returns and the tile will show a plausible-but-fake value again (the previous behaviour Bernard flagged).