Skip to content

feat(autolearn): check feedback, competition, base load and the battery - #292

Merged
Developer-Simon merged 37 commits into
prereleasefrom
feat/automation-learning-energy-checks
Nov 22, 2026
Merged

Developer-Simon merged 37 commits into
prereleasefrom
feat/automation-learning-energy-checks

Conversation

@Developer-Simon

@Developer-Simon Developer-Simon commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Squash-merge commit message

The rule check now looks at energy: rules that switch their own load off again, rules that compete for the same surplus, a rising base load and a battery that is full too early or empty before morning.

Rule findings: a rule pair whose load flips its own condition gets "switches itself off" with a fix that widens both thresholds at once. Rules that start on the same surplus in the same quarter hour get a staircase of staggered thresholds, applied to all rules in one step. Flapping names feedback as its cause when the changes match the power step of the load. A PV or feed-in threshold that the learned PV curve reaches again later in the year says from which calendar week. Fixes can now change several rules at once, all or none.

Energy findings: the base load detector watches the night load and reports a lasting rise, with the device behind it when one is measured. With the same weeks of earlier years in the season store it needs 14 nights instead of 35. The battery detector reports a battery that is full before the sun is highest and one that is empty before sunrise, compared with the same weeks of the year before. Both battery findings show the charge as Ist and a Soll curve. New learned values: base load, battery full time and night energy, and the template "Night off" switches a device off from the learned night rest to the day start.

Where findings appear: findings with a switchable device stay in the suggestion band with a prefilled template. Findings without a rule to suggest go to the Monitoring page as notices. Every suggestion also appears in Monitoring under its own filter "Suggestions" and opens the expanded suggestion on the Automations page. Day curves draw Ist and Soll in one chart.

Seasonal data: a new switch "Seasonal data for a whole year" under Learning > Recording, on by default, keeps the PV sky raster for a year instead of 45 days. Before, the winter fit saw only low sun and called summer thresholds unreachable with a fix to lower them. While the raster lacks the summer sun the check never says "never triggers" for a PV threshold.

Fixes found while testing: applying one fix in the draft no longer hides all learned findings, the applied one stays hidden until save, and the rule check drops engine findings whose fix is already saved. The assistant now preselects the switch of "Night off" and "Quiet off" suggestions, they only carried the device ID.

Demo: seeds the feedback pair, competing rules, a base load rise, an early full and an empty battery, a year of PV sky, earlier year weeks in the season store, and a feed-in rule that rests until spring. The fake console publishes the automation state at start so never fired findings appear.

Known limits: the demo learns its day bounds as 00:00 to 12:30, so "Night off" with a culprit device is not visible there. The competition scale does not draw its stage marks yet.

Highlights:
- The rule check finds feedback, competition for the surplus, a rising base load and battery problems

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Highlight translations

Highlights (de):
- Die Regelprüfung erkennt Rückkopplung, Konkurrenz, steigende Grundlast und Akkuprobleme

Highlights (en):
- The rule check finds feedback, competition for the surplus, a rising base load and battery problems

Tour

none

Summary

Energy findings for the rule check and learning: feedback, competition, seasonal rest, base load and battery, plus the seasonal data switch and suggestions in Monitoring.

Checks

  • The title is a Conventional Commits subject.
  • scripts/dev/check_tracked_secrets.sh is clean.
  • AI assistance disclosed per AI-DISCLAIMER.md: Claude Opus 5.5
  • Suites run locally: go test ./..., go vet, npm test, demo/fakes pytest, smoke, cache_bust check
  • Linked issue: none

Developer-Simon and others added 30 commits November 22, 2026 13:57
…oise

Fix gets Rules, one RuleOps per rule, so a change over several rules is
applied in the draft as a whole or not at all. QuarterNoise estimates the
reading noise of a quarter hour series. Input gets the learned values by
key, wired through Engine.SetLearned.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A rule that switches a load on above X and off below Xaus on the export
turns itself off again when X - P_Anlauf - noise <= Xaus. The feedback
check runs as a light reliability detector, uses the learned operating
power and the start peak, and proposes new thresholds as one change over
both rules. Observed export steps after switch-ons raise the confidence.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
When the unstable feedback finding of a device names the two rules of a
flapping pair, the flapping finding carries the fact cause=feedback. The
min_runtime fix stays as it is.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rules that switch on from the same balance value and fire in one quarter
hour, with the grid import above the smallest of their loads in the two
quarters after, form a competition. The detector runs daily in the
reliability group and proposes a staircase of thresholds, one step per
load. Loads with a fixed cycle energy come first, then the ones started
by hand most often, then the higher operating power. Steps the surplus
reaches on fewer than 3 of the last 14 days are marked dormant. The fix
changes all competing rules at once and offers an open rule fix on the
first rule.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A PV or grid export threshold that the clear-sky curve reaches later in
the year is now reported as an info finding with the first calendar week
that reaches it. A threshold the curve never reaches stays a warning with
the threshold fix. Without a safe roof model the seasonal maximum is used
as before.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Night load is the 10th percentile between night rest and day start.
A sustained rise above the reference is a baseload finding, with the
device that accounts for at least half of the rise when one is measured.
A fall is no finding. The learned site/base_w is the median of the last
14 nights of today's day type.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The night_off template switches a switch off from the learned night rest
to the learned day start, each bound with an hour of slack. Without both
learned values it uses the fixed window from 23:00 to 06:00. A baseload
finding opens it with its device.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ore morning

The battery detector reads the charge per quarter. A battery full before
solar noon on most days is a finding, and so is one empty before sunrise
when the same weeks of the year before were not empty on most days. The
empty finding offers a night off for the devices that take over half of
the missing night energy, switchable ones only. Without a record of the
year before no empty finding is made. The learned values site/battery_full_at
and site/night_wh come from the days of today's day type.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The monitoring tab lists the learned site values base_w, battery_full_at
and night_wh next to the existing site keys, with their icons and labels.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The season week record gets an optional empty_share, the share of days
in which the battery fell to the empty threshold before sunrise. The
closer computes it with the same scan as the battery detector, judged
with the 14 days before the week, and only when the rule document has a
site. The engine gives the battery detector the median share of the same
weeks in the prior years as Input.PriorEmptyShare, so the empty finding
can be made in production. Season files without the field still load.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The demo seeds a washing machine next to the heat pump on the same PV
threshold, a feedback pair on the washing machine, a daily competition of
both rules and a house battery that is full before noon, so the energy
checks produce their findings from the real detectors.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ll battery in Monitoring

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…demo

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hresholds unreachable in winter

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gestions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tory

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The monitoring collects the visible suggestions of the band and turns each
one into a notice whose step opens the suggestion on the automations page.
Monitoring stays quiet while the pattern learning is off, as the endpoint
does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Developer-Simon and others added 7 commits November 22, 2026 17:35
A suggestion notice opens the suggestion on the automations page. The band
opens the requested suggestion, widening its list when the suggestion is
beyond the first rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uggestion notices

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Exemption granted by Developer-Simon with 👍. No tour is required for these highlights:

  • Dashboard v0.11.22-pre.31: The rule check finds feedback, competition for the surplus, a rising base load and battery problems

@Developer-Simon
Developer-Simon merged commit 142387b into prerelease Nov 22, 2026
32 of 38 checks passed
@Developer-Simon
Developer-Simon deleted the feat/automation-learning-energy-checks branch November 22, 2026 18:04
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.

1 participant