Skip to content

Wave 9 #114: Power mock-kill — strip rc_mock_power fallback (YAML-only slice) - #95

Open
bernardc6 wants to merge 1 commit into
mainfrom
subagent/power-mock-kill-yaml-only
Open

Wave 9 #114: Power mock-kill — strip rc_mock_power fallback (YAML-only slice)#95
bernardc6 wants to merge 1 commit into
mainfrom
subagent/power-mock-kill-yaml-only

Conversation

@bernardc6

Copy link
Copy Markdown
Collaborator

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:

  • 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.
    • 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).

…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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants