Skip to content

docs: clarify watts-only rule for literal power-limit values#3996

Merged
springfall2008 merged 1 commit into
springfall2008:mainfrom
SkiLtY:docs/clarify-watts-literal-rule
Jun 2, 2026
Merged

docs: clarify watts-only rule for literal power-limit values#3996
springfall2008 merged 1 commit into
springfall2008:mainfrom
SkiLtY:docs/clarify-watts-literal-rule

Conversation

@SkiLtY
Copy link
Copy Markdown
Contributor

@SkiLtY SkiLtY commented Jun 2, 2026

Summary

Spawned from discussion #3979 where gcoan asked for a docs note making the literal-vs-entity behaviour explicit. Two surgical edits:

  • docs/apps-yaml.md — NB callout at the top of Inverter control configurations naming every key affected by the literal-vs-entity unit rule, plus a concrete YAML example block under ### **inverter_limit** (for consistency with ### **pv_ac_limit** which already has one).
  • docs/inverter-setup.md — one bullet added to I want to add an unsupported inverter to Predbat, cross-linking to the new callout. Custom-inverter users are the most likely to hit this trap (they hand-write the dict rather than copy a tested template, so don't get a sensor-reference example to follow).

Why

Without the callout, a user reasoning "I have a 7.3 kW inverter, the docs say 'in watts' so 7.3 is wrong, but I'll use what feels natural" could easily land on inverter_limit: 7.3 and silently lose discharge planning. The existing docs say 5000 for a 5 kW inverter but don't explain why the unit handling is asymmetric between literals and sensor references — so the rule is invisible if you don't already understand the auto-conversion machinery.

The callout names the specific failure mode (battery_draw clamp, plan with no discharge) so future searchers hitting the symptom find the docs by Google rather than via a github discussion.

Out of scope (could be a follow-up if useful)

  • Adding a header comment to each vendor template under templates/*.yaml. Most use sensor entities for the relevant keys (so auto-conversion works) and commented-out literal examples are already correct; trap doesn't bite copy-pasters in practice. Happy to PR that separately if you'd like coverage there too.

Test plan

  • Render docs/apps-yaml.md and docs/inverter-setup.md via mkdocs locally or on the docs site after merge — confirm the new callout + YAML block render cleanly and the cross-link from inverter-setup.md resolves.

Literal numeric values for inverter_limit / export_limit / battery_rate_max
etc. bypass Predbat's required_unit auto-conversion (which only fires when
the value is a sensor reference, reading unit_of_measurement from the HA
entity). A literal `inverter_limit: 7.3` is therefore taken as 7.3 watts,
not 7.3 kW — clamps battery_draw to ~0.0006 kWh per 5-min step and
produces a plan that looks like Predbat refuses to discharge.

Adds an NB callout at the top of "Inverter control configurations"
naming every affected key, plus a concrete YAML example under
inverter_limit (for consistency with pv_ac_limit which already has one).
Cross-referenced from the "unsupported inverter" guide where custom-
inverter users — most likely to use literals because no sensor exists
for their inverter limit — actually land.

Related: springfall2008#3979
@springfall2008 springfall2008 merged commit 621385d into springfall2008:main Jun 2, 2026
1 check passed
@SkiLtY SkiLtY deleted the docs/clarify-watts-literal-rule branch June 2, 2026 21:45
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