Skip to content

Money icons in HA entities, Indevolt plug-in, correct FAQ recorder config, doc updates - #5683

Open
gcoan wants to merge 31 commits into
springfall2008:mainfrom
gcoan:main
Open

gcoan wants to merge 31 commits into
springfall2008:mainfrom
gcoan:main

Conversation

@gcoan

@gcoan gcoan commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

New feature:

  • Icons for 'money' control entities and output entities now have the correct icon based upon currency_symbols defined in apps, yaml

NB: Icons for entities created by the Kraken and Octopus components remain hard-coded to currency-gbp and are not been auto-generated as these components are only used by UK customers so the extra complexity of passing the icon through to the components wasn't felt justified nor needed.

Fix:

  • Correct FAQ recorder exclude rules
  • Correct broken moderate marginal rate icon

New inverter type:

Documentation changes:

@github-actions github-actions Bot added the BOT_REVIEW Trigger an autotriage label Oct 21, 2026
@gcoan
gcoan requested a review from springfall2008 October 21, 2026 21:32

@springfall2008 springfall2008 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated comment from the triage bot.

Review of head d6fcc8de: 6 findings posted inline, 1 in the body. The icon plumbing itself is clean — apply_currency_icon operates on a fresh copy.deepcopy of CONFIG_ITEMS in reset() so re-runs re-seed correctly, all 22 remaining mdi:currency-usd items carry p/p/kWh units and are swept, and the two re-iconed non-currency items (kWh/minutes) were the only such borrowers. Verified against gh pr diff and the checked-out head.

Body finding — docs/compare.md:151 contradicts the FAQ change

The FAQ now warns: "Do not be tempted to use an 'entity_globs' configuration on the include list as this will flip the whole config into allowlist mode" — and correspondingly replaces include.entity_globs: predbat.compare_tariff_* with individual entity IDs (predbat.compare_tariff_current, <name1>, <name2>). But docs/compare.md line 151 still tells users to do exactly that: "If you have added a recorder: filter that excludes the predbat domain, include them again with an entity_globs entry of predbat.compare_tariff_*". A user following compare.md sets up the very allowlist flip the FAQ warns about — that's the #5507 failure mode. compare.md isn't touched by this PR, so it couldn't be anchored inline: one line there updating the include advice to enumerated entity IDs and pointing at the FAQ example would remove the contradiction.

Body note — issue reference

The PR body cites "#4945 Add Indevolt plug-in battery configuration" twice, but there is no issue or PR #4945 in springfall2008/batpred (verified with gh issue view 4945 and a search). If the reference points at a discussion or an issue in another repo, worth fixing the link.

Comment thread apps/predbat/octopus.py Resolved
Comment thread docs/inverter-setup.md Resolved
Comment thread apps/predbat/predheat.py Resolved
Comment thread docs/inverter-setup.md Resolved
Comment thread docs/predbat-plan-card.md Resolved
@springfall2008 springfall2008 removed the BOT_REVIEW Trigger an autotriage label Oct 21, 2026
@gcoan

gcoan commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

? Body finding — docs/compare.md:151 contradicts the FAQ change

Good spot by the bot, corrected now

? Body note — issue reference

4945 referenced from the PR is a 'show and tell' discussion item, not a GitHub issue, so reference is correct

@gcoan
gcoan requested a review from springfall2008 October 21, 2026 22:33
@gcoan gcoan mentioned this pull request Oct 22, 2026
@gcoan gcoan added the BOT_REVIEW Trigger an autotriage label Oct 27, 2026

@springfall2008 springfall2008 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated comment from the triage bot.

Reviewed at head bbc435b (currency icons, Indevolt template, FAQ recorder rules, doc sweep): no correctness bugs found; 3 low findings posted inline (icon-table data, template comment accuracy, FAQ precision).

What I verified as sound: apply_currency_icon() mutates the per-instance deepcopy of CONFIG_ITEMS (predbat.py:338/349) and runs in reset() before config_index is rebuilt and entities are exposed, so module-level CONFIG_ITEMS stays pristine and each instance gets its own icons; all 14 remaining mdi:currency-usd placeholders sit on p/p/kWh items and no mdi:currency-usd literals remain anywhere outside config.py; the two re-iconed items (mdi:flash, mdi:timer-outline) match their kWh/minutes units; Octopus saving-session icons are now consistently hard-coded gbp, matching the updated test_saving_session.py expectation, and predheat's self.base is long-established; inverter_type: 'Indevolt' builds a valid custom INVERTER_DEF from the GE copy (inverter.py:544-556), the template's bare-dict service blocks are supported (call_service_template wraps a dict in a list), {target_soc}/{power} resolve from adjust_charge_immediate()'s data via resolve_arg(extra_args), and the select_option stop path is a real service; the FAQ's fixed example matches Home Assistant's recorder filter semantics (verified against homeassistant/helpers/entityfilter.py — include.entities rescues domain-level excludes and does not flip the config into default-deny), with compare.md updated to the same recipe; all 5 new tests are registered in TEST_REGISTRY; the pence→currency-minor-unit docs sweep misses only the literal setting name axle_pence_per_kwh; the golden replay cases' .expected.json files pin no icons.

Comment thread apps/predbat/config.py Resolved
Comment thread templates/indevolt.yaml Resolved
Comment thread docs/faq.md Resolved
@springfall2008 springfall2008 removed the BOT_REVIEW Trigger an autotriage label Oct 27, 2026
@gcoan gcoan added the BOT_REVIEW Trigger an autotriage label Oct 27, 2026

@springfall2008 springfall2008 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated comment from the triage bot.

Re-review at head e5121fff ("update for BOT review comments"): no new findings — 0 inline, 0 in the body. All three items from the 27 Oct automated review are fixed, and I re-verified each fix against its source rather than taking the diff at face value:

  • apps/predbat/config.py: mdi:currency-vnd (₫) and mdi:currency-chf (CHF) are removed; I fetched all 14 remaining names against the upstream MaterialDesign-SVG repo and every one resolves, so the shipped table contains only real MDI icons. Symbols with no MDI icon (₫, CHF, the kr currencies) now fall through currency_icon() to the mdi:cash default, which the table comment already prescribes.
  • docs/faq.md: the recorder bullet now names domain as well as entity_globs. Re-checked against the current homeassistant/helpers/entityfilter.py: have_include = bool(include_e or include_d or include_eg), and once include_d/include_eg are non-empty the filter takes Case 4 (entity_filter_4a), whose fall-through is "Otherwise: exclude" — default-deny. The FAQ recipe's plain-entity include stays in Case 5, where include.entities overrides domain/glob excludes without flipping the mode. The new wording is correct.
  • templates/indevolt.yaml: the CRITICAL has_time_window block is gone; the setting itself remains, which is harmless.

I also re-checked the resolutions of the earlier review round are present at this head: all five test_currency_icon tests registered in unit_test.py (lines 288–293, 735–740), the Predheat: Todays energy {} kWh, cost {} {} log line in predheat.py:542, the de-duplicated indevolt integration link at docs/inverter-setup.md:53, the "zero or negative" rewording at docs/predbat-plan-card.md:80, and the Indevolt sensor renames in docs/inverter-setup.md — "Indevolt SoC kWh" and "Indevolt Grid Power (inverted)" now slugify to exactly sensor.indevolt_soc_kwh / sensor.indevolt_grid_power_inverted, the IDs templates/indevolt.yaml references (verified against HA's slugify, which delegates to python-slugify).

The GBP hardcodes in the Octopus/Kraken components remain as the author explained in the review thread (UK-only components), which is a reasonable documented trade-off.

@springfall2008 springfall2008 removed the BOT_REVIEW Trigger an autotriage label Oct 27, 2026
	modified:   docs/inverter-setup.md
	modified:   templates/solax_sx4.yaml
Comment thread docs/inverter-setup.md Resolved
	modified:   apps/predbat/tests/test_docs_solax_mode8.py
	modified:   docs/inverter-setup.md
	modified:   templates/solax_sx4.yaml

This branch has not been deployed

No deployments
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.

3 participants