Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0385648
feat(i18n): add the view_monitoring texts
Developer-Simon Nov 22, 2026
44c40f9
feat(auth): add the view_monitoring right
Developer-Simon Nov 22, 2026
e85d98c
feat(monitoring): collect notices from energy, chains and learning
Developer-Simon Nov 22, 2026
f231be9
feat(monitoring): keep first seen and acknowledgements per notice
Developer-Simon Nov 22, 2026
2739eae
feat(i18n): add the monitoring unavailable error text
Developer-Simon Nov 22, 2026
55f0eb2
feat(monitoring): serve notices and learned values with acknowledgement
Developer-Simon Nov 22, 2026
d484d92
feat(monitoring): wire the collector into the dashboard
Developer-Simon Nov 22, 2026
7ef342f
feat(webui): add the monitoring page model
Developer-Simon Nov 22, 2026
96ae9fa
feat(webui): add the learned values to the monitoring model
Developer-Simon Nov 22, 2026
d55ca28
fix(webui): translate the time value of the monitoring model
Developer-Simon Nov 22, 2026
32f7f58
feat(i18n): add the monitoring page and energy line texts
Developer-Simon Nov 22, 2026
24907a4
feat(webui): add the monitoring panel files
Developer-Simon Nov 22, 2026
c5aa6b7
feat(i18n): add the monitoring labels and load error
Developer-Simon Nov 22, 2026
79ad0f3
fix(webui): add labels and load error to the monitoring panel
Developer-Simon Nov 22, 2026
41562a2
feat(webui): add the monitoring tab and panel
Developer-Simon Nov 22, 2026
8c665f2
feat(energy): point the energy page notices to monitoring
Developer-Simon Nov 22, 2026
9ad7b8a
fix(energy): keep monitoring jumps and refresh the summary line
Developer-Simon Nov 22, 2026
9802fe9
docs(monitoring): document the monitoring page and add the smoke check
Developer-Simon Nov 22, 2026
79de377
chore(webui): bump the lazy asset marks of the monitoring page
Developer-Simon Nov 22, 2026
8c6e470
fix(settings): offer efficiency and monitoring in the wide tabs
Developer-Simon Nov 22, 2026
bd91d58
fix(webui): match the monitoring skeleton to the page and bump marks
Developer-Simon Nov 22, 2026
e50daa9
chore(release): bump component versions
Nov 22, 2026
3047cbc
docs(changelog): update changelogs
Nov 22, 2026
35f718e
fix(users): label the monitoring right just Monitoring
Developer-Simon Nov 22, 2026
9cfe2d2
docs(changelog): update changelogs
Nov 22, 2026
de17776
fix(users): list the view rights in the order of the tabs
Developer-Simon Nov 22, 2026
cced26b
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
58 changes: 58 additions & 0 deletions changelog/highlights/291.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"de": {
"*": "Ein Reiter Monitoring mit Meldungen, Quittung und allen Lernwerten"
},
"en": {
"*": "A Monitoring tab with notices, acknowledgement and all learned values"
},
"tour": {
"*": {
"steps": [
{
"device": "any",
"need": "view_monitoring",
"target": "monitoring-tab",
"text": {
"de": "Monitoring sammelt die Meldungen zur Energie-Bilanz, zu den Messketten und zum Lernen an einer Stelle. Ein Punkt am Reiter zeigt, dass etwas Neues wartet.",
"en": "Monitoring gathers the notices about the energy balance, the measurement chains and the learning in one place. A dot on the tab shows that something new is waiting."
},
"title": {
"de": "Der Reiter Monitoring",
"en": "The Monitoring tab"
}
},
{
"device": "any",
"need": "view_monitoring",
"panel": "monitoring-panel",
"target": "monitoring-list",
"text": {
"de": "Jede Meldung nennt empfohlene Schritte, und ein Schritt springt an die passende Stelle. Mit dem Recht Einrichten nimmst du eine Meldung zur Kenntnis, sie rutscht dann unter die neuen.",
"en": "Each notice lists the recommended steps, and a step jumps to the right place. With the setup right you mark a notice as acknowledged, it then moves below the new ones."
},
"title": {
"de": "Meldungen und Quittung",
"en": "Notices and acknowledgement"
}
},
{
"device": "any",
"need": "view_monitoring",
"open": [
"monitoring-learned"
],
"panel": "monitoring-panel",
"target": "monitoring-learned",
"text": {
"de": "Die zweite Ansicht zeigt alles, was der Knoten gelernt hat, nach Anlage und Gerät, und was einem Wert noch fehlt, solange er fehlt.",
"en": "The second view shows everything the node has learned, grouped by system and device, and what a value still needs while it is missing."
},
"title": {
"de": "Alle Lernwerte",
"en": "All learned values"
}
}
]
}
}
}
30 changes: 27 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.29 (2026-11-06)
## v0.11.22-pre.30 (2026-11-06)

### Features

Expand Down Expand Up @@ -29,6 +29,22 @@
- **automations:** suggest rules from learned habits and check rule reliability (#283) (318066c)
- **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)
- **i18n:** add the view_monitoring texts (0385648)
- **auth:** add the view_monitoring right (44c40f9)
- **monitoring:** collect notices from energy, chains and learning (e85d98c)
- **monitoring:** keep first seen and acknowledgements per notice (f231be9)
- **i18n:** add the monitoring unavailable error text (2739eae)
- **monitoring:** serve notices and learned values with acknowledgement (55f0eb2)
- **monitoring:** wire the collector into the dashboard (d484d92)
- **webui:** add the monitoring page model (7ef342f)
- **webui:** add the learned values to the monitoring model (96ae9fa)
- **i18n:** add the monitoring page and energy line texts (32f7f58)
- **webui:** add the monitoring panel files (24907a4)
- **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 All @@ -51,7 +67,6 @@
- **automations:** prefill thresholds from the learned operating power (b5392a5)
- **autolearn:** seed cycles and PV data in the demo (101e409)
- **demo:** show the energy learned values in the demo (5807cbe)
- **automations:** Learning knows device cycles, the PV reserve and the remaining surplus of the day (#289)
- **sun:** compute sunrise, sunset and the sun position in Go (053ac08)
- **autolearn:** keep weekly figures for three years and backfill them from the energy statistics (a7b5800)
- **autolearn:** wire the season store into the learning run (2a532e4)
Expand Down Expand Up @@ -248,13 +263,20 @@
- **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)
- **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)
- **autolearn:** build the base at the engine round time (427fc12)
- **autolearn:** draw the shade curve from a finished day (1eb46f2)
- **autolearn:** count every scenario regulator for throttled PV (291f1f3)
- **backup:** A restore stays in place even when the battery state cannot be written (#288) (e5c5437)
- **autolearn:** use the median night load and the median learned value in the weekly figures (9d1bac8)
- **autolearn:** close the previous season week on any weekday and test the closing (0ff36cc)
- **automations:** open sun suggestions with the sun anchor and word negative offsets (bca2a79)
Expand Down Expand Up @@ -347,6 +369,7 @@

### Documentation

- **monitoring:** document the monitoring page and add the smoke check (9802fe9)
- **storage:** describe the system disk breakdown (b2222d8)
- **storage:** explain sticks with several partitions and extend the smoke check (7e75f7a)

Expand All @@ -372,6 +395,7 @@

### Chores

- **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)
- **dashboard:** renumber the cache-bust history rows after the prerelease sync (d325767)
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.29
v0.11.22-pre.30
63 changes: 45 additions & 18 deletions dashboard/cmd/dashboard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
"github.com/Developer-Simon/energy-node-dashboard/internal/historyexchange"
"github.com/Developer-Simon/energy-node-dashboard/internal/httpapi"
"github.com/Developer-Simon/energy-node-dashboard/internal/learnrec"
"github.com/Developer-Simon/energy-node-dashboard/internal/monitoring"
"github.com/Developer-Simon/energy-node-dashboard/internal/mqttclient"
"github.com/Developer-Simon/energy-node-dashboard/internal/netmgr"
"github.com/Developer-Simon/energy-node-dashboard/internal/nodeagent"
Expand Down Expand Up @@ -629,6 +630,20 @@ func main() {
// Datei liegt unter autolearn/ und wird mit dem Hub gespeichert.
learnedStore := autolearn.LoadLearnedStore(filepath.Join(autolearnDir, "learned.json"), log.Printf)
learnHub.AddSaver("learned", learnedStore)
// Monitoring: Meldungen aus Energie, Ketten und Regelpruefung, je Minute
// gesammelt, beim Abruf frisch und mit dem Hub gespeichert.
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())
return in
}
monitoringStore := monitoring.OpenStore(filepath.Join(autolearnDir, "monitoring.json"), log.Printf)
monitoringLoop := newMonitoringRunner(monitoringStore, collectMonitoring)
learnHub.AddMinute("monitoring", monitoringLoop)
learnHub.AddSaver("monitoring", monitoringLoop)
// Wochenwerte fuer den Saisonvergleich. Fehlt season.json, fuellt die
// Energiestatistik der letzten drei Jahre sie einmal nach.
seasonPath := filepath.Join(autolearnDir, "season.json")
Expand Down Expand Up @@ -1278,6 +1293,20 @@ func main() {
// root-relative paths, even when a reverse proxy serves the dashboard
// under a subpath (see knowhow/dashboard/dashboard-reverse-proxy-unterpfad.md).
// Both listeners serve this same handler.
// Lernfunktionen fuer den Router und die Ueberwachung, dieselben Werte.
learningDeps := &httpapi.LearningDeps{
Settings: settingsStore.LoadSettings,
State: learnStateNow,
Usage: dayStore.Usage,
ChainSuggestInfo: chainSuggest.LearnedSpan,
ChainLearnInfo: chainMonitor.LearnedSpan,
SetupDone: func() bool { return onboardingStore.Load().SetupDone },
Rules: func() ([]byte, error) { return configManager.Read("automation_rules") },
Reset: func() error {
resetLearned(learnedStore, client)
return errors.Join(dayStore.Reset(), reactions.Reset(), chainSuggest.ResetLearned(), chainMonitor.ResetLearned(), suggestions.Reset())
},
}
handler := perfTiming.Middleware(basepath.Middleware(httpapi.NewAuthenticatedRouter(reg, configManager, settingsStore, tinytuya.NewClient(
cfg.TinyTuya.ProbePython,
cfg.TinyTuya.ProbeScript,
Expand Down Expand Up @@ -1313,21 +1342,9 @@ func main() {
DataDir: dataDir,
AutomationHistoryDir: cfg.RuntimePath(devicesDir, ""),
Onboarding: onboardingStore,
Learning: &httpapi.LearningDeps{
Settings: settingsStore.LoadSettings,
State: learnStateNow,
Usage: dayStore.Usage,
ChainSuggestInfo: chainSuggest.LearnedSpan,
ChainLearnInfo: chainMonitor.LearnedSpan,
SetupDone: func() bool { return onboardingStore.Load().SetupDone },
Rules: func() ([]byte, error) { return configManager.Read("automation_rules") },
Reset: func() error {
resetLearned(learnedStore, client)
return errors.Join(dayStore.Reset(), reactions.Reset(), chainSuggest.ResetLearned(), chainMonitor.ResetLearned(), suggestions.Reset())
},
},
TourTargets: dashwebui.TourTargets,
Backup: backupDeps,
Learning: learningDeps,
TourTargets: dashwebui.TourTargets,
Backup: backupDeps,
Storage: &httpapi.StorageDeps{
DataDir: dataDir,
Service: storageService,
Expand All @@ -1350,9 +1367,19 @@ func main() {
AutomationSuggestions: suggestions,
LearnedValues: learnedStore,
LearnedSeason: seasonStore,
CommandObserver: origin.observeCommand,
StorageFallback: storageFallback,
HistorySampler: historySampler,
Monitoring: &httpapi.MonitoringDeps{
Notices: monitoringLoop.Notices,
Ack: monitoringLoop.Ack,
Learned: func() httpapi.MonitoringLearned {
devices := reg.Snapshot()
learned := httpapi.LearnedBody(learningDeps, learnedStore, learnedExists, seasonStore)
snap := energy.Aggregate(devices, energyResolver, time.Now().UTC())
return monitoringLearned(learned, devices, snap, energyResolver)
},
},
CommandObserver: origin.observeCommand,
StorageFallback: storageFallback,
HistorySampler: historySampler,
InstalledServices: map[string]bool{
"automation": cfg.ServiceInstalled("automation"),
"tailscale": cfg.ServiceInstalled("tailscale"),
Expand Down
103 changes: 103 additions & 0 deletions dashboard/cmd/dashboard/monitoring.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package main

import (
"strings"
"sync"
"time"

"github.com/Developer-Simon/energy-node-dashboard/internal/energy"
"github.com/Developer-Simon/energy-node-dashboard/internal/httpapi"
"github.com/Developer-Simon/energy-node-dashboard/internal/learnrec"
"github.com/Developer-Simon/energy-node-dashboard/internal/monitoring"
"github.com/Developer-Simon/energy-node-dashboard/internal/registry"
)

// monitoringRunner sammelt je Minute (Erstsehen auch ohne offene Seite) und
// bei jedem Abruf. Speichern übernimmt der Hub über Save.
type monitoringRunner struct {
mu sync.Mutex
store *monitoring.Store
collect func() monitoring.Input
}

func newMonitoringRunner(store *monitoring.Store, collect func() monitoring.Input) *monitoringRunner {
return &monitoringRunner{store: store, collect: collect}
}

// Notices sammelt die Meldungen und setzt Erstsehen und Quittung.
func (m *monitoringRunner) Notices(now time.Time) []monitoring.Notice {
m.mu.Lock()
defer m.mu.Unlock()
notices := monitoring.Collect(m.collect())
m.store.Apply(notices, now)
return notices
}

// ObserveMinute sammelt die Meldungen zum Minutenbeginn des Rahmens.
func (m *monitoringRunner) ObserveMinute(f learnrec.Frame) {
m.Notices(f.Minute)
}

// Ack quittiert oder nimmt zurück und speichert sofort.
func (m *monitoringRunner) Ack(id string, ack bool, user string, now time.Time) error {
m.mu.Lock()
defer m.mu.Unlock()
if err := m.store.SetAck(id, ack, user, now); err != nil {
return err
}
return m.store.Save()
}

// Save schreibt den Speicher, wenn sich etwas geändert hat.
func (m *monitoringRunner) Save() error {
m.mu.Lock()
defer m.mu.Unlock()
return m.store.Save()
}

// monitoringDeviceIcon wählt das Icon eines Lerngeräts aus seiner Energie-Rolle.
func monitoringDeviceIcon(role energy.Role, switchable bool) string {
switch {
case role == energy.RoleHeatPump:
return "ico-heatpump"
case role == energy.RoleWallbox:
return "ico-wallbox"
case role == energy.RoleBattery:
return "ico-battery"
case role == energy.RolePV:
return "ico-sun"
case role == energy.RoleSwitch:
return "ico-switch"
case role == energy.RoleLoad, strings.HasPrefix(string(role), "custom:"):
return "ico-load"
case switchable:
return "ico-switch"
default:
return "ico-device"
}
}

// monitoringLearned ergänzt die Lernwerte um Gerätename (Registry) und Icon
// (Energie-Rolle der ersten Entität des Geräts, Schaltbarkeit aus learnDevices).
func monitoringLearned(learned httpapi.MonitoringLearned, devices []registry.DeviceView, snap energy.Snapshot, resolver *energy.Resolver) httpapi.MonitoringLearned {
names := make(map[string]string, len(devices))
for _, device := range devices {
names[device.ID] = device.Name
}
roles := map[string]energy.Role{}
for _, entity := range snap.Entities {
if _, ok := roles[entity.DeviceID]; !ok {
roles[entity.DeviceID] = entity.Role.Role
}
}
infos := learnDevices(devices, resolver)
for i := range learned.Values {
id := learned.Values[i].Device
if id == "" {
continue
}
learned.Values[i].DeviceName = names[id]
learned.Values[i].DeviceIcon = monitoringDeviceIcon(roles[id], infos[id].Switchable)
}
return learned
}
Loading
Loading