Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
80c444e
feat(autolearn): let a fix change several rules and estimate signal n…
Developer-Simon Nov 22, 2026
67cbc32
feat(autolearn): flag rules whose own load flips their condition
Developer-Simon Nov 22, 2026
f6ea384
feat(autolearn): name feedback as the cause of flapping rules
Developer-Simon Nov 22, 2026
d725acf
feat(autolearn): stagger rules that compete for the same surplus
Developer-Simon Nov 22, 2026
3769fa6
feat(autolearn): say in which week a PV rule will fire again
Developer-Simon Nov 22, 2026
b624fb6
feat(autolearn): report a rising base load with the device behind it
Developer-Simon Nov 22, 2026
20a221a
feat(autolearn): add the night off template with learned night bounds
Developer-Simon Nov 22, 2026
aac68e4
feat(autolearn): report a battery that is full too early or empty bef…
Developer-Simon Nov 22, 2026
e6e4e30
feat(monitoring): show base load, battery full time and night energy
Developer-Simon Nov 22, 2026
0fbf269
feat(autolearn): store the empty battery share per season week
Developer-Simon Nov 22, 2026
e00d60b
feat(autolearn): seed energy findings in the demo
Developer-Simon Nov 22, 2026
11857c5
docs(automations): describe the energy findings
Developer-Simon Nov 22, 2026
85a44b4
chore(dashboard): bump the cache-bust marks for energy findings
Developer-Simon Nov 22, 2026
c30a3db
test(webui): follow the template cache-bust mark
Developer-Simon Nov 22, 2026
cb2d65b
fix(autolearn): drop findings whose fix is saved and show an early fu…
Developer-Simon Nov 22, 2026
715cbfd
fix(automations): keep learned findings while a fix sits in the draft
Developer-Simon Nov 22, 2026
5775d14
feat(autolearn): seed a rising base load and an empty battery in the …
Developer-Simon Nov 22, 2026
bb0ea79
feat(autolearn): keep the PV sky for a year and stop calling summer t…
Developer-Simon Nov 22, 2026
2a5c0aa
feat(settings): add the switch for a whole year of seasonal data
Developer-Simon Nov 22, 2026
64acfc7
docs(automations): name the never triggered finding as the UI does
Developer-Simon Nov 22, 2026
a590474
chore(dashboard): bump the cache-bust mark of the settings page
Developer-Simon Nov 22, 2026
2c655b5
feat(autolearn): seed a year of PV sky so the demo shows a seasonal rest
Developer-Simon Nov 22, 2026
e3a0952
fix(automations): preselect the switch of night off and quiet off sug…
Developer-Simon Nov 22, 2026
d0e1298
feat(autolearn): send energy findings without a rule to Monitoring
Developer-Simon Nov 22, 2026
d87e3c1
feat(autolearn): let the season expectation shorten the base load his…
Developer-Simon Nov 22, 2026
4789168
feat(autolearn): seed earlier years instead of doubling the demo days
Developer-Simon Nov 22, 2026
c101481
feat(demo): publish the automation state when the console starts
Developer-Simon Nov 22, 2026
43ae2f6
feat(autolearn): show the Soll charge of the battery findings
Developer-Simon Nov 22, 2026
a5ff2af
feat(monitoring): list every suggestion as a notice
Developer-Simon Nov 22, 2026
5f880ad
feat(automations): draw Ist and Soll curves in one chart
Developer-Simon Nov 22, 2026
9eaa37c
feat(monitoring): open the suggestion from its notice
Developer-Simon Nov 22, 2026
e4c86cb
chore(dashboard): bump the cache-bust marks for the curve chart and s…
Developer-Simon Nov 22, 2026
add1bab
feat(monitoring): collect the suggestions under their own filter
Developer-Simon Nov 22, 2026
ff6bf1b
chore(release): bump component versions
Nov 22, 2026
2389914
docs(changelog): update changelogs
Nov 22, 2026
1ff6d17
docs(changelog): update changelogs
Nov 22, 2026
a26ec0d
docs(changelog): update changelogs
Nov 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog/highlights/292.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"de": {
"*": "Die Regelprüfung erkennt Rückkopplung, Konkurrenz, steigende Grundlast und Akkuprobleme"
},
"en": {
"*": "The rule check finds feedback, competition for the surplus, a rising base load and battery problems"
}
}
37 changes: 34 additions & 3 deletions dashboard/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## v0.11.22-pre.30 (2026-11-06)
## v0.11.22-pre.31 (2026-11-06)

### Features

Expand Down Expand Up @@ -30,6 +30,31 @@
- **automations:** Rules can follow learned values with bounds and react to a quiet or active house (#284) (8aae55b)
- **automations:** Learning knows the seasons, the sun and the outdoor temperature (#287) (8812dc2)
- **automations:** Learning knows device cycles, the PV reserve and the remaining surplus of the day (#289) (5d86b6b)
- **monitoring:** A Monitoring tab with notices, acknowledgement and all learned values (#291) (7ae50a9)
- **autolearn:** let a fix change several rules and estimate signal noise (80c444e)
- **autolearn:** flag rules whose own load flips their condition (67cbc32)
- **autolearn:** name feedback as the cause of flapping rules (f6ea384)
- **autolearn:** stagger rules that compete for the same surplus (d725acf)
- **autolearn:** say in which week a PV rule will fire again (3769fa6)
- **autolearn:** report a rising base load with the device behind it (b624fb6)
- **autolearn:** add the night off template with learned night bounds (20a221a)
- **autolearn:** report a battery that is full too early or empty before morning (aac68e4)
- **monitoring:** show base load, battery full time and night energy (e6e4e30)
- **autolearn:** store the empty battery share per season week (0fbf269)
- **autolearn:** seed energy findings in the demo (e00d60b)
- **autolearn:** seed a rising base load and an empty battery in the demo (5775d14)
- **autolearn:** keep the PV sky for a year and stop calling summer thresholds unreachable in winter (bb0ea79)
- **settings:** add the switch for a whole year of seasonal data (2a5c0aa)
- **autolearn:** seed a year of PV sky so the demo shows a seasonal rest (2c655b5)
- **autolearn:** send energy findings without a rule to Monitoring (d0e1298)
- **autolearn:** let the season expectation shorten the base load history (d87e3c1)
- **autolearn:** seed earlier years instead of doubling the demo days (4789168)
- **autolearn:** show the Soll charge of the battery findings (43ae2f6)
- **monitoring:** list every suggestion as a notice (a5ff2af)
- **automations:** draw Ist and Soll curves in one chart (5f880ad)
- **monitoring:** open the suggestion from its notice (9eaa37c)
- **monitoring:** collect the suggestions under their own filter (add1bab)
- **autolearn:** The rule check finds feedback, competition for the surplus, a rising base load and battery problems (#292)
- **i18n:** add the view_monitoring texts (0385648)
- **auth:** add the view_monitoring right (44c40f9)
- **monitoring:** collect notices from energy, chains and learning (e85d98c)
Expand All @@ -44,7 +69,6 @@
- **i18n:** add the monitoring labels and load error (c5aa6b7)
- **webui:** add the monitoring tab and panel (41562a2)
- **energy:** point the energy page notices to monitoring (8c665f2)
- **monitoring:** A Monitoring tab with notices, acknowledgement and all learned values (#291)
- **learnrec:** add the energy limits of each learning level (b74b813)
- **autolearn:** track device cycles from minute power (0e10e79)
- **autolearn:** store cycles and battery level in the day file (039e639)
Expand Down Expand Up @@ -263,14 +287,17 @@
- **storage:** offer sticks with several partitions as a group and format single partitions (#243) (c4e6d33)
- **storage:** wipe old file system signatures before formatting a stick (#245) (aeafa63)
- **storage:** set up, back up and replug the additional drive reliably (#247) (b668394)
- **autolearn:** drop findings whose fix is saved and show an early full battery in Monitoring (cb2d65b)
- **automations:** keep learned findings while a fix sits in the draft (715cbfd)
- **automations:** preselect the switch of night off and quiet off suggestions (e3a0952)
- **backup:** A restore stays in place even when the battery state cannot be written (#288) (e5c5437)
- **webui:** translate the time value of the monitoring model (d55ca28)
- **webui:** add labels and load error to the monitoring panel (79ad0f3)
- **energy:** keep monitoring jumps and refresh the summary line (9ad7b8a)
- **settings:** offer efficiency and monitoring in the wide tabs (8c6e470)
- **webui:** match the monitoring skeleton to the page and bump marks (bd91d58)
- **users:** label the monitoring right just Monitoring (35f718e)
- **users:** list the view rights in the order of the tabs (de17776)
- **backup:** A restore stays in place even when the battery state cannot be written (#288) (e5c5437)
- **autolearn:** pass the battery level into the learning frames (be60d22)
- **autolearn:** harden cycle gap, runs and long cycles (a3b5f6f)
- **autolearn:** count only the PV the house does not use as surplus (c9b33ff)
Expand Down Expand Up @@ -375,6 +402,7 @@

### Tests

- **webui:** follow the template cache-bust mark (c30a3db)
- **smoke:** probe the live push on the house load (5382341)
- **webui:** follow the new cache-bust marks (b06cc13)
- **automations:** do not pin the cache-bust mark of the learned helper (2fd09ce)
Expand All @@ -395,6 +423,9 @@

### Chores

- **dashboard:** bump the cache-bust marks for energy findings (85a44b4)
- **dashboard:** bump the cache-bust mark of the settings page (a590474)
- **dashboard:** bump the cache-bust marks for the curve chart and suggestion notices (e4c86cb)
- **webui:** bump the lazy asset marks of the monitoring page (79de377)
- **dashboard:** bump the cache-bust marks for energy learning (8bd6f10)
- **dashboard:** rebump the cache-bust marks after the rebase (c8480e9)
Expand Down
2 changes: 1 addition & 1 deletion dashboard/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.11.22-pre.30
v0.11.22-pre.31
56 changes: 54 additions & 2 deletions dashboard/cmd/dashboard/learn_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/Developer-Simon/energy-node-dashboard/internal/learnrec"
"github.com/Developer-Simon/energy-node-dashboard/internal/registry"
"github.com/Developer-Simon/energy-node-dashboard/internal/settings"
"github.com/Developer-Simon/energy-node-dashboard/internal/sun"
)

// seasonBackfillYears is how far back the energy statistics refill the season
Expand All @@ -34,8 +35,11 @@ type seasonCloser struct {
store *autolearn.SeasonStore
days func(from, to time.Time) ([]autolearn.DayFile, error)
learned func() map[string][]float64
loc *time.Location
done string
// site gives the coordinates of the rule document, nil or nil result means
// no sun, and the closed week gets no empty share.
site func() *sun.Location
loc *time.Location
done string
}

// Run closes the previous ISO week when the store has no week for it yet, or
Expand Down Expand Up @@ -68,6 +72,9 @@ func (c *seasonCloser) close(now, prevMonday, thisMonday time.Time) {
log.Printf("autolearn: season week day files incomplete: %v", err)
}
if w, ok := autolearn.WeekOf(days, c.learned(), c.loc); ok {
if share, ok := c.emptyShare(prevMonday, days); ok {
w.EmptyShare = &share
}
c.store.Put(w)
} else {
log.Printf("autolearn: season week %s not closed, fewer than four day files", prevMonday.Format("2006-01-02"))
Expand All @@ -78,6 +85,39 @@ func (c *seasonCloser) close(now, prevMonday, thisMonday time.Time) {
}
}

// emptyShare returns the share of the empty mornings of the week, judged with
// the 14 days before it. ok is false without a site or without enough sun days.
func (c *seasonCloser) emptyShare(prevMonday time.Time, week []autolearn.DayFile) (float64, bool) {
if c.site == nil {
return 0, false
}
site := c.site()
if site == nil {
return 0, false
}
prior, err := c.days(prevMonday.AddDate(0, 0, -14), prevMonday.AddDate(0, 0, -1))
if err != nil {
log.Printf("autolearn: season week prior day files incomplete: %v", err)
}
return autolearn.EmptyShareOf(prior, week, site, c.loc)
}

// ruleSite reads the coordinates of the rule document. A document that cannot
// be read or parsed gives no site.
func ruleSite(read func() ([]byte, error)) func() *sun.Location {
return func() *sun.Location {
raw, err := read()
if err != nil {
return nil
}
doc, err := autolearn.ParseDoc(raw)
if err != nil {
return nil
}
return doc.Location
}
}

// learnedClockMinutes reads the learned clock times of the store as minutes of
// the day, keyed by the learned key. WeekOf takes the median of each key.
func learnedClockMinutes(store *autolearn.LearnedStore) func() map[string][]float64 {
Expand Down Expand Up @@ -157,6 +197,18 @@ func engineGroupsFor(value settings.Settings) map[string]bool {
}
}

// pvKeepDays is how many days the sky raster keeps: a year with the seasonal
// data switch on, else as long as the day profiles.
func pvKeepDays(value settings.Settings) int {
if !value.LearningSeasonYearDisabled {
return autolearn.PVRasterYearDays
}
if value.LearningProfileDays > 0 {
return value.LearningProfileDays
}
return settings.LearningProfileDaysDefault
}

// anyGroupOn reports whether a group of the engine is switched on.
func anyGroupOn(groups map[string]bool) bool {
for _, on := range groups {
Expand Down
47 changes: 47 additions & 0 deletions dashboard/cmd/dashboard/learn_engine_season_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/Developer-Simon/energy-node-dashboard/internal/autolearn"
"github.com/Developer-Simon/energy-node-dashboard/internal/energystats"
"github.com/Developer-Simon/energy-node-dashboard/internal/learnrec"
"github.com/Developer-Simon/energy-node-dashboard/internal/sun"
)

// seasonTestDays returns n day files starting at the given day, each with a
Expand Down Expand Up @@ -216,3 +217,49 @@ func TestDailyShareSaverRecordsOnlyWhenRunning(t *testing.T) {
})
}
}

// seasonSoCDays returns one day file per day from start, with the charge in
// every quarter.
func seasonSoCDays(start time.Time, n int, soc float32) []autolearn.DayFile {
var out []autolearn.DayFile
for i := 0; i < n; i++ {
f := autolearn.DayFile{V: 1, Day: start.AddDate(0, 0, i).Format("2006-01-02")}
for q := 0; q < 96; q++ {
v := soc
f.Site.SoC[q] = &v
f.Site.Seen[q] = 1
}
out = append(out, f)
}
return out
}

// TestSeasonCloserWritesEmptyShare: with a site the closed week carries the
// share of its empty mornings, judged with the 14 days before it. Without a
// site the week has no share.
func TestSeasonCloserWritesEmptyShare(t *testing.T) {
site := &sun.Location{Lat: 52, Lon: 0}
priorFrom := seasonPrevMon.AddDate(0, 0, -14)
run := func(withSite bool) *seasonCloser {
closer, _ := newSeasonCloserForTest(t, nil, new(int))
closer.days = func(from, to time.Time) ([]autolearn.DayFile, error) {
if from.Equal(priorFrom) {
return seasonSoCDays(priorFrom, 14, 40), nil
}
return seasonSoCDays(seasonPrevMon, 7, 10), nil
}
if withSite {
closer.site = func() *sun.Location { return site }
}
closer.Run(seasonWednesday)
return closer
}
ws := run(true).store.Weeks("2026-W47", "2026-W47")
if len(ws) != 1 || ws[0].EmptyShare == nil || *ws[0].EmptyShare != 1 {
t.Fatalf("week with site = %+v, want empty share 1", ws)
}
ws = run(false).store.Weeks("2026-W47", "2026-W47")
if len(ws) != 1 || ws[0].EmptyShare != nil {
t.Fatalf("week without site = %+v, want no empty share", ws)
}
}
13 changes: 13 additions & 0 deletions dashboard/cmd/dashboard/learn_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"testing"
"time"

"github.com/Developer-Simon/energy-node-dashboard/internal/autolearn"
"github.com/Developer-Simon/energy-node-dashboard/internal/energy"
"github.com/Developer-Simon/energy-node-dashboard/internal/learnrec"
"github.com/Developer-Simon/energy-node-dashboard/internal/registry"
Expand Down Expand Up @@ -133,3 +134,15 @@ func TestPVSiteRegulatorCountsEveryRegulator(t *testing.T) {
t.Errorf("disabled scenario gives regulator %+v, want none", reg)
}
}

func TestPVKeepDaysFollowsTheSeasonSwitch(t *testing.T) {
if got := pvKeepDays(settings.Settings{}); got != autolearn.PVRasterYearDays {
t.Fatalf("default = %d, want a year", got)
}
if got := pvKeepDays(settings.Settings{LearningSeasonYearDisabled: true, LearningProfileDays: 90}); got != 90 {
t.Fatalf("switch off = %d, want the profile days 90", got)
}
if got := pvKeepDays(settings.Settings{LearningSeasonYearDisabled: true}); got != settings.LearningProfileDaysDefault {
t.Fatalf("switch off without profile days = %d, want the default", got)
}
}
47 changes: 42 additions & 5 deletions dashboard/cmd/dashboard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,15 @@ func main() {
pvTracker := autolearn.NewPVTracker(loadPVRaster(pvPath, learnLimits(), log.Printf),
pvSite.location, pvSite.regulator,
func() string { return time.Now().In(time.Local).Format("2006-01-02") }, pvPath)
// Saisonale Daten: der Himmelsraster bleibt ein Jahr, mit abgeschaltetem
// Schalter so lange wie die Tagesprofile.
pvTracker.SetKeepDays(func() int {
value, err := settingsStore.LoadSettings()
if err != nil {
return autolearn.PVRasterYearDays
}
return pvKeepDays(value)
})
learnHub.AddMinute("pvtracker", pvTracker)
learnHub.AddSaver("pvtracker", saverFunc(func() error {
pvSite.refresh()
Expand Down Expand Up @@ -561,8 +570,8 @@ func main() {
// Erkenner: Gewohnheiten (habit) und Zuverlaessigkeit (reliability).
for _, det := range []autolearn.Detector{
autolearn.SwitchTimeDetector, autolearn.RuntimeDetector, autolearn.CouplingDetector,
autolearn.FlappingDetector, autolearn.NoEffectDetector, autolearn.OverriddenDetector, autolearn.OfflineDetector,
autolearn.AwayStandbyDetector,
autolearn.FlappingDetector, autolearn.FeedbackDetector, autolearn.NoEffectDetector, autolearn.OverriddenDetector, autolearn.OfflineDetector,
autolearn.AwayStandbyDetector, autolearn.CompetitionDetector,
} {
automationEngine.Register(det)
}
Expand All @@ -571,17 +580,20 @@ func main() {
forecastCheck := autolearn.LoadForecastCheck(filepath.Join(autolearnDir, "forecast.json"), log.Printf)
learnHub.AddSaver("forecast", forecastCheck)
registerEnergyDetectors(automationEngine, pvReserve.Current, forecastCheck)
automationEngine.Register(autolearn.BaseLoadDetector)
automationEngine.Register(autolearn.BatteryDetector)
automationEngine.Register(autolearn.NewPVModelDetector(pvTracker.Snapshot, pvModelStore))
automationEngine.Register(autolearn.NewShadeDetector(pvTracker.Snapshot, pvModelStore.Model))
// Modell und Himmelsraster fuer den Rest-Ueberschuss. Der Raster-Schnappschuss
// entsteht nur, wenn ein Modell da ist.
automationEngine.SetPV(func() (autolearn.PVModel, *autolearn.Raster, bool) {
pvSource := func() (autolearn.PVModel, *autolearn.Raster, bool) {
m, ok := pvModelStore.Model()
if !ok {
return autolearn.PVModel{}, nil, false
}
return m, pvTracker.Snapshot(), true
})
}
automationEngine.SetPV(pvSource)
// Die Aussentemperatur fuer den Heizzeit-Erkenner: die Entitaet aus den
// Einstellungen, aufgeloest ueber die Registry wie beim Lernhub.
automationEngine.SetOutdoor(func() autolearn.OutdoorSource {
Expand All @@ -603,6 +615,8 @@ func main() {
automationChecker.SetEngineSource(automationEngine.Candidates, func() bool {
return engineGroups()["reliability"]
})
// Die Regelpruefung prueft PV-Schwellen gegen dieselbe Bestkurve wie die Engine.
automationChecker.SetPV(pvSource)
// Herabstufung: nur bei automatischer Stufe rueckt die gemerkte Stufe eine
// nach unten. Eine feste Stufe der Einstellungen bleibt unberuehrt.
engineDowngrade := func() {
Expand Down Expand Up @@ -632,18 +646,33 @@ func main() {
learnHub.AddSaver("learned", learnedStore)
// Monitoring: Meldungen aus Energie, Ketten und Regelpruefung, je Minute
// gesammelt, beim Abruf frisch und mit dem Hub gespeichert.
// Vorschlaege fuer das Monitoring. Die Funktion wird unten gesetzt, sobald das
// Vorschlagsbuch steht, und vor dem Start der Lernschleifen.
var monitoringSuggestions func() []autolearn.Finding
collectMonitoring := func() monitoring.Input {
in := monitoring.Input{Snapshot: energy.Aggregate(reg.Snapshot(), energyResolver, time.Now().UTC())}
if value, err := settingsStore.LoadEnergy(); err == nil {
in.Config = value
}
in.Findings = automationChecker.Findings(time.Now())
if monitoringSuggestions != nil {
in.Suggestions = monitoringSuggestions()
}
return in
}
monitoringStore := monitoring.OpenStore(filepath.Join(autolearnDir, "monitoring.json"), log.Printf)
monitoringLoop := newMonitoringRunner(monitoringStore, collectMonitoring)
learnHub.AddMinute("monitoring", monitoringLoop)
learnHub.AddSaver("monitoring", monitoringLoop)
// Die gelernten Werte der Engine, etwa die Betriebsleistung fuer die Rueckkopplung.
automationEngine.SetLearned(func() map[string]autolearn.LearnedEntry {
entries := learnedStore.Entries()
out := make(map[string]autolearn.LearnedEntry, len(entries))
for _, e := range entries {
out[e.Key] = e
}
return out
})
// Wochenwerte fuer den Saisonvergleich. Fehlt season.json, fuellt die
// Energiestatistik der letzten drei Jahre sie einmal nach.
seasonPath := filepath.Join(autolearnDir, "season.json")
Expand All @@ -662,7 +691,8 @@ func main() {
seasonStore.Put(w)
}
}
seasonClose := &seasonCloser{store: seasonStore, days: dayStore.Days, learned: learnedClockMinutes(learnedStore), loc: time.Local}
seasonClose := &seasonCloser{store: seasonStore, days: dayStore.Days, learned: learnedClockMinutes(learnedStore),
site: ruleSite(func() ([]byte, error) { return configManager.Read("automation_rules") }), loc: time.Local}
suggestions := &suggestionBook{state: suggestionState, readDoc: func() ([]byte, error) { return configManager.Read("automation_rules") }}
suggestionExists := func(device string) bool {
if deviceFilterStore.IsIgnored(device) {
Expand All @@ -671,6 +701,13 @@ func main() {
_, ok := reg.Get(device)
return ok
}
monitoringSuggestions = func() []autolearn.Finding {
// Wie der Vorschlags-Endpunkt: bei abgeschaltetem Muster-Lernen keine Vorschlaege.
if value, err := settingsStore.LoadSettings(); err == nil && value.AutomationPatternsDisabled {
return nil
}
return suggestions.Visible(time.Now(), suggestionExists)
}

origin := newOriginLearner(originTracker, dayStore, reg, func() ([]byte, error) { return configManager.Read("automation_rules") })
origin.rebuild()
Expand Down
Loading
Loading