Skip to content

feat(automations): check adopted suggestions and report season drift - #300

Merged
Developer-Simon merged 34 commits into
prereleasefrom
feat/automation-learning-feedback
Nov 29, 2026
Merged

Developer-Simon merged 34 commits into
prereleasefrom
feat/automation-learning-feedback

Conversation

@Developer-Simon

Copy link
Copy Markdown
Owner

Squash-merge commit message

The node now checks what an adopted suggestion changed, and reports when its
values drift with the season.

- Rules and scenarios saved from a suggestion carry learned_from. The schema of
  the automation service accepts it, the service ignores it.
- The effect compares the weeks since the change with the four weeks before,
  corrected by the season. It is stored in autolearn/effects.json, which the
  backup includes.
- Every adopted rule shows an info mark with its result. Monitoring lists the
  measured results for eight weeks under the new filter Results check, with
  their confidence and a step to the rule.
- A switch time, a surplus window, the consumption while away or a proposed
  threshold that moves with the season shows a warning on the rule with a fix.
- New documentation page for the learning functions, reworked Monitoring page.
- The demo shows every effect state and all four kinds of drift.

Highlights:
- Monitoring checks the results of adopted suggestions and rules report a season drift

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

Highlight translations

Highlights (de):
- Monitoring prüft, was übernommene Vorschläge bringen, Regeln melden einen Saisonwechsel

Tour

{
  "*": {
    "steps": [
      {
        "panel": "monitoring-panel",
        "target": "monitoring-effect",
        "device": "any",
        "need": "view_monitoring",
        "open": [
          "monitoring-effect"
        ],
        "title": {
          "en": "Results check",
          "de": "Erfolgskontrolle"
        },
        "text": {
          "en": "After you adopt a suggestion, Monitoring shows the value before and since under Results check. It appears after the first full week.",
          "de": "Nach dem Übernehmen eines Vorschlags zeigt das Monitoring unter Erfolgskontrolle den Wert vorher und seitdem. Das beginnt nach der ersten vollen Woche."
        }
      },
      {
        "panel": "automations-panel",
        "target": "rule-effect",
        "device": "any",
        "need": "view_automations",
        "open": [
          "automations-rules"
        ],
        "title": {
          "en": "The mark on the rule",
          "de": "Die Marke an der Regel"
        },
        "text": {
          "en": "The rule carries the same result. When its times or values move with the season, the mark warns and offers an adjustment.",
          "de": "Die Regel trägt dasselbe Ergebnis. Wandern ihre Zeiten oder Werte mit der Jahreszeit, warnt die Marke und bietet eine Anpassung an."
        }
      },
      {
        "panel": "monitoring-panel",
        "target": "monitoring-learned",
        "device": "any",
        "need": "view_monitoring",
        "open": [
          "monitoring-learned"
        ],
        "title": {
          "en": "Learned values",
          "de": "Lernwerte"
        },
        "text": {
          "en": "Monitoring lists what the node has learned. Rules can use these values.",
          "de": "Das Monitoring listet, was der Node gelernt hat. Regeln können diese Werte nutzen."
        }
      }
    ]
  }
}

Summary

Adopted suggestions are now checked: rules show their result, Monitoring lists the measured ones under Results check, and rules warn when their values drift with the season. Merge danger: two-way door, but the rule schema forbids unknown fields, so the dashboard needs the new automation service schema to save a rule adopted from a suggestion (a node with mixed versions is untested). Not covered by the demo and only by tests: the jump from Monitoring to a scenario.

Checks

  • The title is a Conventional Commits subject.
  • scripts/dev/check_tracked_secrets.sh is clean.
  • AI assistance disclosed per AI-DISCLAIMER.md: Claude Sonnet 5.5
  • Suites run locally: go vet, go test, npm test (3636), pytest services/automation, demo/fakes and scripts/tests, cache_bust check, smoke (5 of 5 runs), browser check in the demo
  • Linked issue: none

Developer-Simon and others added 30 commits November 29, 2026 17:59
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>
…the season

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The season denominator of the effect now comes from the adoption date,
so it holds once the baseline day files are pruned. The new EffectStore
keeps one measured effect per rule or scenario that came from a learned
suggestion, with its baseline and the numbers shown with it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nd in the band

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

Nightly, each learned entry keeps one standardised drift value per day,
the difference between the adopted and the current suggested values in
spreads. A CUSUM over the last 28 days raises a season_shift finding
with replacing fixes once the drift is beyond the slack. A candidate
that moved its switch time is matched by its ID prefix. Drift findings
are reported with the rule check, never on the band.

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

A replaced rule points at a candidate the gate does not show, so its
values were missing. The effect runner now adds the values of every
candidate that is not shown, the shown ones win. The season drift
finding also names the matching candidate in its params.

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>
Add the Automations: Learning page with the band, rule marks, minimum
data per kind, learned values, effect and season drift, recording and
privacy. Add it to the navigation under Automations, and add Monitoring
after Device map.

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>
Values that move because of the adoption itself, such as the today value
of a threshold or the share of an overridden rule, made a false season
shift. Each kind now drifts only on its own seasonal values. Other kinds
never drift.

An ops based replace fix renews learned_from with the suggestion of its
finding, so the mark follows the rule after the drift is applied. The
threshold value gets the catalog text Schwelle and Threshold.

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>
A suggestion without a unit has no measure to compare, so its effect
shows only the override count (effect.count_only), not the missing
comparison data. Such an entry stays off the band. The assistant origin
is set only when the template is opened, so a template picked by hand
afterwards gets no learned_from.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The surplus detector stopped at any surplus rule of the device, so the
window suggestion of an adopted rule never came back and its season drift
could not be reported. Now a rule adopted from this window suggestion does
not silence the detector, while every other surplus rule still does.

A suggestion adopted into a rule or scenario counts as applied for every
kind, so the gate and the suggestions band no longer show it as a tile.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The demo now shows every state of the effect proof (waiting, no baseline,
count only, ok) and every kind of season drift (switch time, away standby,
threshold, surplus window). Adopted rules and the scenario carry learned
marks with an adoption age in days, stamped from now by the demo script.
The dehumidifier rule shows one reversal among four switch-offs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The effect runner judged the season drift on its first run, before the
daily round had produced the learned values. After every restart the drift
findings disappeared until the next day. The drift now waits for a complete
daily round and is judged once per round. A night without a candidate list
leaves a stored drift untouched. In the demo, one extra daily round runs
after the first round, because the learned values exist only after it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The prior-year demo weeks carry load and PV, so the season correction of the effect has figures to work with. The test pins that the demo shows one sure effect beside an estimate.

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>
Both surplus templates create a scenario, so the drift fix replaces a scenario and not a rule.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t in hand switches

The dryer was a rule, which the assistant never creates for a window suggestion, so its drift fix added a scenario beside the rule. A follow rule shows a measured effect in hand switches per week.

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

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Developer-Simon and others added 4 commits November 29, 2026 18:33
The effect tiles sit behind the expander, so the tour step for them needs a target that opens the band.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
An effect validates an adopted suggestion and asks for nothing, so it leaves the suggestion band. Monitoring lists the measured results under their own filter, with the confidence and a step to the rule. The rule marks stay.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Developer-Simon
Developer-Simon merged commit d9e023b into prerelease Nov 29, 2026
20 checks passed
@Developer-Simon
Developer-Simon deleted the feat/automation-learning-feedback branch November 29, 2026 18:46
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