diff --git a/changelog/highlights/215.json b/changelog/highlights/215.json index d9ccc0259..cb5dcf588 100644 --- a/changelog/highlights/215.json +++ b/changelog/highlights/215.json @@ -5,6 +5,14 @@ "details": { "*": { "de": "Mehrere Geräte, die in Reihe denselben Energiefluss messen, bilden eine Messkette. Fällt ein Gerät aus, springt ein Ersatzwert ein. Der neue Reiter Effizienz zeigt je Kette Wirkungsgrad, Round-Trip über 30 Tage, Standby-Leistung, Verlust je Tag und die gelernte Wirkungsgradkurve. Eine Diagnose meldet Drift, eingefrorene Werte, Widersprüche sowie falsche Vorzeichen oder Einheiten. Das Dashboard schlägt passende Ketten selbst vor, Automationen reagieren auf Ketten, und auf Wunsch gehen Wirkungsgrad und Verluste als Sensoren an Home Assistant.", + "image": "dashboard-efficiency.png", + "crop": [ + 0.03, + 0.06, + 0.94, + 0.64 + ], + "doc": "dashboard/energy.html#measurement-chains", "en": "Several devices that measure the same energy flow in series form a measurement chain. When one device fails, a substitute value steps in. The new Efficiency tab shows the efficiency, the 30 day round trip, the standby power, the loss per day and the learned efficiency curve of each chain. A diagnosis reports drift, frozen values, contradictions and wrong signs or units. The dashboard suggests fitting chains itself, automations react to chains, and on request the efficiency and the losses go to Home Assistant as sensors." } }, diff --git a/changelog/highlights/233.json b/changelog/highlights/233.json index a6d8b182c..8e87372f8 100644 --- a/changelog/highlights/233.json +++ b/changelog/highlights/233.json @@ -5,6 +5,8 @@ "details": { "*": { "de": "Unter Einstellungen, Speicher richtest du ein zweites Laufwerk ein, etwa einen USB-Stick oder eine SSD. Es nimmt laufende Daten und Backups auf und schont so die SD-Karte. Sticks mit mehreren Partitionen erscheinen als Gruppe, alte Reste eines Dateisystems werden vor dem Formatieren gelöscht, und ein fehlendes Laufwerk lässt sich ersetzen. Die Leiste des Systemlaufwerks teilt die Belegung in Betriebssystem, Installation, laufende Daten und Backups.", + "image": "dashboard-settings-storage.png", + "doc": "operating/storage.html", "en": "Under Settings, Storage you set up a second drive, such as a USB stick or an SSD. It takes the running data and the backups and so spares the SD card. Sticks with several partitions show as a group, old file system leftovers are wiped before formatting, and a missing drive can be replaced. The bar of the system drive splits its usage into operating system, installation, running data and backups." } }, diff --git a/changelog/highlights/236.json b/changelog/highlights/236.json index 31eff9a3f..157897a77 100644 --- a/changelog/highlights/236.json +++ b/changelog/highlights/236.json @@ -5,6 +5,8 @@ "details": { "*": { "de": "Im Modus Medium schreibt der Installer eine SD-Karte für einen Raspberry Pi, mit WLAN und SSH-Zugang, oder einen Debian-Installationsstick für andere Geräte. Für den Stick braucht das Gerät ein Netzwerkkabel. Das klappt unter Linux, Windows und macOS.", + "image": "installer-media-pi.png", + "doc": "installer.html#preparing-a-storage-medium", "en": "In the medium mode the installer writes an SD card for a Raspberry Pi, with Wi-Fi and SSH access, or a Debian install stick for other devices. The stick needs a network cable on the device. This works on Linux, Windows and macOS." } }, diff --git a/changelog/highlights/238.json b/changelog/highlights/238.json index 02c31edba..8efc279c4 100644 --- a/changelog/highlights/238.json +++ b/changelog/highlights/238.json @@ -5,6 +5,7 @@ "details": { "*": { "de": "Unter Einstellungen, Netzwerk siehst du, ob die Node über LAN oder WLAN verbunden ist, suchst WLAN-Netze und verbindest dich. Schlägt eine Verbindung fehl, kehrt die Node zur bisherigen zurück. Das WLAN kann immer bereit sein oder erst einspringen, wenn das Kabel kein Netz mehr hat, die Node behält dabei ihre Adresse. Fallen Kabel und WLAN aus, öffnet sie einen Notfall-Hotspot, und ein Handy landet nach dem Verbinden von selbst auf einer Seite zum Dashboard.", + "image": "dashboard-settings-network.png", "doc": "dashboard/settings-network.html", "en": "Under Settings, Network you see whether the node is connected over LAN or Wi-Fi, search for Wi-Fi networks and connect. When a connection fails, the node goes back to the previous one. The Wi-Fi can stay ready all the time or step in only when the cable has no network, and the node keeps its address. When cable and Wi-Fi fail, it opens an emergency hotspot, and a phone lands on a page to the dashboard by itself after joining." } diff --git a/changelog/highlights/260.json b/changelog/highlights/260.json index 276d390ac..e96bea1a6 100644 --- a/changelog/highlights/260.json +++ b/changelog/highlights/260.json @@ -5,6 +5,14 @@ "details": { "*": { "de": "Unter Einstellungen, Leistung siehst du, wie stark die Node und ihre Dienste das Gerät auslasten, aufgeschlüsselt bis in Dashboard und Automationen. Pro Dienst wählst du die Abfragerate, der Balken zeigt sofort, was die Auswahl kostet. Nach dem Übernehmen prüft die Seite die Wirkung und bietet bei Überlast die Rücknahme an.", + "image": "dashboard-settings-performance.png", + "crop": [ + 0.22, + 0.09, + 0.76, + 0.56 + ], + "doc": "dashboard/settings-performance.html", "en": "Under Settings, Performance you see how much load the node and its services put on the device, broken down into the dashboard and the automations. You pick the polling rate per service, and the bar shows right away what the choice costs. After applying, the page checks the effect and offers a rollback on overload." } }, diff --git a/changelog/highlights/278.json b/changelog/highlights/278.json index fd3946851..92425c069 100644 --- a/changelog/highlights/278.json +++ b/changelog/highlights/278.json @@ -5,6 +5,8 @@ "details": { "*": { "de": "Die Regelprüfung erkennt doppelte Regeln, Rückkopplung, Konkurrenz um den Überschuss, eine steigende Grundlast und Akkuprobleme. Die Marke an der Regel nennt die Ursache mit einer Grafik und schlägt eine Lösung vor. Gespeichert wird erst, wenn du speicherst.", + "image": "dashboard-automation-finding-popover.png", + "doc": "dashboard/automations-rule-check.html", "en": "The rule check finds duplicate rules, feedback, competition for the surplus, a rising base load and battery problems. The mark on the rule names the cause with a chart and suggests a fix. Nothing is saved until you save." } }, diff --git a/changelog/highlights/279.json b/changelog/highlights/279.json index 2d94c5a99..a62667c90 100644 --- a/changelog/highlights/279.json +++ b/changelog/highlights/279.json @@ -5,6 +5,8 @@ "details": { "*": { "de": "Auf der neuen Seite Lernfunktionen, die Allgemein ersetzt, schaltest du das Lernen ein und aus. Die Node merkt sich, wann Geräte schalten und wer sie schaltet, kennt Gerätezyklen, die PV-Reserve und den Rest-Überschuss des Tages und berücksichtigt Jahreszeit, Sonnenstand und Außentemperatur. Minutenwerte zeichnet sie selbst auf oder übernimmt sie aus Home Assistant. Regeln ändern sich dadurch nie von selbst.", + "image": "dashboard-settings-learning.png", + "doc": "dashboard/automations-learning.html", "en": "On the new Learning page, which replaces General, you switch learning on and off. The node remembers when devices switch and who switches them, knows device cycles, the PV reserve and the remaining surplus of the day, and takes the season, the sun and the outdoor temperature into account. It records minute values itself or takes them from Home Assistant. Rules never change by themselves." } }, diff --git a/changelog/highlights/283.json b/changelog/highlights/283.json index 0344e67ea..8cd9ceda3 100644 --- a/changelog/highlights/283.json +++ b/changelog/highlights/283.json @@ -5,6 +5,8 @@ "details": { "*": { "de": "Ein Band über den Regeln schlägt Regeln vor, die zu deinem Verhalten passen, etwa eine Ausschaltzeit oder eine Regel zum Sonnenuntergang. Vorschläge für Überschuss und Lastverschiebung werden vorher an aufgezeichneten Minuten geprüft. Nach dem Übernehmen zeigt das Monitoring unter Erfolgskontrolle den Wert vorher und seitdem, und eine Regel warnt, wenn ihre Zeiten mit der Jahreszeit wandern.", + "image": "dashboard-automation-suggestions.png", + "doc": "dashboard/automations-learning.html#the-suggestions-band", "en": "A band above the rules suggests rules that fit your habits, such as a switch-off time or a rule at sunset. Suggestions for surplus and load shifts are checked against recorded minutes first. After adopting one, Monitoring shows the value before and since under Results, and a rule warns when its times drift with the season." } }, diff --git a/changelog/highlights/291.json b/changelog/highlights/291.json index ee947b674..7947fbbb2 100644 --- a/changelog/highlights/291.json +++ b/changelog/highlights/291.json @@ -5,6 +5,14 @@ "details": { "*": { "de": "Monitoring sammelt die Meldungen zur Energie-Bilanz, zu den Messketten und zum Lernen an einer Stelle, jede mit empfohlenen Schritten und Quittung. Die Ansicht Prognose zeigt, wie gut die Überschussprognose trifft, mit einem Vergleich zu den Vorjahren. Die Lernwerte erscheinen als üblicher Tag auf einer Zeitachse, nach Anlage und Gerät.", + "image": "dashboard-monitoring-notices.png", + "crop": [ + 0.0, + 0.0, + 1.0, + 0.38 + ], + "doc": "dashboard/monitoring.html", "en": "Monitoring collects the notices about the energy balance, the measurement chains and the learning in one place, each with recommended steps and an acknowledgement. The Forecast view shows how well the surplus forecast hits, with a comparison to earlier years. The learned values appear as a usual day on a timeline, by system and device." } }, diff --git a/dashboard/CHANGELOG.md b/dashboard/CHANGELOG.md index 132b1a45c..dc6f73590 100644 --- a/dashboard/CHANGELOG.md +++ b/dashboard/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## v0.11.23-pre.43 (2026-11-06) +## v0.11.23-pre.44 (2026-11-06) ### Features @@ -563,6 +563,7 @@ ### Documentation +- update the user documentation and screenshots for v0.12.0 (#309) - **automations:** describe replay based energy suggestions (fa34bb8) - **monitoring:** document the monitoring page and add the smoke check (9802fe9) - **storage:** describe the system disk breakdown (b2222d8) @@ -570,6 +571,11 @@ ### Tests +- **docs:** add a learning screenshot group for the persistent demo (fbaefaf) +- **docs:** use the real monitoring view containers in the learning shots (260ee3f) +- **docs:** tidy the device map, learning and storage shots (93a15e6) +- **docs:** hide the whole settings action bar in the learning shot (ba3da98) +- **docs:** hide toasts and the action bar and pick a rule with a learned value (5262e8e) - **autolearn:** prove the region tests against empty ranges (ce30731) - **smoke:** split the main run into four independent runs (fa7e3df) - **demo:** expect a sure effect beside the estimates (aa987aa) @@ -592,7 +598,7 @@ ### Style -- **dashboard:** align the tab hint dots and stop tabs from wrapping (#308) +- **dashboard:** align the tab hint dots and stop tabs from wrapping (#308) (0eddf1b) - **performance:** style the learning row fold (55b33c1) ### Chores diff --git a/dashboard/VERSION b/dashboard/VERSION index 5d211dd8a..6b4db22c7 100644 --- a/dashboard/VERSION +++ b/dashboard/VERSION @@ -1 +1 @@ -v0.11.23-pre.43 +v0.11.23-pre.44 diff --git a/dashboard/test/browser/docs-screenshots.mjs b/dashboard/test/browser/docs-screenshots.mjs index 6ea096274..36f0f2cc7 100644 --- a/dashboard/test/browser/docs-screenshots.mjs +++ b/dashboard/test/browser/docs-screenshots.mjs @@ -18,6 +18,14 @@ // das Layout danach wieder her. Mit demo/demo.sh --docs laufen Tagesband und // Verlauf bereits und bewegen sich. // +// demo/demo.sh --reset +// node dashboard/test/browser/docs-screenshots.mjs --learning +// +// --learning nimmt die Bilder der Lernfunktionen auf (Monitoring, Automationen, +// Effizienz, Energie, Geraetekarte, Einstellungen) und laeuft gegen die dauerhafte +// Demo auf der Standardadresse. Nach demo/demo.sh --reset zuerst 2 min warten, bis +// der erste Lernlauf gelaufen ist. +// // Ohne Namen werden alle Bilder ausser dashboard-history, // dashboard-settings-versions, dashboard-statistics, dashboard-statistics-mobile und dashboard-service-logs geschrieben. Namen als Argumente begrenzen den // Lauf auf genau diese Bilder. @@ -40,6 +48,7 @@ function parseArgs(argv) { password: 'smoketest1234', history: false, cards: false, + learning: false, recordMinutes: null, names: [], }; @@ -48,6 +57,7 @@ function parseArgs(argv) { const [flag, inlineValue] = argv[i].split(/=(.*)/s); if (flag === '--history') { args.history = true; continue; } if (flag === '--cards') { args.cards = true; continue; } + if (flag === '--learning') { args.learning = true; continue; } const value = inlineValue ?? argv[++i]; if (flag === '--url') args.url = value.replace(/\/$/, ''); else if (flag === '--out') args.out = path.resolve(value); @@ -60,7 +70,9 @@ function parseArgs(argv) { } const args = parseArgs(process.argv.slice(2)); -const OPT_IN = ['dashboard-history', 'dashboard-settings-versions', 'dashboard-statistics', 'dashboard-statistics-mobile', 'dashboard-service-logs']; +// dashboard-config nur auf Zuruf: die Docs-Fixture hat keinen Eintrag in der Batterie-Konfiguration, +// das Bild zeigt dann ein leeres Formular. Das heutige Bild stammt aus der Zeit davor. +const OPT_IN = ['dashboard-config', 'dashboard-history', 'dashboard-settings-versions', 'dashboard-statistics', 'dashboard-statistics-mobile', 'dashboard-service-logs']; const want = (name) => (args.names.length ? args.names.includes(name) : !OPT_IN.includes(name)); await mkdir(args.out, { recursive: true }); @@ -108,7 +120,17 @@ async function session(width, height, { tour = false } = {}) { async function tab(page, name) { if (name === 'overview') await page.locator('button.tab.is-page').first().click(); - else await page.locator('#tab-' + name).first().click(); + else { + const button = page.locator('#tab-' + name).first(); + if (await button.isVisible()) await button.click(); + // Passt der Reiter nicht in die Leiste, liegt er im Menue "Mehr". + else { + // Nur der erste Textknoten, dahinter folgt Text fuer Vorleseprogramme. + const label = await button.evaluate((el) => el.firstChild.textContent.trim()); + await page.locator('.nav-more-toggle').click(); + await page.locator('#dashboard-more-list [role="menuitem"]', { hasText: label }).click(); + } + } await page.waitForTimeout(3000); } @@ -311,6 +333,7 @@ async function all() { await deviceMapShowcase(); await deviceModalShowcase(); await layoutEditorShowcase(); + await overviewShowcase(); if (want('dashboard-statistics')) { // Needs the fake companion (--fake-companion): it feeds the hourly values. @@ -367,7 +390,6 @@ async function all() { } const subpages = [ - ['dashboard-settings-general', 'settings-general', 819], ['dashboard-settings-backup', 'settings-backup', 1300], ['dashboard-settings-checklist', 'settings-checklist', 1100, async (page) => { await page.locator('#settings-checklist .ob-cl-switch').getByText('Set up', { exact: true }).click(); @@ -618,6 +640,76 @@ async function all() { } } +// Ganze Seite ab der Tab-Leiste, fuer die Uebersichtsbilder am Anfang einer Doku-Seite. +async function overviewShot(page, name) { + await page.mouse.move(1, 1); + await scrollToTabs(page); + await shot(page, name); +} + +// Uebersichtsbilder, die die Fixture von --docs brauchen. +async function overviewShowcase() { + if (want('dashboard-automation-scenarios')) { + const s = await session(1280, 900); + await tab(s.page, 'automations'); + await s.page.locator('#automations-tab-scenarios').click(); + await s.page.waitForTimeout(1500); + if (await s.page.locator('li.auto-scenario').count() === 0) { + await createZeroFeedInScenario(s.page); + await s.page.reload({ waitUntil: 'networkidle' }); + await s.page.waitForTimeout(2500); + await tab(s.page, 'automations'); + await s.page.locator('#automations-tab-scenarios').click(); + await s.page.waitForTimeout(1500); + } + const row = s.page.locator('li.auto-scenario').first().locator('.auto-scenario-row'); + if (await row.count() > 0) await row.click(); + await s.page.waitForTimeout(1500); + await overviewShot(s.page, 'dashboard-automation-scenarios'); + await s.ctx.close(); + } + if (want('dashboard-energy')) { + const s = await session(1110, 1000); + await tab(s.page, 'energy'); + await overviewShot(s.page, 'dashboard-energy'); + await s.ctx.close(); + } + if (want('dashboard-cards')) await cardsOverview(); +} + +// Eine eigene Layout-Seite mit verschiedenen Karten, danach wird das Layout wiederhergestellt. +async function cardsOverview() { + const s = await session(1280, 1150); + const api = `${args.url}/api/v1/layout`; + const original = await (await s.ctx.request.get(api)).json(); + const csrf = (await (await s.ctx.request.get(`${args.url}/api/v1/auth/session`)).json()).csrf_token; + const put = (doc) => s.ctx.request.put(api, { data: { version: doc.version, pages: doc.pages }, headers: { 'X-CSRF-Token': csrf } }); + const entries = [ + ['energy_ring', {}], ['battery_status', { display: 'column' }], ['diagnostics', {}], + ['entity_value', { ref: 'bank_a_voltage' }], + ['entity_group', { title: 'Battery banks', entity_refs: ['bank_a_voltage', 'bank_b_voltage', 'bank_soc'] }], + ['device', { ref: 'wallbox', display: 'detail' }], + ['energy_band', {}], + ]; + const items = entries.map(([type, extra]) => ({ + id: `overview-${type}`, type, span: String(original.card_types[type].min_span), visible: true, ...extra, + })); + const page = { id: 'docs-overview', name: 'Cards', order: original.pages.length, groups: [{ id: 'docs-overview-all', name: 'Cards', items }] }; + const res = await put({ version: original.version, pages: [...original.pages, page] }); + if (!res.ok()) throw new Error(`Layout abgelehnt: ${res.status()} ${await res.text()}`); + try { + await s.page.goto(`${args.url}/`, { waitUntil: 'networkidle' }); + await s.page.waitForTimeout(2500); + await s.page.locator('button.tab.is-page', { hasText: 'Cards' }).first().click(); + await s.page.waitForTimeout(5000); + await overviewShot(s.page, 'dashboard-cards'); + } finally { + const current = await (await s.ctx.request.get(api)).json(); + await put({ version: current.version, pages: original.pages }); + await s.ctx.close(); + } +} + // Die ganze Anordnung der Device Map ins Bild holen und dann zur Ecke unten // links hin verkleinern: oben liegt die Werkzeugleiste ueber der Flaeche, // rechts bei offenem Panel das Panel. ratio < 1 laesst dafuer Platz. @@ -880,6 +972,329 @@ async function deviceMapShowcase() { await s.ctx.close(); } +// Wartet auf den Anker eines Bildes. Fehlt er, bricht der Lauf mit dem Bildnamen ab. +// "attached" statt "visible", weil Lernwerte in eingeklappten Regeln verborgen sind. +async function need(locator, name, what) { + await locator.first().waitFor({ state: 'attached', timeout: 20000 }).catch(() => { throw new Error(`${name}: ${what} fehlt`); }); +} + +// Eine Sitzung je Bild, die Sitzung schliesst auch bei einem Fehler. +async function learningShot(name, width, height, run) { + if (!want(name)) return; + const s = await session(width, height); + // Warnmeldungen und die schwebende Aktionsleiste stoeren in allen Lernbildern. + const hide = '.notification-toasts, .energy-actionbar-dock { display: none !important; }'; + await s.ctx.addInitScript((css) => { + document.addEventListener('DOMContentLoaded', () => { + const st = document.createElement('style'); + st.textContent = css; + document.head.appendChild(st); + }); + }, hide); + await s.page.addStyleTag({ content: hide }); + try { + await run(s.page, name); + } finally { + await s.ctx.close(); + } +} + +// Schaltet die Ansicht ueber den Reiter mit dem data-tour-Anker (role="tab") um. +async function monitoringView(page, name, tourId) { + const button = page.locator(`#monitoring-panel [data-tour="${tourId}"]`); + await need(button, name, `[data-tour="${tourId}"]`); + await button.click(); + await page.waitForTimeout(2000); +} + +// Die sichtbare Ansicht des Monitorings (Meldungen, Lernwerte oder Prognose). +function monitoringContent(page) { + return page.locator('#monitoring-panel .monitoring-view:visible'); +} + +async function settingsPage(page, id) { + await tab(page, 'settings'); + await page.locator(`#settings-panel [role="tab"][aria-controls="${id}"]`).click(); + await page.waitForTimeout(2000); + await page.mouse.move(1, 1); +} + +// Die Bilder der Lernfunktionen fuer die dauerhafte Demo (demo/demo.sh --reset). +async function learning() { + await learningShot('dashboard-monitoring-notices', 1280, 900, async (page, name) => { + await tab(page, 'monitoring'); + const list = page.locator('[data-tour="monitoring-list"]'); + await need(list, name, '[data-tour="monitoring-list"]'); + await need(list.locator('.monitoring-li'), name, 'erste Meldung (.monitoring-li)'); + await list.locator('.monitoring-li').first().click(); + await page.waitForTimeout(1500); + await page.mouse.move(1, 1); + const box = monitoringContent(page); + await need(box, name, '#monitoring-panel .monitoring-view'); + await element(box, name); + }); + + await learningShot('dashboard-monitoring-learned', 1280, 900, async (page, name) => { + await tab(page, 'monitoring'); + await monitoringView(page, name, 'monitoring-learned'); + await page.mouse.move(1, 1); + const box = monitoringContent(page); + await need(box, name, '#monitoring-panel .monitoring-view:visible'); + await element(box, name); + }); + + await learningShot('dashboard-monitoring-forecast', 1280, 1100, async (page, name) => { + await tab(page, 'monitoring'); + await monitoringView(page, name, 'monitoring-forecast'); + await page.mouse.move(1, 1); + const box = monitoringContent(page); + await need(box, name, '#monitoring-panel .monitoring-view:visible'); + await element(box, name); + }); + + await learningShot('dashboard-automation-suggestions', 1280, 900, async (page, name) => { + await tab(page, 'automations'); + const band = page.locator('[data-tour="auto-learn-band"]'); + await need(band, name, '[data-tour="auto-learn-band"]'); + await need(band.locator('.auto-learn-tile'), name, 'erste Karte (.auto-learn-tile)'); + await band.locator('.auto-learn-tile').first().click(); + await page.waitForTimeout(1500); + await page.mouse.move(1, 1); + await element(band, name); + }); + + await learningShot('dashboard-automation-finding-popover', 1280, 900, async (page, name) => { + // Die Demo bekommt die Lernregeln ueber die Konsole, danach die Seite neu laden. + const inserted = await fetch(`${args.consoleUrl}/api/autolearn/insert_all`, { + method: 'POST', headers: { 'content-type': 'application/json' }, body: '{}', + }); + if (!inserted.ok) throw new Error(`Lernregeln einfuegen: HTTP ${inserted.status}`); + await page.reload({ waitUntil: 'networkidle' }); + await page.waitForTimeout(2500); + await tab(page, 'automations'); + await page.locator('#automations-tab-rules').click(); + await page.waitForTimeout(1000); + // Nur die Marken der Regeln, sichtbar: Szenarien haben eigene Marken, die hier verborgen sind. + const mark = page.locator('[data-tour="rule-item"] .auto-learn-mark:visible').first(); + await need(mark, name, '.auto-learn-mark'); + await mark.click(); + await page.waitForTimeout(1200); + await page.mouse.move(1, 1); + // Mehrere Popover tragen den Anker, das erste sichtbare ist das geoeffnete. + const pop = page.locator('[data-tour="rule-finding-pop"]:visible').first(); + await need(pop, name, '[data-tour="rule-finding-pop"]'); + await element(pop, name); + }); + + await learningShot('dashboard-automation-learned-value', 1280, 900, async (page, name) => { + await tab(page, 'automations'); + await page.locator('#automations-tab-rules').click(); + await page.waitForTimeout(1000); + // Die Demo-Regel mit einem gelernten Zeitfenster. Aufgeklappt zeigt sie den Lernwert, + // sonst wird ihr Bearbeiten-Modus geoeffnet. + const item = page.locator('[data-tour="rule-item"]', { hasText: 'Balkonsteckdose zur üblichen Zeit aus' }).first(); + await need(item, name, 'Regel Balkonsteckdose zur üblichen Zeit aus'); + await item.locator('.automation-rule-head').first().click(); + await page.waitForTimeout(1200); + const learned = item.locator('[data-tour="rule-learned-value"]'); + if (await learned.count() === 0 || !await learned.first().isVisible()) { + const edit = item.getByRole('button', { name: 'Edit', exact: true }).first(); + if (await edit.count()) await edit.click(); + else await item.locator('.automation-rule-head button[aria-pressed]').first().click(); + await page.waitForTimeout(1500); + } + await need(learned, name, '[data-tour="rule-learned-value"] in der Regel'); + await page.mouse.move(1, 1); + await element(item, name); + }); + + await learningShot('dashboard-efficiency', 1280, 1100, async (page, name) => { + await tab(page, 'efficiency'); + await need(page.locator('[data-tour="efficiency-page"]'), name, '[data-tour="efficiency-page"]'); + const chain = page.locator('.efficiency-item', { hasText: 'Balkonspeicher' }).first(); + await need(chain, name, 'Kette Balkonspeicher (.efficiency-item)'); + await chain.click(); + await page.waitForTimeout(2500); + await page.mouse.move(1, 1); + await scrollToTabs(page); + await shot(page, name); + }); + + await learningShot('dashboard-energy-chains', 1280, 900, async (page, name) => { + await tab(page, 'energy'); + const toggle = page.locator('[data-tour="energy-chains-toggle"]'); + await need(toggle, name, '[data-tour="energy-chains-toggle"]'); + if (await toggle.getAttribute('aria-expanded') !== 'true') await toggle.click(); + await page.waitForTimeout(1200); + await page.mouse.move(1, 1); + const section = page.locator('[data-tour="energy-chains"]'); + await need(section, name, '[data-tour="energy-chains"]'); + await element(section, name); + }); + + await learningShot('dashboard-device-map-losses', 1280, 928, async (page, name) => { + await tab(page, 'devicemap'); + const losses = page.locator('[data-tour="devicemap-layer-losses"]'); + await need(losses, name, '[data-tour="devicemap-layer-losses"]'); + if (await losses.getAttribute('aria-pressed') !== 'true') await losses.click(); + await page.waitForTimeout(2500); + // Toasts schliessen und die Hinweise zu neuen Positionen ausblenden, wie bei den Ebenen-Bildern. + await page.locator('.notification-toasts button').evaluateAll((bs) => bs.forEach((b) => b.click())).catch(() => {}); + await page.waitForTimeout(500); + await page.evaluate(() => { + const panel = window.Alpine.$data(document.querySelector('#devicemap-panel')); + panel.placedCount = 0; + panel.unsaved = false; + }); + await page.mouse.move(1, 1); + // Ausschnitt auf die Knoten, an denen Verluste stehen. Oben bleibt Platz fuer die Werkzeugleiste. + const framed = await page.evaluate(() => { + const cy = document.querySelector('#devicemap-panel [x-ref="canvas"]')._cyreg.cy; + const nodes = cy.elements('.devicemap-loss').connectedNodes(); + if (nodes.length === 0) return 0; + cy.fit(nodes, 110); + cy.zoom({ level: Math.min(cy.zoom(), 1.6), renderedPosition: { x: cy.width() / 2, y: cy.height() / 2 } }); + cy.panBy({ x: 0, y: 40 }); + return nodes.length; + }); + if (framed === 0) throw new Error(`${name}: keine Verlustkanten (.devicemap-loss)`); + await page.waitForTimeout(800); + await element(page.locator('#devicemap-panel .devicemap-stage'), name); + }); + + await learningShot('dashboard-settings-learning', 1280, 1000, async (page, name) => { + await settingsPage(page, 'settings-general'); + // Der schwebende Speichern-Knopf verdeckt die Karte. + const record = page.locator('[data-tour="learning-record"]'); + await need(record, name, '[data-tour="learning-record"]'); + await element(record, name); + }); + + await learningShot('dashboard-settings-network', 1280, 1000, async (page, name) => { + await settingsPage(page, 'settings-network'); + const overview = page.locator('[data-tour="network-overview"]'); + await need(overview, name, '[data-tour="network-overview"]'); + await element(overview, name); + }); + + await learningShot('dashboard-settings-storage', 1280, 1100, async (page, name) => { + await settingsPage(page, 'settings-storage'); + const overview = page.locator('[data-tour="storage-overview"]'); + await need(overview, name, '[data-tour="storage-overview"]'); + await element(overview, name); + }); + + await learningShot('dashboard-settings-performance', 1280, 1100, async (page, name) => { + await settingsPage(page, 'settings-performance'); + await scrollToTabs(page); + await shot(page, name); + }); + + await learningShot('dashboard-monitoring', 1280, 1000, async (page, name) => { + await tab(page, 'monitoring'); + const items = page.locator('[data-tour="monitoring-list"] .monitoring-li'); + await need(items, name, 'erste Meldung (.monitoring-li)'); + await items.first().click(); + await page.waitForTimeout(1500); + await overviewShot(page, name); + }); + + await learningShot('dashboard-learning-results', 1280, 900, async (page, name) => { + await tab(page, 'monitoring'); + await page.locator('#monitoring-panel').getByRole('button', { name: /^\s*Results check/ }).first().click(); + await page.waitForTimeout(1000); + const items = page.locator('[data-tour="monitoring-list"] .monitoring-li:visible'); + await need(items, name, 'Meldung der Ergebnispruefung'); + await items.first().click(); + await page.waitForTimeout(1500); + await overviewShot(page, name); + }); + + await learningShot('dashboard-what-is-learned', 1280, 1000, async (page, name) => { + await tab(page, 'monitoring'); + await monitoringView(page, name, 'monitoring-learned'); + // Eine Zeile oeffnet den Jahresverlauf. + await monitoringContent(page).getByText('Plug Balcony', { exact: true }).first().click(); + await page.waitForTimeout(1500); + await overviewShot(page, name); + }); + + for (const [name, id] of [['dashboard-settings', 'settings-display'], ['dashboard-settings-storage-page', 'settings-storage'], + ['dashboard-settings-learning-page', 'settings-general'], ['dashboard-settings-network-page', 'settings-network']]) { + await learningShot(name, 1280, 1000, async (page) => { + await settingsPage(page, id); + if (id === 'settings-storage') { + // Die Demo laeuft nicht auf einer SD-Karte, die Karte zeigte nur "nicht verfuegbar". + await page.locator('#settings-storage .setting-card', { has: page.getByRole('heading', { name: 'Storage health' }) }) + .evaluateAll((cards) => cards.forEach((c) => { c.style.display = 'none'; })); + } + await overviewShot(page, name); + }); + } + + // Nach den Bildern ohne Zusatzregeln: das Einfuegen aendert die Demo. + await learningShot('dashboard-automation-rules', 1280, 1000, async (page, name) => { + await insertLearningRules(page); + await overviewShot(page, name); + }); + + await learningShot('dashboard-automation-rule-check', 1280, 1100, async (page, name) => { + await insertLearningRules(page); + await scrollToTabs(page); + const item = page.locator('[data-tour="rule-item"]', { has: page.locator('.auto-learn-mark:visible') }).first(); + const mark = item.locator('.auto-learn-mark:visible').first(); + await need(mark, name, '.auto-learn-mark'); + await mark.click(); + await page.waitForTimeout(1200); + await page.mouse.move(1, 1); + // Die Regelzeile mit der Marke und das ganze Popover, mit etwas Rand. + const pop = page.locator('[data-tour="rule-finding-pop"]:visible').first(); + await need(pop, name, '[data-tour="rule-finding-pop"]'); + const row = await item.locator('.automation-rule-head').first().boundingBox(); + const box = await pop.boundingBox(); + const x = Math.min(row.x, box.x) - 16; + const y = row.y - 16; + const width = Math.max(row.x + row.width, box.x + box.width) + 16 - x; + const height = box.y + box.height + 16 - y; + await page.screenshot({ path: path.join(args.out, `${name}.png`), clip: { x, y, width, height } }); + console.log('geschrieben:', name); + }); + + await learningShot('dashboard-automation-learning', 1280, 1000, async (page, name) => { + await tab(page, 'automations'); + const tiles = page.locator('[data-tour="auto-learn-band"] .auto-learn-tile'); + await need(tiles, name, 'erste Karte (.auto-learn-tile)'); + await tiles.first().click(); + await page.waitForTimeout(1500); + await overviewShot(page, name); + }); + + await learningShot('dashboard-automation-learned-values', 1280, 1000, async (page, name) => { + await insertLearningRules(page); + const item = page.locator('[data-tour="rule-item"]', { hasText: 'Balkonsteckdose zur üblichen Zeit aus' }).first(); + await need(item, name, 'Regel Balkonsteckdose zur üblichen Zeit aus'); + await item.locator('.automation-rule-head').first().click(); + await page.waitForTimeout(1500); + await page.mouse.move(1, 1); + await page.evaluate((el) => window.scrollTo(0, el.getBoundingClientRect().top + window.scrollY - 12), await item.elementHandle()); + await page.waitForTimeout(600); + await shot(page, name); + }); +} + +// Fuegt die Lernregeln ueber die Konsole ein und oeffnet die Einzelregeln. +async function insertLearningRules(page) { + const inserted = await fetch(`${args.consoleUrl}/api/autolearn/insert_all`, { + method: 'POST', headers: { 'content-type': 'application/json' }, body: '{}', + }); + if (!inserted.ok) throw new Error(`Lernregeln einfuegen: HTTP ${inserted.status}`); + await page.reload({ waitUntil: 'networkidle' }); + await page.waitForTimeout(2500); + await tab(page, 'automations'); + await page.locator('#automations-tab-rules').click(); + await page.waitForTimeout(1500); +} + // Eine Karte je Typ in ihrer Mindestbreite (min_span Spalten) auf einer // eigenen Layout-Seite. Die Spalten werden auf das Rastermindestmass 18rem // festgesetzt, Karten mit fills_height auf ihre Mindesthoehe. Karten ohne @@ -940,6 +1355,7 @@ async function cards() { try { if (args.history) await history(); else if (args.cards) await cards(); + else if (args.learning) await learning(); else await all(); } finally { await browser.close(); diff --git a/docs/_data/nav.yml b/docs/_data/nav.yml index 843ef5725..58f1aabb1 100644 --- a/docs/_data/nav.yml +++ b/docs/_data/nav.yml @@ -36,9 +36,12 @@ - { label: "Device dialog", url: "dashboard/device-modal.md" } - { label: "History", url: "dashboard/history.md" } - { label: "Statistics", url: "dashboard/statistics.md" } - - { label: "Energy", url: "dashboard/energy.md" } + - { label: "Efficiency", url: "dashboard/efficiency.md" } - { label: "Device map", url: "dashboard/device-map.md" } - { label: "Monitoring", url: "dashboard/monitoring.md" } + - { label: "Configuration editor", url: "dashboard/configuration.md" } + - { label: "Energy", url: "dashboard/energy.md" } + - { label: "Diagnostics", url: "dashboard/diagnostics.md" } - label: "Automations" url: "dashboard/automations.md" children: @@ -46,21 +49,26 @@ - { label: "Templates", url: "dashboard/automations-templates.md" } - { label: "Scenarios", url: "dashboard/automations-scenarios.md" } - { label: "Single rules", url: "dashboard/automations-rules.md" } - - { label: "Learning", url: "dashboard/automations-learning.md" } - - { label: "Diagnostics", url: "dashboard/diagnostics.md" } - - { label: "Configuration editor", url: "dashboard/configuration.md" } + - { label: "Learned values", url: "dashboard/automations-learned-values.md" } + - { label: "Rule check", url: "dashboard/automations-rule-check.md" } + - { label: "Suggestions", url: "dashboard/automations-learning.md" } + - { label: "What the node learns", url: "dashboard/automations-what-is-learned.md" } + - { label: "Results and learning data", url: "dashboard/automations-learning-results.md" } - label: "Settings" url: "dashboard/settings.md" children: - { label: "Appearance", url: "dashboard/settings-appearance.md" } - { label: "History", url: "dashboard/settings-history.md" } + - { label: "Learning features", url: "dashboard/settings-learning.md" } + - { label: "Network", url: "dashboard/settings-network.md" } - { label: "MQTT", url: "dashboard/settings-mqtt.md" } - { label: "Tailscale & TinyTuya", url: "dashboard/settings-wizards.md" } - - { label: "Network", url: "dashboard/settings-network.md" } - { label: "Users", url: "dashboard/settings-users.md" } - { label: "Backup", url: "dashboard/settings-backup.md" } - - { label: "Checklist", url: "dashboard/settings-checklist.md" } + - { label: "Storage", url: "dashboard/settings-storage.md" } + - { label: "Performance", url: "dashboard/settings-performance.md" } - { label: "Versions & updates", url: "dashboard/settings-versions.md" } + - { label: "Checklist", url: "dashboard/settings-checklist.md" } - { label: "System", url: "dashboard/settings-system.md" } - { label: "Colour schemes", url: "dashboard/themes.md" } - label: "Device services" diff --git a/docs/assets/css/site.css b/docs/assets/css/site.css index 730677451..451b068dc 100644 --- a/docs/assets/css/site.css +++ b/docs/assets/css/site.css @@ -153,6 +153,14 @@ img { max-width: 100%; height: auto; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .entry-card__icon img { filter: invert(1); } } +/* Hand-drawn SVG sketches (`{: .sketch}` in the Markdown) are drawn in black. + An does not inherit the page colour, so dark mode inverts them and the + hue rotation keeps the accent green. */ +.doc-body img.sketch { display: block; max-width: 100%; height: auto; } +:root[data-theme="dark"] .doc-body img.sketch { filter: invert(1) hue-rotate(180deg); } +@media (prefers-color-scheme: dark) { + :root:not([data-theme="light"]) .doc-body img.sketch { filter: invert(1) hue-rotate(180deg); } +} /* Pagefind UI inside the header. */ .site-header__search .pagefind-ui { diff --git a/docs/dashboard/automations-assistant.md b/docs/dashboard/automations-assistant.md index 21dcff0d7..2241c714d 100644 --- a/docs/dashboard/automations-assistant.md +++ b/docs/dashboard/automations-assistant.md @@ -4,10 +4,10 @@ title: "Automations: Assistant" # Automations: Assistant -## Assistant - ![The assistant with its templates](../images/dashboard-automation-assistant.png) +## Assistant + **Assistant** in the bar above the list opens the assistant. It is the only way to add an entry. It builds a scenario or a rule from a few questions, so you do not need to know the fields. diff --git a/docs/dashboard/automations-learned-values.md b/docs/dashboard/automations-learned-values.md new file mode 100644 index 000000000..047b509a6 --- /dev/null +++ b/docs/dashboard/automations-learned-values.md @@ -0,0 +1,87 @@ +--- +title: "Automations: Learned values" +--- + +# Automations: Learned values + +![A rule with a learned time window](../images/dashboard-automation-learned-values.png) + +Some fields of a rule can take a learned value instead of a fixed number or +time. The node learns the value from your devices and your house, and the rule +uses it as soon as it is known. A rule still never changes by itself. The rule +keeps the learned value only because you chose it in the editor. + +## Which fields take a learned value + +Each of these fields has a switch between **Fixed value** and **Learned value**: + +- the threshold of a balance condition, +- the value of a topic or entity condition, with **above** or **below** only, +- the start and the end of a time window, +- the hold time of every condition except the chain conditions. + +## Bounds, fallback and shift + +![A time window that follows a learned switch off time, with its bounds, fallback, shift and origin line](../images/dashboard-automation-learned-value.png) + +A learned value always needs three settings: + +- **At least** and **At most** for numbers, or **Earliest** and **Latest** for + times. The learned value is kept between these bounds. +- **Without a learned value** is the fallback. It applies when nothing has been + learned yet, when the stored value cannot be read, or when it is older than 7 + days. The fallback must lie between the bounds, and the minimum must not be + above the maximum. The editor says so if it is not. +- **Shift** is optional. It is added after the value has been kept within the + bounds, in the unit of the field, so minutes for times. A shift lets a time + window keep its length, because its end moves with its start. + +The age limit is `max_age_s` in the rule file. It defaults to 604800 seconds, +which is 7 days. Older values count as missing, and the fallback applies. + +## The house is quiet + +The condition type **House state** is met when the learned house state equals +**House is quiet** or **House is active**. Without a fresh value, the choice +**Without a fresh value** applies. The template **Off when the house is quiet** +switches a device off in that case. It sets its age limit to 2 hours (7200 +seconds) instead of 7 days. + +## What the rule card shows + +A condition that takes a learned value shows three things: + +- a chip with the name of the learned value and its current value, +- a range scale with the bounds and the current value, +- an origin line that says where the value comes from. It reads **Learned from + N days** or **Learned from N runs**, with the time since the last change. When + the value was clamped, it reads **Set to the bound, the learned value is ...**. + When the fallback applies, it reads **Fallback value, because nothing has been + learned yet or the value is too old**. + +## Year course of a learned value + +The rule card draws the course of a learned value over the year as a small line +under its scale. A sentence names the month with the highest value and the month +with the lowest. The line appears from 8 weeks of data on. + +## Learned value condition + +The condition type **Learned value** compares a learned number with a +threshold. Use it for numbers such as the PV reserve. The condition is met +when the learned number is **above** or **below** the threshold. The threshold +is a fixed number, or a reference to another learned value with its bounds. +You choose the type in the rule editor, and in scenarios too. + +| Field | Meaning | +|---|---| +| `learned` | The learned number, for example `site/pv_reserve_w` | +| `comparison` | `above` or `below` | +| `threshold` | A fixed number, or a learned reference | +| `hysteresis` | Gap around the threshold, so the condition does not flicker | +| `fallback` | The number compared when the learned value is missing or older than `max_age_s` | +| `max_age_s` | Age limit in seconds, 604800 (7 days) by default | +| `hold_seconds` | Time the condition must stay met before it counts | + +The hysteresis works as for balance conditions. With **above** the condition +turns on at the threshold and turns off at the threshold minus the hysteresis. diff --git a/docs/dashboard/automations-learning-results.md b/docs/dashboard/automations-learning-results.md new file mode 100644 index 000000000..407af5b01 --- /dev/null +++ b/docs/dashboard/automations-learning-results.md @@ -0,0 +1,105 @@ +--- +title: "Automations: Results and learning data" +--- + +# Automations: Results and learning data + +![A results check on the Monitoring tab](../images/dashboard-learning-results.png) + +*The picture shows how the Monitoring tab presents a result. The check itself runs in the background and does not need that tab.* + +Once you adopt a suggestion, the node measures what it changed. + +## Results check + +![Timeline of the results check: up to four weeks of baseline, the partial week of the change, then eight weeks of measured effect](../images/results-check-timeline.svg){: .sketch} + +- The first effect appears in the first full calendar week after the change. + Until then the mark on the rule says **Effect visible from** and a date. +- The comparison uses up to four full weeks before the change as the baseline. + At least two of them need data on five days. +- Each week is measured in one unit. Device energy is shown in kWh per week, + manual actions in actions per week. For energy suggestions the measure is the + grid share of the device energy. +- The expected value of each week comes from the same calendar week of the year + before. Without these earlier figures, energy suggestions use the PV curve + instead, and the other suggestions use no season correction. The effect is + then marked **Estimate**. Manual actions have no season correction and are + therefore always an estimate. +- The result shows the value before the change and the value since, and the + number of times you overrode the rule by hand. +- Every rule and scenario that came from a suggestion shows an info mark with its + result. +- After **Delete learned data** the mark of an adopted rule says **No comparison + data**, because the days before the change are gone. +- When the range of the effect includes zero, the result says **Not measurable + yet** instead of a number. This happens when the week varies more than the + effect. +- [Monitoring](monitoring.md#notices) lists each measured result under **Results + check** for eight weeks after the change, with its confidence. **Acknowledge** + moves it to the acknowledged notices. A result is not a suggestion, so the + suggestion band does not show it. + +## Season drift + +Each night the node checks whether the values of an adopted suggestion still +fit. Four things can drift: a switch time, a surplus window, the consumption +while away and a proposed threshold. The comparison uses one value per night, +over up to 28 nights. When the difference stays in one direction, the rule gets +a finding such as **Rule: the switching time has moved**, with the old and the +new value. A fix for a threshold changes the value in the rule. The other fixes +open the assistant, which replaces the rule, or the scenario for a surplus +window. Nothing is stored until you save. + +## Where a switch came from + +The learning features record where each switching command comes from. The +dashboard tells a rule from a hand switch and from an outside change. A command +sent through the dashboard is a hand switch, and everything else counts as +outside. The daily profiles hold these origins in 15 minute steps and are kept +for 56 days by default, see [Recording](settings-learning.md#recording). Nothing changes +a rule by itself. Learned patterns only appear as suggestions. + +## What is kept + +- **Daily profiles** hold, per device, one value for each of the 96 quarter hours + of a day, and the site values. They are the base of the habit and energy + suggestions. They are kept for 56 days by default, and at least 14 days. +- **Minute values** are optional. They hold the power of every minute and the + switch events with their origin. The node tells apart switches made by a rule, + by hand in the dashboard, and from outside, such as a wall switch or a + manufacturer app. The minute values are kept in memory, on an extra drive or on + the system drive. The settings card explains the choice, see + [Recording](settings-learning.md#recording). +- **Home Assistant** can be the source of the minute values when the Companion is + connected. After a restart, the node fetches the gaps from Home Assistant when + it needs them. These fetched values are not stored. +- **Seasonal data** keeps weekly figures for the season, so that a season can be + compared with the year before. + +## What the backup contains + +The backup includes the learning state, the daily profiles, the season memory, +the rule trigger counts, the hidden findings, the suggestion state and the +measured effects of adopted suggestions. It also +includes the PV model and forecast files, the cycle data, the chain data and the +automation history. The minute values are not part of the backup. The node +learns them again. + +## Deleting the learned data + +**Delete learned data** on the settings page asks for confirmation first. It +deletes the learned values, which are also cleared on MQTT, the daily profiles, +the minute values, the PV model and weather data, the forecast, the cycle data, +the reaction times, the chain data and the measured effects of adopted +suggestions. The node starts learning again afterwards. + +The following stay: + +- the season memory, so a season is still known after the reset, +- the rule trigger counts that the rule check uses, +- dismissed suggestions and **Later** postponements, +- hidden findings from **Ignore**, +- your settings, including the learning switches. + +The reset needs the permission `edit_setup`. diff --git a/docs/dashboard/automations-learning.md b/docs/dashboard/automations-learning.md index 95abfc8c3..44c57e0ca 100644 --- a/docs/dashboard/automations-learning.md +++ b/docs/dashboard/automations-learning.md @@ -1,14 +1,33 @@ --- -title: "Automations: Learning" +title: "Automations: Suggestions" +anchor_moves: + what-the-node-learns: automations-what-is-learned.html + what-is-learned: automations-what-is-learned.html#what-is-learned + seasons-and-the-sun: automations-what-is-learned.html#seasons-and-the-sun + outdoor-temperature-and-heating-season: automations-what-is-learned.html#outdoor-temperature-and-heating-season + energy-learned-values: automations-what-is-learned.html#energy-learned-values + shade-on-the-pv-curve: automations-what-is-learned.html#shade-on-the-pv-curve + away-suggestion: automations-what-is-learned.html#away-suggestion + learned-values-in-conditions: automations-learned-values.html + results-check-and-season-drift: automations-learning-results.html + results-check: automations-learning-results.html#results-check + season-drift: automations-learning-results.html#season-drift + recording-storage-and-privacy: automations-learning-results.html + where-a-switch-came-from: automations-learning-results.html#where-a-switch-came-from + what-is-kept: automations-learning-results.html#what-is-kept + what-the-backup-contains: automations-learning-results.html#what-the-backup-contains + deleting-the-learned-data: automations-learning-results.html#deleting-the-learned-data --- -# Automations: Learning +# Automations: Suggestions + +![The Automations page with an open suggestion](../images/dashboard-automation-learning.png) The node watches how you use your devices and how your rules behave. From that it makes suggestions for rules, measures what an adopted suggestion changed, and keeps learned values that rules can use. This page gives the overview. The details of single rules are in [Single rules](automations-rules.md), the -settings are in [Learning features](settings.md#learning-features). +settings are in [Learning features](settings-learning.md). ## What the node never does @@ -22,6 +41,8 @@ nothing new. ## The suggestions band +![The suggestions band with an open suggestion](../images/dashboard-automation-suggestions.png) + The band sits above the list on the **Automations** page. - It shows up to three suggestions side by side. **+N** counts the rest, up to @@ -45,22 +66,11 @@ Until the first pattern is reliable on at least 10 days, the band reads **Learning for N days from M devices** and shows no suggestions. When **Learn patterns** is off, the band is hidden. -## Marks on rules - -A rule with open findings shows a mark in its header. The colour of the mark -shows how serious the finding is, from a note to a warning to an error. - -- A click opens a popover with the cause, a before and after graphic and the - prepared fixes, for example **Hysteresis 100 W** or **Threshold to 350**. - A fix changes only the draft in the browser. -- **Ignore** hides the finding for this rule. The page shows **Finding hidden** - with **Undo**. Ignored findings stay hidden after a reload. +A rule with open findings shows a mark in its header. The popover, the fixes and **Ignore** are described in [The mark and the popover](automations-rule-check.md#the-mark-and-the-popover). ## Kinds of suggestions and findings -The tables give the minimum data each kind needs before it can appear. The -numbers are the limits in the code, so they may differ slightly from the -description in the design notes. +The tables give the minimum data each kind needs before it can appear. ### Habits @@ -104,123 +114,27 @@ These checks always run. | Kind | What it says | Minimum data | |---|---|---| -| Never triggers | A rule has not fired for 14 days, and its threshold lies outside what was measured | 14 days | -| Triggers very often | A rule fires more than 12 times within one hour | 12 triggers in one hour | +| Never triggers | A rule known for 14 days has not fired in that time, and its threshold lies outside every value measured on at least 7 days | 14 days, values on 7 days | +| Triggers very often | A rule fires at least 12 times within one hour of the last 24 hours | 12 triggers in one hour | | Contradicts, duplicate, can never be met, device missing | Problems that the rule text alone shows | None, shown at once | -## Learned values in conditions - -A condition can use a learned value instead of a fixed number or time. Such a -value has these parts: - -- A switch named **Fixed or learned value**, set to **Fixed value** or - **Learned value**. -- **At least** and **At most** for numbers, **Earliest** and **Latest** for - times. The node keeps the value inside these bounds. -- **Without a learned value**, the fallback. It applies when nothing has been - learned yet, or when the value is older than the maximum age. -- **Value counts for at most**, the maximum age. It is seven days by default. - -The rule card shows the current value, its bounds and how the value moved over -the year, with the high and the low and the months they fell in. - -## Results check and season drift - -Once you adopt a suggestion, the node measures what it changed. - -### Results check - -- The first effect appears in the first full calendar week after the change. - Until then the mark on the rule says **Effect visible from** and a date. -- The comparison uses up to four full weeks before the change as the baseline. - At least two of them need data on five days. -- Each week is measured in one unit. Device energy is shown in kWh per week, - manual actions in actions per week. For energy suggestions the measure is the - grid share of the device energy. -- The expected value of each week comes from the same calendar week of the year - before. Without these earlier figures, energy suggestions use the PV curve - instead, and the other suggestions use no season correction. The effect is - then marked **Estimate**. Manual actions have no season correction and are - therefore always an estimate. -- The result shows the value before the change and the value since, and the - number of times you overrode the rule by hand. -- Every rule and scenario that came from a suggestion shows an info mark with its - result. -- After **Delete learned data** the mark of an adopted rule says **No comparison - data**, because the days before the change are gone. -- When the range of the effect includes zero, the result says **Not measurable - yet** instead of a number. This happens when the week varies more than the - effect. -- [Monitoring](monitoring.md#notices) lists each measured result under **Results - check** for eight weeks after the change, with its confidence. **Acknowledge** - moves it to the acknowledged notices. A result is not a suggestion, so the - suggestion band does not show it. - -### Season drift - -Each night the node checks whether the values of an adopted suggestion still -fit. Four things can drift: a switch time, a surplus window, the consumption -while away and a proposed threshold. The comparison uses one value per night, -over up to 28 nights. When the difference stays in one direction, the rule gets -a finding such as **Rule: the switching time has moved**, with the old and the -new value. A fix for a threshold changes the value in the rule. The other fixes -open the assistant, which replaces the rule, or the scenario for a surplus -window. Nothing is stored until you save. - -## Recording, storage and privacy - -### What is kept - -- **Daily profiles** hold, per device, one value for each of the 96 quarter hours - of a day, and the site values. They are the base of the habit and energy - suggestions. They are kept for 56 days by default, and at least 14 days. -- **Minute values** are optional. They hold the power of every minute and the - switch events with their origin. The node tells apart switches made by a rule, - by hand in the dashboard, and from outside, such as a wall switch or a - manufacturer app. The minute values are kept in memory, on an extra drive or on - the system drive. The settings card explains the choice, see - [Recording](settings.md#recording). -- **Home Assistant** can be the source of the minute values when the Companion is - connected. After a restart, the node fetches the gaps from Home Assistant when - it needs them. These fetched values are not stored. -- **Seasonal data** keeps weekly figures for the season, so that a season can be - compared with the year before. - -### What the backup contains - -The backup includes the learning state, the daily profiles, the season memory, -the rule trigger counts, the hidden findings, the suggestion state and the -measured effects of adopted suggestions. It also -includes the PV model and forecast files, the cycle data, the chain data and the -automation history. The minute values are not part of the backup. The node -learns them again. - -### Deleting the learned data - -**Delete learned data** on the settings page asks for confirmation first. It -deletes the learned values, which are also cleared on MQTT, the daily profiles, -the minute values, the PV model and weather data, the forecast, the cycle data, -the reaction times, the chain data and the measured effects of adopted -suggestions. The node starts learning again afterwards. - -The following stay: - -- the season memory, so a season is still known after the reset, -- the rule trigger counts that the rule check uses, -- dismissed suggestions and **Later** postponements, -- hidden findings from **Ignore**, -- your settings, including the learning switches. - -The reset needs the right to reset the learning features. +## More on learning + +- [What the node learns](automations-what-is-learned.md): the values, the + seasons, the sun, the outdoor temperature and the PV curve. +- [Learned values](automations-learned-values.md): how a rule uses them. +- [Rule check](automations-rule-check.md): findings on your rules and their fixes. +- [Results and learning data](automations-learning-results.md): what an + adopted suggestion changed, what is recorded, backed up and deleted. ## Performance levels Learning costs computing time and memory. The learning level decides how much the node does and how many minute values it keeps in memory. The levels are -**Automatic**, **Balanced**, **Economical** and **Full**. The +**Automatic**, **Economical**, **Balanced** and **Full**. The minute values kept in memory cover 3 days at the economical level, 7 days at the balanced level and 14 days at the full level. The -[performance page](../operating/performance.md) describes the levels. +[performance page](settings-performance.md) describes the levels. The [Monitoring](monitoring.md) page shows the same learned values again, under **Learned values**. diff --git a/docs/dashboard/automations-rule-check.md b/docs/dashboard/automations-rule-check.md new file mode 100644 index 000000000..4b5090862 --- /dev/null +++ b/docs/dashboard/automations-rule-check.md @@ -0,0 +1,154 @@ +--- +title: "Automations: Rule check" +--- + +# Automations: Rule check + +![A rule check finding on the Automations page](../images/dashboard-automation-rule-check.png) + +The rule check reads all rules and reports findings where a rule cannot work as +you probably intend. It runs on the dashboard and never changes a rule by +itself. Only you change a rule, in the editor, and it takes effect when you +save the document as usual. + +## What is checked + +The check reports eleven kinds of findings. Each one names the rules involved. + +| Finding | What it means | Based on | +|---|---|---| +| Competes with a regulator | The rule publishes to the topic of an enabled scenario regulator, so the device gets two commands in turn. | Rules and scenarios | +| Contradicts another rule | Two rules send different commands to the same topic, and their conditions are the same or can apply at the same time. | Rules | +| Duplicate | Two rules do exactly the same. One of the two is enough. | Rules | +| Can never be met | The conditions rule each other out, for example above 500 W and below 300 W on the same value. | Rules | +| Device missing | The rule uses an entity that is no longer in the device registry. | Rules and registry | +| Triggers very often | The rule fired at least 12 times within one hour of the last 24 hours. | Observed triggers | +| Never triggers | An enabled rule known for 14 days did not fire in that time, and its value, seen on at least 7 days, never reached the threshold. | Observed triggers and values | +| Flapping | Two rules switch the same device back and forth faster than the device tolerates. | Rules and observed switching | +| No effect | A rule sends its command, but the device does not change in several cases. | Rules and observed switching | +| Often overridden | The device is switched back by hand or from outside soon after the rule switched it. | Rules and observed switching | +| Runs while offline | The start of the rule's time window falls into the usual offline time of the device. | Rules and observed switching | + +A contradiction between rules with the same conditions is a fault. When the +rules only overlap, it is a warning, because they may never actually meet there. +The check compares thresholds on the same value and time windows with their +weekdays. All other conditions count as open. Rules with a learned value are not +compared. + +**Never triggers** suggests the value that was reached on three of the last 14 +days. Thresholds on the energy balance are rounded to 50 W, all other +thresholds to two significant digits. + +A threshold that was reached in earlier months of the last year does not count +as a fault. Such a rule gets the note **Resting for the season** instead, which +is only information and has no fix. + +The observed checks need data. A new installation has no history yet, so +**Triggers very often**, **Never triggers** and the reliability checks stay +silent until enough is recorded. The reliability checks need: + +- **Flapping**: three changes between the two rules, over at least one day. +- **No effect**: three commands without effect. +- **Often overridden**: five switches set back within the time limit. +- **Runs while offline**: 14 days of data. + +The check lists at most 20 findings, the most severe first. + +## Fixes of the reliability findings + +The four reliability findings follow the **Reliability** switch in the +[learning settings](settings-learning.md). With the switch off they do +not appear. + +- **Flapping** offers **Set a minimum runtime**. It sets the hold time of the + first condition of the rule that switches the device off. The hold time is the + longer of the device's minimum runtime and three times the switching period. + The minimum runtime is 10 minutes for a heat pump, 3 minutes for a wallbox, + 2 minutes for other switchable devices and none for lights. +- **No effect** reads the cause from the failed commands. When the device could + not be reached at those times, or the failures bunch up at one time of day, + only **Open rule** is offered. When the failures are spread over the day, + **Merge as a repeat** sets a repeat every 60 seconds, so the command is sent + again while the rule's conditions hold. +- **Often overridden** offers **Add a condition** when a time of day, a day + type, the house load or the surplus separates the switches that were set back + from the accepted ones. Otherwise it offers **Shift the time window**, which + moves the start of the window to the usual time of the switch back. +- **Runs while offline** offers **Move before the outage**. It moves the start + of the time window 5 minutes before the usual offline time of the device. + +Each fix changes only the draft in the browser, as described above. + +## Energy findings + +These findings use the operating power of a device and the learned values of the +house. They are shown as soon as the data is there. None of them adds a load. + +- **Feedback**: A rule switches on a load whose own power pushes the surplus + below the switch-off threshold, so the rule turns itself off again. The + finding shows the thresholds as a scale and offers **Widen the thresholds** for + both rules in one step. It needs the learned operating power of the device and + follows the **Reliability** switch. **Flapping** names feedback as the cause + when the changes coincide with the power step of the load. +- **Competition**: Two or more rules start in the same quarter hour on the same + surplus, and the grid supplies power afterwards. The finding shows a staircase + of thresholds, one step per rule. A step that is rarely reached in the + recent weeks is marked as resting. **Stagger the thresholds** applies the + staircase to all rules at once. +- **Resting for the season until week n**: A PV threshold that the learned PV + curve reaches again in a later calendar week shows that week. A threshold the + plant never reaches stays **Never triggers**. +- **Base load rises**: The night load of the house stays higher than expected + for several weeks. With an outdoor temperature sensor the expectation follows + the temperature when the night load depends on it, so the start of the heating + season is not reported. A real rise that comes together with falling + temperatures can then stay hidden. The finding names a device that explains at least half of + the rise and, for a switchable device, offers the template **Off at night**. Without a switchable device the finding appears as a notice on the [Monitoring](monitoring.md) page. +- **Battery full early**: The battery reaches 97 % before the sun is highest, on + most of the last days. This is information only and appears as a notice on + the [Monitoring](monitoring.md) page. +- **Battery empty before morning**: The battery is empty before sunrise, and it + was not just as empty in the same weeks of the year before. The finding names + the devices that use most of the missing night energy. It needs a record of + the year before and stays silent until the node has collected it. With a switchable device it offers **Off at night**, without one it appears as a notice on the [Monitoring](monitoring.md) page. + +The template **Off at night** switches a device off from the usual night rest to +the usual start of the day. Without learned values it uses 23:00 to 06:00. + +## The mark and the popover + +![The popover of a rule check finding with its fix](../images/dashboard-automation-finding-popover.png) + +A rule with open findings shows a mark at its head, labelled **Show the finding +for this rule**. A click opens a popover with: + +- the cause, as a title and a sentence, with the facts behind it, +- a before and after graphic that shows the recorded triggers or values next to + the threshold, where the finding has such evidence, +- one or two prepared fixes as buttons, for example **Hysteresis 100 W**, + **Cooldown 10 minutes**, **Threshold to 350** or **Turn this rule off**. A + finding without a prepared fix offers **Open rule** only. + +A fix changes only the draft in the browser. It opens the rule in the editor, and +the change reaches the device when you save the document, as with any other +edit. The system never saves a fix on its own. + +## Ignoring a finding + +**Ignore** hides a finding. The page then shows **Finding hidden** with an undo +button, which shows the finding again. Hidden findings stay hidden after a +reload. A finding of a rule that no longer exists is removed from the list of +hidden findings automatically. Ignoring needs the automations role. + +## The dot on the Automations tab + +While findings are open, the **Automations** tab shows a dot. The dot goes away +when no open finding is left, either because you fixed the rules or because you +ignored the findings. + +## Where the data is stored + +The check keeps its observations in `/autolearn/checks.json` and the +hidden findings in `/autolearn/ignored.json`. Both files belong to the +history part of a backup. The endpoints are described in the +[dashboard API](../developing/api-data.md). diff --git a/docs/dashboard/automations-rules.md b/docs/dashboard/automations-rules.md index 0598160ef..e123e21b6 100644 --- a/docs/dashboard/automations-rules.md +++ b/docs/dashboard/automations-rules.md @@ -1,9 +1,39 @@ --- title: "Automations: Single rules" +anchor_moves: + learned-values: automations-learned-values.html + which-fields-take-a-learned-value: automations-learned-values.html#which-fields-take-a-learned-value + bounds-fallback-and-shift: automations-learned-values.html#bounds-fallback-and-shift + the-house-is-quiet: automations-learned-values.html#the-house-is-quiet + what-the-rule-card-shows: automations-learned-values.html#what-the-rule-card-shows + year-course-of-a-learned-value: automations-learned-values.html#year-course-of-a-learned-value + learned-value-condition: automations-learned-values.html#learned-value-condition + rule-check: automations-rule-check.html + what-is-checked: automations-rule-check.html#what-is-checked + fixes-of-the-reliability-findings: automations-rule-check.html#fixes-of-the-reliability-findings + energy-findings: automations-rule-check.html#energy-findings + the-mark-and-the-popover: automations-rule-check.html#the-mark-and-the-popover + ignoring-a-finding: automations-rule-check.html#ignoring-a-finding + the-dot-on-the-automations-tab: automations-rule-check.html#the-dot-on-the-automations-tab + where-the-data-is-stored: automations-rule-check.html#where-the-data-is-stored + suggestions: automations-learning.html#the-suggestions-band + what-is-learned: automations-what-is-learned.html#what-is-learned + seasons-and-the-sun: automations-what-is-learned.html#seasons-and-the-sun + outdoor-temperature-and-heating-season: automations-what-is-learned.html#outdoor-temperature-and-heating-season + energy-learned-values: automations-what-is-learned.html#energy-learned-values + shade-on-the-pv-curve: automations-what-is-learned.html#shade-on-the-pv-curve + away-suggestion: automations-what-is-learned.html#away-suggestion + where-a-switch-came-from: automations-learning-results.html#where-a-switch-came-from + learning-phase: automations-learning.html#the-suggestions-band + cards: automations-learning.html#the-suggestions-band + what-you-can-do: automations-learning.html#the-suggestions-band + rules-stay-yours: automations-learning.html#the-suggestions-band --- # Automations: Single rules +![The single rules on the Automations page](../images/dashboard-automation-rules.png) + ## Single rules The **Single rules** tab lists the rules. A collapsed row shows the rule's icon @@ -146,412 +176,9 @@ automatically, so a rule never points at a different device without you noticing. If the entity is no longer in the registry at all, the rule keeps running with the saved topic. -## Learned values - -Some fields of a rule can take a learned value instead of a fixed number or -time. The node learns the value from your devices and your house, and the rule -uses it as soon as it is known. A rule still never changes by itself. The rule -keeps the learned value only because you chose it in the editor. - -### Which fields take a learned value - -Each of these fields has a switch between **Fixed value** and **Learned value**: - -- the threshold of a balance condition, -- the value of a topic or entity condition, with **above** or **below** only, -- the start and the end of a time window, -- the hold time of every condition except the chain conditions. - -### Bounds, fallback and shift - -A learned value always needs three settings: - -- **At least** and **At most** for numbers, or **Earliest** and **Latest** for - times. The learned value is kept between these bounds. -- **Without a learned value** is the fallback. It applies when nothing has been - learned yet, when the stored value cannot be read, or when it is older than 7 - days. The fallback must lie between the bounds, and the minimum must not be - above the maximum. The editor says so if it is not. -- **Shift** is optional. It is added after the value has been kept within the - bounds, in the unit of the field, so minutes for times. A shift lets a time - window keep its length, because its end moves with its start. - -The age limit is `max_age_s` in the rule file. It defaults to 604800 seconds, -which is 7 days. Older values count as missing, and the fallback applies. - -### What is learned - -- the usual switch on time, the usual switch off time and the usual runtime of - each device, -- the start of the day and the night rest of the house, without the power of - devices that a rule switched on, -- the house state, **House is active** or **House is quiet**, from the - consumption of the last hours, -- the typical operating power and the typical cycle energy of a device, once - it has run at least 8 cycles, -- the PV reserve and the surplus left today, from the solar system. - -The learned values follow the **Learn patterns** switch and the **Habits** -switch in the [learning settings](settings.md#learning-features). With -**Learn patterns** off, the values stay at their last state, and rules that use -them fall back to their fallback after 7 days. - -### The house is quiet - -The condition type **House state** is met when the learned house state equals -**House is quiet** or **House is active**. Without a fresh value, the choice -**Without a fresh value** applies. The template **Off when the house is quiet** -switches a device off in that case. It sets its age limit to 2 hours (7200 -seconds) instead of 7 days. - -### Away suggestion - -The suggestions band can suggest switching off a device while the house is -away. It only suggests switchable devices whose mean energy on the absence days -is above 0.2 kWh and below half of their mean on the other days. Devices that -run all the time, such as fridges, are left out, because switching them off -would do harm. - -### What the rule card shows - -A condition that takes a learned value shows three things: - -- a chip with the name of the learned value and its current value, -- a range scale with the bounds and the current value, -- an origin line that says where the value comes from. It reads **Learned from - N days** or **Learned from N runs**, with the time since the last change. When - the value was clamped, it reads **Set to the bound, the learned value is ...**. - When the fallback applies, it reads **Fallback value, because nothing has been - learned yet or the value is too old**. - -### Seasons and the sun - -The node keeps a season memory. It holds weekly figures per calendar week for -three years, in the data directory and in the backup. When the memory is empty, -for example after an update to this version, the node fills the past weeks once -from the energy statistics. A week with fewer than four days of data does not -count. - -The sun needs a location in the automation settings. Without one, the node -learns neither the best PV curve nor the PV reserve, the remaining surplus or -shade. While **Learn patterns** is on, it shows the hint **Location missing** on -the [learning features](settings.md#automations) page, and for a plant with a PV -role also on the [Monitoring](monitoring.md) page. The sun times are then not -used, and every switching time stays a clock time. - -**Switch times** can follow the clock or the sun. A habit that follows sunset -or sunrise is suggested as a sun habit. Its time window starts at the event plus -the offset and lasts 5 minutes. When the sun times barely moved over the learning -period, around the solstices for example, the two cannot be told apart, and the -clock applies. The season check runs again later and then decides. Clock habits -use local time, so the change to summer time does not move them. - -**Overridden** shows two sun features, the sun elevation and the minutes to -sunset, when they explain why a rule was overridden. The suggested fix adds a -sun time condition to the rule. - -### Outdoor temperature and heating season - -Set the outdoor temperature on the [learning features](settings.md#automations) -page. Only temperature sensors can be chosen. The node writes the average of -each 15 minutes into the daily profiles. Days without a value are left out of -the temperature model. - -When the energy use of a device rises as the outdoor temperature falls, the node -finds the temperature below which the rise starts. This is the knee. If the -knee is found, the season **Heating season, below X °C** applies to the findings -that depend on it. Such a finding rests while the average outdoor temperature of -the last 3 days stays above the knee. - -The suggestion **only below X °C** adds an outdoor temperature condition to a -rule. It only runs when the outdoor temperature is below the knee. The -suggestion appears when the device uses clearly more energy in cold weeks than -in warm ones. - -### Year course of a learned value - -The rule card draws the course of a learned value over the year as a small line -under its scale. A sentence names the month with the highest value and the month -with the lowest. The line appears from 8 weeks of data on. - -### Learned value condition - -The condition type **Learned value** compares a learned number with a -threshold. Use it for numbers such as the PV reserve. The condition is met -when the learned number is **above** or **below** the threshold. The threshold -is a fixed number, or a reference to another learned value with its bounds. -You choose the type in the rule editor, and in scenarios too. - -| Field | Meaning | -|---|---| -| `learned` | The learned number, for example `site/pv_reserve_w` | -| `comparison` | `above` or `below` | -| `threshold` | A fixed number, or a learned reference | -| `hysteresis` | Gap around the threshold, so the condition does not flicker | -| `fallback` | The number compared when the learned value is missing or older than `max_age_s` | -| `max_age_s` | Age limit in seconds, 604800 (7 days) by default | -| `hold_seconds` | Time the condition must stay met before it counts | - -The hysteresis works as for balance conditions. With **above** the condition -turns on at the threshold and turns off at the threshold minus the hysteresis. - -### Energy learned values - -The node also learns from the energy side of your house. These values are -numbers with a unit, and they can be used wherever a number takes a learned -value. - -- **Typical operating power** of a device, in W. The node watches when a device - runs a cycle, for example a washing machine. A cycle starts when the power - stays above a limit for two minutes and ends after a pause. The value is the - usual power while the device works, rounded to 10 W. -- **Typical cycle energy** of a device, in Wh, rounded to 10 Wh. A device with - several programs gets the value of the program it runs most often. The other - programs are listed in the origin line of the value. -- **PV reserve**, in W. It is the power the solar system could deliver right now - and does not, for example because a regulator holds it back. The node learns - what the system can deliver on a clear sky from the few moments when it ran - unthrottled, and scales that with the weather of the day. A load that switches - on and is covered by the solar power counts as a measurement too. Without a - recent measurement the weather factor returns to a usual value. Once 60 - measured minutes exist within 28 days, that is their median. The value prefers - to promise too little. Without an unthrottled moment for two hours it is halved - and marked **Estimate**. -- **Surplus left today**, in Wh. It is the solar energy that the house will not - use for the rest of the day. The node looks for the days that behaved like - today so far and reports an amount that was reached on three of four of them. - A nightly check compares the forecast with what happened. When the forecast is - not better than a plain seasonal median over 14 days, the median is published - and marked **Estimate**. - -A value marked **Estimate** is a guess, not a measurement. The rule editor shows -the mark next to the current value. - -The assistants use the typical operating power too. When you choose a device in -the template for surplus switching or surplus charging, the switch on threshold -starts at the operating power plus 100 W, rounded up to 100 W. - -### Shade on the PV curve - -If the solar system is shaded by a tree or a building at the same place in the -sky on many clear days, the node reports **A fixed shadow is pulling down PV -power**. The note names the time of day, the weeks of the year and a rough -yearly loss in kWh, and it draws the day curve with the best possible curve -dashed. It is only information and has no fix. In the shaded part of the sky the -best possible curve follows the measured power, so the PV reserve and the -surplus values leave the shade out. When the shade disappears, the next check -removes it again. - -The data for this lives in `autolearn/pvraster.json`, `autolearn/pvmodel.json`, -`autolearn/pvweather.json`, `autolearn/cycles.json` and -`autolearn/forecast.json`. The learned PV model needs the location of the -house, see the learning settings. - -## Where a switch came from - -The learning features record where each switching command comes from. The -dashboard tells a rule from a hand switch and from an outside change. A switch -that follows a rule is recognised by the automation state document, which -counts the firings of each rule in `fire_count` and records the time of the last -one in `fired_at`. A command sent through the dashboard is a hand switch, and -everything else counts as outside. The daily profiles hold these origins in -15 minute steps and are kept for 56 days by default, see -[Recording](settings.md#recording). Nothing changes a rule by itself. Learned -patterns only appear as suggestions. - -## Suggestions - -The band above the list shows suggestions that come from how your devices are -used. Each one is a pattern that the node found in the daily profiles: a device -you switch at about the same time each day, a run that often lasts far longer -than usual, or a device that another device follows. The band only suggests. -A rule changes only when you create or edit it yourself. - -The band needs **Learn patterns** to be on in the -[learning settings](settings.md#learning-features). With it off, the band is -hidden. With **Habits** off, the band stays empty. - -### Learning phase - -While the node is still learning, the band reads **Learning for N days from M -devices** and shows no cards. A new installation needs at least 10 days before -the first card can appear. Each kind of pattern needs its own minimum data, see -[Kinds of suggestions and findings](automations-learning.md#kinds-of-suggestions-and-findings). - -### Cards - -A card shows the kind of pattern, the device and a tag, **Sure** or **Estimate**. -**Sure** means the pattern is clear. **Estimate** means it is likely, but the -data is still thin. The card also shows the weeks it applies to, or **Applies -all year**. Below the title, a graphic shows what happened and what the -suggestion would change, together with the facts behind it. - -The numbers on a card stay the same until they change clearly, so the card does -not jump around from one minute to the next. The band shows three suggestions. -**+N** shows the rest, up to 20 in total. A suggestion is not shown when it would -save very little, or when it would duplicate or contradict a rule you already -have. - -### What you can do - -- **Open in assistant** opens the assistant with the matching template filled - in. Nothing is saved until you press **Create** on the summary page. The - button only appears when a template fits, see [Templates](automations-templates.md). -- **Later** hides the suggestion for seven days. -- **Do not suggest again** hides the suggestion for good. - -After **Later** or **Do not suggest again**, the band shows **Suggestion hidden** -with an **Undo** button for six seconds. After that the suggestion stays hidden. - -### Rules stay yours - -The system never changes a rule by itself, not even when you accept a -suggestion. Accepting only opens the assistant. The rule is added when you -create it there, and it is saved with the rest of the document. - -## Rule check - -The rule check reads all rules and reports findings where a rule cannot work as -you probably intend. It runs on the dashboard and never changes a rule by -itself. Only you change a rule, in the editor, and it takes effect when you -save the document as usual. - -### What is checked - -The check reports eleven kinds of findings. Each one names the rules involved. - -| Finding | What it means | Based on | -|---|---|---| -| Competes with a regulator | The rule publishes to the topic of an enabled scenario regulator, so the device gets two commands in turn. | Rules and scenarios | -| Contradicts another rule | Two rules send different commands to the same topic, and their conditions are the same or can apply at the same time. | Rules | -| Duplicate | Two rules do exactly the same. One of the two is enough. | Rules | -| Can never be met | The conditions rule each other out, for example above 500 W and below 300 W on the same value. | Rules | -| Device missing | The rule uses an entity that is no longer in the device registry. | Rules and registry | -| Triggers very often | The rule fired at least 12 times within one hour of the last 24 hours. | Observed triggers | -| Never triggers | An enabled rule did not fire for 14 days, although it has been known for 14 days and its value has been seen on 7 days. | Observed triggers and values | -| Flapping | Two rules switch the same device back and forth faster than the device tolerates. | Rules and observed switching | -| No effect | A rule sends its command, but the device does not change in several cases. | Rules and observed switching | -| Often overridden | The device is switched back by hand or from outside soon after the rule switched it. | Rules and observed switching | -| Runs while offline | The start of the rule's time window falls into the usual offline time of the device. | Rules and observed switching | - -A contradiction between rules with the same conditions is a fault. When the -rules only overlap, it is a warning, because they may never actually meet there. -The check compares thresholds on the same value and time windows with their -weekdays. All other conditions count as open. Rules with a learned value are not -compared. - -**Never triggers** suggests the value that was reached on three of the last 14 -days. Thresholds on the energy balance are rounded to 50 W, all other -thresholds to two significant digits. - -A threshold that was reached in earlier months of the last year does not count -as a fault. Such a rule gets the note **Resting for the season** instead, which -is only information and has no fix. - -The observed checks need data. A new installation has no history yet, so -**Triggers very often**, **Never triggers** and the reliability checks stay -silent until enough is recorded. The reliability checks need: - -- **Flapping**: three changes between the two rules, over at least one day. -- **No effect**: three commands without effect. -- **Often overridden**: five switches set back within the time limit. -- **Runs while offline**: 14 days of data. - -The check lists at most 20 findings, the most severe first. - -### Fixes of the reliability findings - -The four reliability findings follow the **Reliability** switch in the -[learning settings](settings.md#learning-features). With the switch off they do -not appear. - -- **Flapping** offers **Set a minimum runtime**. It sets the hold time of the - first condition of the rule that switches the device off. The hold time is the - longer of the device's minimum runtime and three times the switching period. - The minimum runtime is 10 minutes for a heat pump, 3 minutes for a wallbox, - 2 minutes for other switchable devices and none for lights. -- **No effect** reads the cause from the failed commands. When the device could - not be reached at those times, or the failures bunch up at one time of day, - only **Open rule** is offered. When the failures are spread over the day, - **Merge as a repeat** sets a repeat every 60 seconds, so the command is sent - again while the rule's conditions hold. -- **Often overridden** offers **Add a condition** when a time of day, a day - type, the house load or the surplus separates the switches that were set back - from the accepted ones. Otherwise it offers **Shift the time window**, which - moves the start of the window to the usual time of the switch back. -- **Runs while offline** offers **Move before the outage**. It moves the start - of the time window 5 minutes before the usual offline time of the device. - -Each fix changes only the draft in the browser, as described above. - -### Energy findings - -These findings use the operating power of a device and the learned values of the -house. They are shown as soon as the data is there. None of them adds a load. - -- **Feedback**: A rule switches on a load whose own power pushes the surplus - below the switch-off threshold, so the rule turns itself off again. The - finding shows the thresholds as a scale and offers **Widen the thresholds** for - both rules in one step. It needs the learned operating power of the device and - follows the **Reliability** switch. **Flapping** names feedback as the cause - when the changes coincide with the power step of the load. -- **Competition**: Two or more rules start in the same quarter hour on the same - surplus, and the grid supplies power afterwards. The finding shows a staircase - of thresholds, one step per rule. A step that is rarely reached in the - recent weeks is marked as resting. **Stagger the thresholds** applies the - staircase to all rules at once. -- **Resting for the season until week n**: A PV threshold that the learned PV - curve reaches again in a later calendar week shows that week. A threshold the - plant never reaches stays **Never triggers**. -- **Base load rises**: The night load of the house stays higher than expected - for several weeks. With an outdoor temperature sensor the expectation follows - the temperature when the night load depends on it, so the start of the heating - season is not reported. A real rise that comes together with falling - temperatures can then stay hidden. The finding names a device that explains at least half of - the rise and, for a switchable device, offers the template **Night off**. Without a switchable device the finding appears as a notice on the [Monitoring](monitoring.md) page. -- **Battery full early**: The battery reaches 97 % before the sun is highest, on - most of the last days. This is information only and appears as a notice on - the [Monitoring](monitoring.md) page. -- **Battery empty before morning**: The battery is empty before sunrise, and it - was not just as empty in the same weeks of the year before. The finding names - the devices that use most of the missing night energy. It needs a record of - the year before and stays silent until the node has collected it. With a switchable device it offers **Night off**, without one it appears as a notice on the [Monitoring](monitoring.md) page. - -The template **Night off** switches a device off from the usual night rest to -the usual start of the day. Without learned values it uses 23:00 to 06:00. - -### The mark and the popover - -A rule with open findings shows a mark at its head, labelled **Show the finding -for this rule**. A click opens a popover with: - -- the cause, as a title and a sentence, with the facts behind it, -- a before and after graphic that shows the recorded triggers or values next to - the threshold, where the finding has such evidence, -- one or two prepared fixes as buttons, for example **Hysteresis 100 W**, - **Cooldown 10 minutes**, **Threshold to 350** or **Turn this rule off**. A - finding without a prepared fix offers **Open rule** only. - -A fix changes only the draft in the browser. It opens the rule in the editor, and -the change reaches the device when you save the document, as with any other -edit. The system never saves a fix on its own. - -### Ignoring a finding - -**Ignore** hides a finding. The page then shows **Finding hidden** with an undo -button, which shows the finding again. Hidden findings stay hidden after a -reload. A finding of a rule that no longer exists is removed from the list of -hidden findings automatically. Ignoring needs the automations role. - -### The dot on the Automations tab - -While findings are open, the **Automations** tab shows a dot. The dot goes away -when no open finding is left, either because you fixed the rules or because you -ignored the findings. - -### Where the data is stored +## Learned values and the rule check -The check keeps its observations in `/autolearn/checks.json` and the -hidden findings in `/autolearn/ignored.json`. Both files belong to the -history part of a backup. The endpoints are described in the -[dashboard API](../developing/api-data.md). +Fields of a rule can follow a learned value instead of a fixed number, see +[Learned values](automations-learned-values.md). The +[rule check](automations-rule-check.md) reports rules that cannot work as +intended and offers a fix. diff --git a/docs/dashboard/automations-scenarios.md b/docs/dashboard/automations-scenarios.md index cbd8bdbed..35ab6437f 100644 --- a/docs/dashboard/automations-scenarios.md +++ b/docs/dashboard/automations-scenarios.md @@ -4,6 +4,8 @@ title: "Automations: Scenarios" # Automations: Scenarios +![The scenarios on the Automations page](../images/dashboard-automation-scenarios.png) + ## Scenarios ![A scenario card with its phases](../images/dashboard-automation-scenario.png) @@ -119,7 +121,7 @@ commands. A regulating scenario publishes every step it calculates, whether or not the output changes. The node keeps the steps of each scenario, in memory and on the same place and for the same days as the -[minute values](settings.md#learning-features). Each step has one of four +[minute values](settings-learning.md). Each step has one of four reasons: - **sent**: the new output went to the device. diff --git a/docs/dashboard/automations-templates.md b/docs/dashboard/automations-templates.md index 5b7cca4e6..128f117e6 100644 --- a/docs/dashboard/automations-templates.md +++ b/docs/dashboard/automations-templates.md @@ -427,6 +427,108 @@ Needs a source switch that reports its state, and a target switch that you can c - Source state: switches on, or switches off - Target action: switch on, or switch off +## Restart a device when its reading hangs + +When a reading of the chain stops while the plug shows load, the plug switches off briefly and on again. Once per finding. + +### Category + +Switching + +### Creates + +Scenario + +### Phases + +When a frozen finding on a point of the chain has lasted for the chosen time and the plug draws at least the chosen load. Running: the plug is off. Ends: after the pause, and the plug switches on again. + +### Requirements + +Needs a [measurement chain](energy.md#measurement-chains) whose first point is a plug with a switch. The switch of the first point is preselected. The technical details are in [Chain templates](../services/automations.md#chain-templates). + +### Options + +- How long may the reading hang: 15 to 120 minutes, default 15 +- From which load: 5 to 500 W, default 20 W +- How long off: 10 to 300 seconds, default 30 +- How often again: 1 to 24 hours, default 6 +- Show a notice first: optional, off by default + +## Switch off standby + +When the chain only draws standby for a long time, the plug switches off and on again at a set time if you like. + +### Category + +Switching + +### Creates + +Scenario with **At a set time**, rule with **By hand** + +### Phases + +When the standby of the chain stays above the chosen value for the chosen time. Then the plug switches off. With **At a set time** it switches on again when the time window opens, by default 07:00 to 08:00 on every day. With **By hand** it stays off until you switch it on yourself. + +### Requirements + +Needs a [measurement chain](energy.md#measurement-chains) whose first point is a plug with a switch. The technical details are in [Chain templates](../services/automations.md#chain-templates). + +### Options + +- From which standby: 5, 10 or 20 W, default 10 W +- How long standby: 1 to 24 hours, default 2 +- When to switch on again: at a set time or by hand + +## Off when the house is quiet + +Switches a device off when nothing has been going on in the house for a while. + +### Category + +Switching + +### Creates + +Rule + +### Phases + +When the learned house state is **House is quiet** and the device is on. Then the device switches off. Without a fresh house state the rule counts the house as active and does nothing. + +### Requirements + +Needs a switch that reports its state, and **Learn patterns** in the [learning features](settings-learning.md). The house state counts for 2 hours, see [The house is quiet](automations-learned-values.md#the-house-is-quiet). + +### Options + +- Switch: the device to switch off + +## Off at night + +Switches a device off at night, from the night rest to the day start. The times follow what was learned. + +### Category + +Time + +### Creates + +Rule + +### Phases + +During the time window from the learned night rest to the learned start of the day. Then the device switches off. Without learned values the window is 23:00 to 06:00. + +### Requirements + +Needs a switch. The base load and battery findings of the [rule check](automations-rule-check.md#energy-findings) offer this template. + +### Options + +- Switch: the device to switch off at night + ## Move load into the surplus Starts a device in the surplus of the day, once the surplus left today covers the cycle energy of the device. A second rule starts it at the latest start time if that did not happen. diff --git a/docs/dashboard/automations-what-is-learned.md b/docs/dashboard/automations-what-is-learned.md new file mode 100644 index 000000000..525aca982 --- /dev/null +++ b/docs/dashboard/automations-what-is-learned.md @@ -0,0 +1,129 @@ +--- +title: "Automations: What the node learns" +--- + +# Automations: What the node learns + +![The learned values with one row opened](../images/dashboard-what-is-learned.png) + +*The picture shows how the Monitoring tab presents the learned values. Rules and the learning itself do not depend on that tab.* + +What the node learns from your devices and your house, and where the values come from. How rules use them is on [Learned values](automations-learned-values.md). + +## What is learned + +- the usual switch on time, the usual switch off time and the usual runtime of + each device, +- the start of the day and the night rest of the house, without the power of + devices that a rule switched on, +- the house state, **House is active** or **House is quiet**, from the + consumption of the last hours, +- the typical operating power and the typical cycle energy of a device, once + it has run at least 8 cycles, +- the PV reserve and the surplus left today, from the solar system. + +The learned values follow the **Learn patterns** switch and the **Habits** +switch in the [learning settings](settings-learning.md). With +**Learn patterns** off, the values stay at their last state, and rules that use +them fall back to their fallback after 7 days. + +## Seasons and the sun + +The node keeps a season memory. It holds weekly figures per calendar week for +three years, in the data directory and in the backup. When the memory is empty, +for example after an update to this version, the node fills the past weeks once +from the energy statistics. A week with fewer than four days of data does not +count. + +The sun needs a location in the automation settings. Without one, the node +learns neither the best PV curve nor the PV reserve, the remaining surplus or +shade. While **Learn patterns** is on, it shows the hint **Location missing** on +the [learning features](settings-learning.md#automations) page, and for a plant with a PV +role also on the [Monitoring](monitoring.md) page. The sun times are then not +used, and every switching time stays a clock time. + +**Switch times** can follow the clock or the sun. A habit that follows sunset +or sunrise is suggested as a sun habit. Its time window starts at the event plus +the offset and lasts 5 minutes. When the sun times barely moved over the learning +period, around the solstices for example, the two cannot be told apart, and the +clock applies. The season check runs again later and then decides. Clock habits +use local time, so the change to summer time does not move them. + +**Overridden** shows two sun features, the sun elevation and the minutes to +sunset, when they explain why a rule was overridden. The suggested fix adds a +sun time condition to the rule. + +## Outdoor temperature and heating season + +Set the outdoor temperature on the [learning features](settings-learning.md#automations) +page. Only temperature sensors can be chosen. The node writes the average of +each 15 minutes into the daily profiles. Days without a value are left out of +the temperature model. + +When the energy use of a device rises as the outdoor temperature falls, the node +finds the temperature below which the rise starts. This is the knee. If the +knee is found, the season **Heating season, below X °C** applies to the findings +that depend on it. Such a finding rests while the average outdoor temperature of +the last 3 days stays above the knee. + +The suggestion **only below X °C** adds an outdoor temperature condition to a +rule. It only runs when the outdoor temperature is below the knee. The +suggestion appears when the device uses clearly more energy in cold weeks than +in warm ones. + +## Energy learned values + +The node also learns from the energy side of your house. These values are +numbers with a unit, and they can be used wherever a number takes a learned +value. + +- **Typical operating power** of a device, in W. The node watches when a device + runs a cycle, for example a washing machine. A cycle starts when the power + stays above a limit for two minutes and ends after a pause. The value is the + usual power while the device works, rounded to 10 W. +- **Typical cycle energy** of a device, in Wh, rounded to 10 Wh. A device with + several programs gets the value of the program it runs most often. The other + programs are listed in the origin line of the value. +- **PV reserve**, in W. It is the power the solar system could deliver right now + and does not, for example because a regulator holds it back. The node learns + what the system can deliver on a clear sky from the few moments when it ran + unthrottled, and scales that with the weather of the day. A load that switches + on and is covered by the solar power counts as a measurement too. Without a + recent measurement the weather factor returns to a usual value. Once 60 + measured minutes exist within 28 days, that is their median. The value prefers + to promise too little. Without an unthrottled moment for two hours it is halved + and marked **Estimate**. +- **Surplus left today**, in Wh. It is the solar energy that the house will not + use for the rest of the day. The node looks for the days that behaved like + today so far and reports an amount that was reached on three of four of them. + A nightly check compares the forecast with what happened. When the forecast is + not better than a plain seasonal median over 14 days, the median is published + and marked **Estimate**. + +A value marked **Estimate** is a guess, not a measurement. The rule editor shows +the mark next to the current value. + +The assistants use the typical operating power too. When you choose a device in +the template for surplus switching or surplus charging, the switch on threshold +starts at the operating power plus 100 W, rounded up to 100 W. + +## Shade on the PV curve + +If the solar system is shaded by a tree or a building at the same place in the +sky on many clear days, the node reports **A fixed shadow is pulling down PV +power**. The note names the time of day, the weeks of the year and a rough +yearly loss in kWh, and it draws the day curve with the best possible curve +dashed. It is only information and has no fix. In the shaded part of the sky the +best possible curve follows the measured power, so the PV reserve and the +surplus values leave the shade out. When the shade disappears, the next check +removes it again. + +The learned PV model needs the location of the house, see the [learning features](settings-learning.md). + +## Away suggestion + +The suggestions band can suggest switching off a device while the house is +away. It only suggests switchable devices whose mean energy on the absence days +is above 0.2 kWh and below half of their mean on the other days. Devices that +run all the time, such as fridges, are left out, because switching them off +would do harm. diff --git a/docs/dashboard/device-map.md b/docs/dashboard/device-map.md index 91fc03eae..e9f936f96 100644 --- a/docs/dashboard/device-map.md +++ b/docs/dashboard/device-map.md @@ -42,6 +42,8 @@ How to read a node: | Roles | every device with an energy role, connected to the Energy Node | | Losses | the loss of each measurement chain between two devices, off by default | +![The device map with the Losses layer on](../images/dashboard-device-map-losses.png) + The losses layer adds up the loss of every segment of a measurement chain that runs between two different devices. Segments inside one device are left out. Two chains over the same pair of devices add up. The figures per chain are on diff --git a/docs/dashboard/efficiency.md b/docs/dashboard/efficiency.md index 8b1f7110a..baceefe0d 100644 --- a/docs/dashboard/efficiency.md +++ b/docs/dashboard/efficiency.md @@ -4,6 +4,8 @@ title: "Efficiency" # Efficiency +![The Efficiency tab of a battery chain with the figures, the efficiency curve, the loss per day and the diagnosis](../images/dashboard-efficiency.png) + The **Efficiency** tab shows how much energy each measurement chain loses. Pick the chain in the selector at the top. The tab then shows four figures, the loss per day for the last seven days, the efficiency curve of the chain and a diff --git a/docs/dashboard/energy.md b/docs/dashboard/energy.md index b5349ee39..4b305e77a 100644 --- a/docs/dashboard/energy.md +++ b/docs/dashboard/energy.md @@ -4,6 +4,8 @@ title: "Energy" # Energy +![The Energy tab](../images/dashboard-energy.png) + The Energy tab turns your sensors into an energy balance. It sets the energy roles of every power and charge entity, the groups and the custom categories, and it shows how the house consumption is derived. To see where that energy @@ -130,6 +132,8 @@ measurement, as before, and a sub-device changes nothing else. ## Measurement chains +![A measurement chain from the inverter to the wallbox, with one counting point and three reference points](../images/measurement-chain.svg){: .sketch} + A measurement chain is a row of power meters that measure the same path, for example the meter at the inverter, the meter at the sub-distribution and the meter at the wallbox. The points run in flow direction, from the source to the @@ -146,6 +150,8 @@ point at any time, and the role moves with it. ### Substitute values +![The measurement chains on the Energy tab with a suggestion and two chains](../images/dashboard-energy-chains.png) + A counting point that cannot deliver a current value is replaced by a reference point. The balance then uses the value of the nearest reference point that is current, and the role shows it as a substitute value. If two points are equally @@ -183,11 +189,16 @@ storage roles, which keep their sign. ### Findings -When the learned model finds a problem in a chain, the top of the tab shows a -notice for each finding, with its text and the suggested fix if there is one. -**Apply suggestion** fills the change into the draft of the entity. Nothing is -saved until you save. **Open efficiency** leads to the [Efficiency](efficiency.md#diagnosis) -tab, and the same findings show as a warning on the [device map](device-map.md). +The Energy tab does not list the findings of the chains itself. Its top shows a +summary line with a bell instead. It says how many notices about energy are +open and how many of them are new, and **Open in monitoring** opens the +[Monitoring](monitoring.md#energy-line) tab with the filter *Energy*. There each +chain finding has its text and its recommended steps. The step **Measurement +chain** opens the dialog of the chain on this tab. + +The same findings show on the [Efficiency](efficiency.md#diagnosis) tab, where +**Apply suggestion** fills a fix into the draft of the entity, and as a warning +on the [device map](device-map.md). Nothing is saved until you save. ### Loss per segment diff --git a/docs/dashboard/index.md b/docs/dashboard/index.md index dbb1a9705..c04d0121e 100644 --- a/docs/dashboard/index.md +++ b/docs/dashboard/index.md @@ -13,7 +13,7 @@ anchor_moves: diagnostics: diagnostics.html automations: automations.html settings: settings.html - general: settings.html#general + general: settings-learning.html appearance: settings-appearance.html#appearance history-1: settings-history.html#history mqtt: settings-mqtt.html#mqtt @@ -27,6 +27,8 @@ anchor_moves: # The dashboard, page by page +![The dashboard on a wide screen](../images/dashboard.png) + The Energy Node dashboard is a single statically linked Go binary. Templates, CSS and JavaScript are compiled into it with `go:embed`. There is no build step, no CDN and no server side database. The dashboard renders HTML on the @@ -45,8 +47,6 @@ any device. ## The window frame -![The dashboard on a wide screen](../images/dashboard.png) - Every tab has the same frame. The system status bar shows the broker connection, storage health, uptime and diff --git a/docs/dashboard/monitoring.md b/docs/dashboard/monitoring.md index 5bf5d82cb..65fa5d913 100644 --- a/docs/dashboard/monitoring.md +++ b/docs/dashboard/monitoring.md @@ -4,6 +4,8 @@ title: "Monitoring" # Monitoring +![The Monitoring tab with the notices and an open notice card](../images/dashboard-monitoring.png) + The **Monitoring** tab collects what the node wants you to look at. It shows notices about the energy balance, the measurement chains, the learning functions and the results of adopted suggestions. It also shows the forecast the node uses @@ -16,7 +18,7 @@ Diagnostics stays a separate tab. It covers devices, services and the broker. Monitoring covers the energy side and what the system has learned. The learning itself, the suggestions and the effects of adopted suggestions are -described on one page, [Automations: Learning](automations-learning.md). +described on one page, [Automations: Suggestions](automations-learning.md). ## Notices @@ -36,8 +38,8 @@ Notices come from five sources: | Energy balance | The house load is set to measured, but no meter has the role house meter. A battery level exists without a capacity in kWh. Power values have no role. Values were left without a role by a measurement chain. | | Measurement chains | A finding of a [measurement chain](energy.md#measurement-chains), such as a unit error, a frozen value, a contradiction or a sign error. The card shows the time since the finding started. | | Learning | A finding that belongs to no rule and to no suggestion, for example a fixed shade that reduces the PV power, a battery that is full early or empty before morning, or a rising base load without a switchable device. For a plant with a PV role, a missing location is reported here too while **Learn patterns** is on. The card shows the direction and height of the shade, the calendar weeks, the loss per year and a daily curve. | -| Suggestions | Every suggestion of the [suggestion band](automations-rules.md#suggestions). **Open suggestion** opens it on the Automations page. The chip **Suggestions** lists only these, **All** includes them. | -| Results check | The measured [result](automations-learning.md#results-check) of an adopted suggestion, with the value before and since and its confidence, for eight weeks after the change. **Open the rule** shows the rule or scenario on the Automations page. | +| Suggestions | Every suggestion of the [suggestion band](automations-learning.md#the-suggestions-band). **Open suggestion** opens it on the Automations page. The chip **Suggestions** lists only these, **All** includes them. | +| Results check | The measured [result](automations-learning-results.md#results-check) of an adopted suggestion, with the value before and since and its confidence, for eight weeks after the change. **Open the rule** shows the rule or scenario on the Automations page. | Findings that belong to a rule stay on the rule card in [Automations](automations-rules.md). Findings with a suggestion to apply stay in @@ -83,6 +85,8 @@ open notices about energy. The line is hidden without the permission ## Forecast +![The Forecast view with the status card, the last 14 days and the year comparison](../images/dashboard-monitoring-forecast.png) + The **Forecast** view shows how well the node estimates the surplus. At 10:00 each day the node estimates the remaining surplus of the day, the value `site/surplus_left_wh`. The status card names the rules that use this value. If @@ -129,6 +133,8 @@ a previous year exists, because the season memory fills up week by week. ## Learned values +![A usual day, one run and the system values in the Learned values view](../images/dashboard-monitoring-learned.png) + The **Learned values** view shows what the system has learned. It opens with **A usual day**, a picture of one day on a 24 hour axis. A label at the top says whether the house is usually active or quiet. @@ -155,23 +161,23 @@ Two more cards follow the picture: The PV reserve is marked as an estimate until it comes from the minute values. The table lists all learned values. The keys are the names under which the values are published on MQTT, see -[Learned values in conditions](automations-learning.md#learned-values-in-conditions). - -| Key | Meaning | Unit | Origin (detector) | -|---|---|---|---| -| `site/day_start` | Start of the day, per day type | Clock time | `learn_day_bounds` | -| `site/night_rest` | Night rest, per day type | Clock time | `learn_day_bounds` | -| `site/house_state` | House state, for example quiet | State | `learn_house_state` | -| `site/pv_reserve_w` | PV reserve | W | `learn_pv_reserve` | -| `site/surplus_left_wh` | Remaining surplus today | Wh | `learn_surplus` | -| `site/base_w` | Base load of the house at night | W | `baseload` | -| `site/battery_full_at` | Time the battery is usually full | Clock time | `battery` | -| `site/night_wh` | Energy the house takes from the battery at night | Wh | `battery` | -| `device//usual_on` | Usual switch-on time | Clock time | `learn_switch_time` | -| `device//usual_off` | Usual switch-off time | Clock time | `learn_switch_time` | -| `device//usual_runtime_s` | Usual runtime of one run | s | `learn_runtime` | -| `device//op_power_w` | Typical operating power | W | `learn_cycles` | -| `device//cycle_wh` | Typical energy of one cycle | Wh | `learn_cycles` | +[Learned values in conditions](automations-learned-values.md). + +| Key | Meaning | Unit | +|---|---|---| +| `site/day_start` | Start of the day, per day type | Clock time | +| `site/night_rest` | Night rest, per day type | Clock time | +| `site/house_state` | House state, for example quiet | State | +| `site/pv_reserve_w` | PV reserve | W | +| `site/surplus_left_wh` | Remaining surplus today | Wh | +| `site/base_w` | Base load of the house at night | W | +| `site/battery_full_at` | Time the battery is usually full | Clock time | +| `site/night_wh` | Energy the house takes from the battery at night | Wh | +| `device//usual_on` | Usual switch-on time | Clock time | +| `device//usual_off` | Usual switch-off time | Clock time | +| `device//usual_runtime_s` | Usual runtime of one run | s | +| `device//op_power_w` | Typical operating power | W | +| `device//cycle_wh` | Typical energy of one cycle | Wh | `` is the ID of the device. The five device values appear once per device that has enough data. @@ -184,8 +190,7 @@ learning features**, which opens *Settings, Learning*. | Right | What it allows | |---|---| | `view_monitoring` | Shows the Monitoring tab, its notices, the learned values, the forecast, the year comparison and the energy line | -| `edit_setup` | Acknowledges a notice and takes the acknowledgement back. Without it the card says that only users with the setup right can acknowledge | -| The right to reset the learning features | Needed for **Delete learned data** in the learning settings | +| `edit_setup` | Acknowledges a notice and takes the acknowledgement back. Also needed for **Delete learned data** in the learning settings. Without it the card says that only users with the setup right can acknowledge | A step that leads to a place you may not see is hidden, see [Recommended steps](#recommended-steps). The permissions are set on the users diff --git a/docs/dashboard/onboarding.md b/docs/dashboard/onboarding.md index 06989f121..7f5893f66 100644 --- a/docs/dashboard/onboarding.md +++ b/docs/dashboard/onboarding.md @@ -4,14 +4,14 @@ title: "Onboarding" # Onboarding +![The setup at its first step](../images/dashboard-onboarding-setup-start.png) + The first time an admin signs in, the dashboard starts a guided setup. It goes through the settings that matter most in four areas: Access, Display, System and Devices. You can finish it in one go or leave any step for later. ## How the setup works -![The setup at its first step](../images/dashboard-onboarding-setup-start.png) - The setup runs in the dashboard itself. A bar at the bottom of the screen names the current step. A spotlight marks the control that the step is about, so you can change it right where it is. The bar has three buttons: diff --git a/docs/dashboard/overview-cards.md b/docs/dashboard/overview-cards.md index b74205d8a..5cc88357d 100644 --- a/docs/dashboard/overview-cards.md +++ b/docs/dashboard/overview-cards.md @@ -5,6 +5,8 @@ gallery: true # Overview cards +![An overview page with several cards](../images/dashboard-cards.png) + This page lists every block you can put on an overview page and the options it has in the layout editor. How the editor itself works is described in [Overview and layout editor](overview.md). diff --git a/docs/dashboard/settings-appearance.md b/docs/dashboard/settings-appearance.md index b2bfdb362..2264e6fd2 100644 --- a/docs/dashboard/settings-appearance.md +++ b/docs/dashboard/settings-appearance.md @@ -4,13 +4,13 @@ title: "Settings: Appearance" # Settings: Appearance +![Appearance settings](../images/dashboard-settings-display.png) + The tab **Appearance** under *Settings*. The other tabs are listed on [Settings](settings.md). ## Appearance -![Appearance settings](../images/dashboard-settings-display.png) - Here you set the default device view, the colour scheme and which extra information the UI shows: discovery JSON tooltips, the global status bar, and configuration and diagnostic values on tiles. **Tabs without a width limit** diff --git a/docs/dashboard/settings-backup.md b/docs/dashboard/settings-backup.md index edc33a58b..711b3da21 100644 --- a/docs/dashboard/settings-backup.md +++ b/docs/dashboard/settings-backup.md @@ -36,7 +36,7 @@ choose. Each area can be switched on or off. | Users | Accounts and roles from `users.json`. Password hashes are only included with credentials | On | | Credentials | Credential files for MQTT, the bridge and TinyTuya, and the password hashes of the users | Off | | Statistics | Monthly energy statistics | On | -| Automation history | The history of the automation engine | On | +| Automation history | The history of the automation engine and the learning data: suggestions, rule check, season memory, PV model, forecast, cycles, monitoring acknowledgements, see [What the backup contains](automations-learning-results.md#what-the-backup-contains). Minute values are not included | On | | Battery state | The state files of the battery state of charge devices | Off | Credentials are only written when the Credentials area is chosen and the diff --git a/docs/dashboard/settings-history.md b/docs/dashboard/settings-history.md index 53eb2f2c7..ceae6f52a 100644 --- a/docs/dashboard/settings-history.md +++ b/docs/dashboard/settings-history.md @@ -4,14 +4,14 @@ title: "Settings: History" # Settings: History +![History settings](../images/dashboard-settings-history.png) + The tab **History** under *Settings*. The history charts themselves are described on [History](history.md), the statistics on [Statistics](statistics.md). ## History -![History settings](../images/dashboard-settings-history.png) - This tab controls recording and retention of the browser side history: the sample rate, how long raw data is kept before compaction and how long minute values are kept. Retention is limited either by time or by a storage budget in diff --git a/docs/dashboard/settings-learning.md b/docs/dashboard/settings-learning.md new file mode 100644 index 000000000..22e1b5d8f --- /dev/null +++ b/docs/dashboard/settings-learning.md @@ -0,0 +1,125 @@ +--- +title: "Settings: Learning features" +--- + +# Settings: Learning features + +![The Learning features page](../images/dashboard-settings-learning-page.png) + +The page **Learning features** under *Settings*. + +The learning features turn the behaviour of your devices into suggestions for +chains and into learned values for rules. They never change a rule or a chain +on their own. Each feature has its own switch, and the page has four cards. + +## Chains + +**Suggestions** searches the power values for devices that measure the same +thing and suggests chains. **Learn values** learns the normal loss of each +measurement chain, see [Efficiency](efficiency.md#learning). When you switch it +off, the values learned so far stay, and the warnings rely on them alone. + +## Automations + +**Learn patterns** learns the switching times, the run times, the use per role +and the energy flows. When you switch it off, the learned values stay at their +last state, so a rule falls back to its default value after 7 days. + +**Location missing** appears on this page while **Learn patterns** is on and no +location is set. Without a location the patterns have no sun times. **Enter location** opens the +automation settings. Meanwhile the node learns neither the best PV curve nor the +PV reserve, the remaining surplus or shade. For a plant with a PV role the +[Monitoring](monitoring.md) page asks for the location too. + +**Outdoor temperature** takes a temperature sensor. The node stores its value in +the daily profiles and uses it for the heating season, see +[Outdoor temperature and heating season](automations-what-is-learned.md#outdoor-temperature-and-heating-season). + +Under **Fine-tuning**, two switches sit above **Exclude devices**. They only +appear while **Learn patterns** is on, and each works on its own. + +- **Habits** turns the [suggestions](automations-learning.md#the-suggestions-band) for + switching times, run times and devices that follow another device on or off. +- **Reliability** turns the reliability checks of the + [rule check](automations-rule-check.md) on or off: flapping, no effect, + overridden, runs while offline, feedback and competition. + +**Exclude devices** opens a picker for the devices that the learning leaves out. +**Allow all** removes every exclusion. The trigger and value checks of the +[rule check](automations-rule-check.md) always run. They only read the +trigger history and write nothing new, so they have no switch. + +## Recording + +![The Recording card of the learning features](../images/dashboard-settings-learning.png) + +**Keep profiles** sets how many days of daily profiles stay, from 14 to 365 +days. The default is 56 days. Chains and automations share one recording, and +each value is written only once. The card shows the memory in use and how much +is written per day. + +**Seasonal data for a whole year** keeps the PV sun course for a year, also +when the profiles are kept for a shorter time. The rule check needs it to tell +from which calendar week a PV threshold is reached again. When it is off, the +sun course stays as long as the profiles. In the first year, while the summer +sun is still missing, a PV threshold is never reported as **Never triggers**. + +**Record minute values** is on by default. The node keeps the power of each +device and the grid balance for every minute. The chain suggestions use this +record. After a restart they catch up on the minutes they missed, if the record +is kept on the drive or the system drive. Switch it off and the node stops +recording minutes. + +The recording has three modes. **Always** records every minute. **Pause while +Home Assistant delivers** stops the own recording as long as the companion +offers minute values from Home Assistant, and starts it again within a minute +when the companion disconnects. It needs a paired companion, so the row stays +greyed out without one. **Off** records nothing. With an extra drive the node +records always. Without a drive but with a paired companion it pauses while +Home Assistant delivers. A mode you choose yourself is never changed. + +**Reconcile with Home Assistant** is on by default and shows only with a paired +companion. Before the heavy nightly calculations the node asks Home Assistant +for the last days that its own recording does not cover without a gap. These +values live in memory for the calculation and are never written to a drive. A +result that rests on five minute values from Home Assistant counts as an +estimate at most. + +**Where minute values are kept** chooses the place: + +- **Memory** keeps the minutes in RAM, for up to 3 days on the economical level + and up to 14 days on the full level. They are lost on restart, so the node + cannot catch up from memory. +- **Extra drive** keeps the minutes on the drive. It is the recommended place + once a drive is set up. The row shows the free space of the drive. +- **System drive** keeps the minutes on the SD card of the node. It writes + about the amount shown on the row each day, so it is never the default. + +Without an extra drive the node records in memory. With a drive, the node +records on the drive. When you set up a drive while the place is on automatic, +the recording moves there by itself, and the page shows the note **An extra +drive is set up. Minute values are now kept there.** with the button **Keep**. +A place you chose yourself is never changed. + +If the drive fails, the recording goes on in memory and the row says **Drive +not available, still recording in memory**. When the drive comes back, the +missing minutes are added, so the day has no gap and no minute twice. + +**Keep minute values** sets how many days stay on the drive or the system drive, +from 1 to 365 days. The default is 60 days. Minute values are large and the node +can learn them again, so they are not part of a backup. **Delete learned data** +removes them too. + +**Delete learned data** asks for confirmation first. It deletes the learned +values and the data behind them, the day profiles and the minute values among +them. Dismissed suggestions, ignored hints and the counters of the rule check +stay. The full list is in +[Deleting the learned data](automations-learning-results.md#deleting-the-learned-data). + +## New features + +When an update switches a learning feature on for the first time, the page +shows a hint with the new features, and the menu entry and each new feature +carry the pill **newly on**. On a fresh installation the hint says that the node +learns from the start. **Keep all** confirms the features and removes the pills. +Single features can still be switched off on the page. diff --git a/docs/dashboard/settings-mqtt.md b/docs/dashboard/settings-mqtt.md index 94d0f15f6..132f9b77e 100644 --- a/docs/dashboard/settings-mqtt.md +++ b/docs/dashboard/settings-mqtt.md @@ -4,13 +4,13 @@ title: "Settings: MQTT" # Settings: MQTT +![MQTT settings](../images/dashboard-settings-mqtt.png) + The tab **MQTT** under *Settings*. Which topics the dashboard reads and writes is described in [Data flows](../developing/data-flow.md). ## MQTT -![MQTT settings](../images/dashboard-settings-mqtt.png) - The broker connection comes with a live status table: connected or not, address, where the configuration came from, connected since, last reconnect and failed attempts. diff --git a/docs/dashboard/settings-network.md b/docs/dashboard/settings-network.md index 865a7087f..8ae3c863e 100644 --- a/docs/dashboard/settings-network.md +++ b/docs/dashboard/settings-network.md @@ -4,6 +4,8 @@ title: "Settings: Network" # Settings: Network +![The Network page](../images/dashboard-settings-network-page.png) + The tab **Network** under *Settings*. It shows how the node is connected to the network, through the LAN cable and through Wi-Fi. You can scan for Wi-Fi networks, connect to one, and forget a saved one. The tab is only shown when @@ -17,6 +19,8 @@ only over HTTPS. The permission is set under ## Connection +![The connection card with LAN and Wi-Fi](../images/dashboard-settings-network.png) + The top card shows the two ways the node can reach the network. Each one has its own state: @@ -40,6 +44,12 @@ note says so, and all changes are locked. A device without a Wi-Fi module shows a note in place of the network list. A USB Wi-Fi stick that Linux supports appears there once it is plugged in. +The connection card also shows **Address for bookmarks**, for example +`https://energy-node.local/`. The address stays the same whether the node is on +cable or Wi-Fi, so bookmark it instead of an IP address. The row only appears +when the node announces its name on the network (mDNS), and the copy button +copies the address. + ## Wi-Fi networks The list shows the networks in range. Each row shows the @@ -114,12 +124,6 @@ Wi-Fi network, pull the cable first or choose *Always ready*. Without a saved Wi-Fi network the card says so, because the node then has nothing to fall back to. A device without a Wi-Fi module shows the card as not available. -The connection card also shows **Address for bookmarks**, for example -`https://energy-node.local/`. The address stays the same whether the node is on -cable or Wi-Fi, so bookmark it instead of an IP address. The row only appears -when the node announces its name on the network (mDNS), and the copy button -copies the address. - ## Emergency hotspot If the node has neither LAN nor Wi-Fi for 5 minutes, it opens a Wi-Fi network of @@ -130,7 +134,7 @@ no network is reachable** turns this on or off. It is on by default. - The network is called `EnergyNode-` followed by four characters, for example `EnergyNode-4F2A`. The password has three short words and two digits, for - example `sonne-wolke-42`. Both are created once per node, unless you set your + example `sonne-wolke-tal-42`. Both are created once per node, unless you set your own password in the installer, see [Configuration](../installer.md#3-configuration). - The installer shows name and password on its [result screen](../installer.md#6-result). Write them down. The page shows them in plain text to everyone who may use diff --git a/docs/dashboard/settings-performance.md b/docs/dashboard/settings-performance.md new file mode 100644 index 000000000..5af823471 --- /dev/null +++ b/docs/dashboard/settings-performance.md @@ -0,0 +1,106 @@ +--- +title: "Settings: Performance" +--- + +# Settings: Performance + +![The Performance page with the budget and the polling rates](../images/dashboard-settings-performance.png) + +The tab **Performance** under *Settings*. Viewing it needs the permission +`view_diagnostics`. **Apply** works only over HTTPS, and each row needs the +right of what it changes: `edit_setup` for the budget, the live update and +the learning level, `automations` for the rule checks and the regulator, +`system_actions` for the node agent and the device services. + +## Budget and polling rates + +Settings, Performance reads `/proc` and the cgroups of the node services every +15 seconds and keeps six hours of samples in memory only. After a restart the +measurement starts again. Proposals need six hours of measurement, until then +the page asks for a confirmation before it applies anything. + +The budget is the share of the CPU the node may use. The default limit is 60 % +on one core and 70 % from two cores. Warning signals such as throttling, high +temperature, little free RAM or swapping reduce the available budget by up to +40 points. You can change the limit in steps of 5 % between 20 and 95 %. + +Every row is one polling rate with the steps the device allows. The lowest step +is the device limit of the service, for example 2 s for Shelly. The limit is stored as +`poll_floor_s` in the manifest of each service. The page of each service +states the source of its value. + +Nothing changes without a click. After you apply, the page records the change +and checks it for 15 minutes. If the 95th percentile of the measured load then +stays below the available budget, the check passes. If it does not, the page +shows the measurement instead of the estimate and makes the rollback the main +button. The rollback puts back the values from before the change. A row that +someone changed in the meantime is a conflict. The page then offers to roll +back only the other rows or to leave everything as it is. The last change is +kept in `performance/last-change.json` in the data directory and survives a +restart. A check that was running then measures again from the start. + +If the node stays over the available budget for 30 minutes, the diagnostics +raise the finding **Performance over budget**. It clears after 10 minutes below +the budget minus 5 points. The measurement itself costs less than 0.5 % of one +core. + +## Breakdown of the dashboard and automation load + +In the card Measurements, the rows Dashboard and Automations open on a click. +They show what the load of that row is made of. The label next to the values says +how the shares were found. + +**Dashboard (measured).** The dashboard times its own work in five parts: + +| Part | What it covers | +|---|---| +| Push to browsers | building and sending the live update stream | +| Other requests | all web requests except the live update stream itself | +| MQTT input | processing each state message | +| Node agent | the regular runs of the node agent | +| Background | the other periodic jobs, such as storage checks, the sweep, the scheduler and the energy recorder | + +The sixth entry is the garbage collection, read from the Go runtime. The parts add up +to the load of the dashboard, so each bar reads as a share of that row. Push also +shows the highest number of open browsers in the window. The live update stream +is left out of the request time because a connection stays open for hours and +would otherwise count as work the whole time. + +**Automations (estimated).** The automation service does not time its rules +one by one. The page spreads the cost of the row "Checking rules" evenly over +all active rules and scenarios, and the cost of the row "Regulator" evenly over the +active scenarios that have a regulator. A scenario with a regulator appears in +both groups. Disabled entries do not count. Each group lists at most six entries, +the rest is shown as "more". The regulator row only exists while at least one +active scenario has a regulator. + +Right after a start nothing is measured yet, and the rows look as before +without a button. + +The split also feeds the cost model of the other rows. Live update takes the +push share of the dashboard, Node agent takes the node share, and the MQTT share +goes into the cost of each message. Requests and background work stay in the +base load. The garbage collection is spread over the parts in proportion, so +the sum of the rows does not change. The split is kept in memory only, like the +rest of the measurement. + +## Learning level + +The card Polling rates has the row **Learning features**. The level is one of +Automatic, Economical, Balanced and Full. Automatic lets the node choose. A +click on a level only changes the draft. **Apply** saves it together with the +polling rates. + +The effort of learning is part of the total load at the top. The measured share +is already counted there. When the draft level is higher or lower, the total +moves by the estimated difference, so you see the effect before you save. In the +card Measurements, learning is listed inside the breakdown of the dashboard, +with its detectors. + +Each level has a target share of the load: 5 percent on Economical and 10 +percent on the others. If the draft level would exceed its target, the page says +so, and the choice stays possible. + +When the share stays below half of the target for 7 days in a row, the page marks +the next higher level as suggested. Selecting it puts it into the draft like any +other level. diff --git a/docs/dashboard/settings-storage.md b/docs/dashboard/settings-storage.md new file mode 100644 index 000000000..130b7556d --- /dev/null +++ b/docs/dashboard/settings-storage.md @@ -0,0 +1,28 @@ +--- +title: "Settings: Storage" +--- + +# Settings: Storage + +![The Storage page with the drives, the storage health and the save interval](../images/dashboard-settings-storage-page.png) + +The page **Storage** under *Settings*. The page is only shown when your account +has the permission *Manage storage* (`storage_manage`). The other pages are +listed on [Settings](settings.md). + +The page has three cards: + +- **Drives** shows the system drive with its usage and lets you set up an + additional drive. How the setup works and what moves to the drive is described + on [Additional drive](../operating/storage.md). +- **Storage health** shows the health and the expected lifetime of the system + medium. Values that the medium reports are marked **Measured**. For a medium + without vendor data the card shows an estimate, marked **Estimated**, which is + not a failure date. The SD estimate needs at least 24 hours of observation. + **Unavailable** means the medium gives no usable health data, for example when + the root file system is not on an MMC medium. **Refresh** reads the values + again. +- **Save running values** sets how often the most recent values of all devices + are written to the drive, in seconds. After a restart the dashboard shows them + again right away. A longer interval protects the SD card. The card tells how + many writes a day the interval causes. diff --git a/docs/dashboard/settings-system.md b/docs/dashboard/settings-system.md index e8dd55c9c..b5a87db8d 100644 --- a/docs/dashboard/settings-system.md +++ b/docs/dashboard/settings-system.md @@ -4,15 +4,15 @@ title: "Settings: System" # Settings: System +![System settings](../images/dashboard-settings-system.png) + The tab **System** under *Settings*. ## System -![System settings](../images/dashboard-settings-system.png) - This tab shows whether your session may run system actions, and holds them: restart the dashboard service, restart the system and shut it down. The -screenshot shows an admin session, so the actions are enabled. In a guest +screenshot at the top shows an admin session, so the actions are enabled. In a guest session they are greyed out, because system actions need a registered user with the permission *Services and bridge* (`system_actions`) and HTTPS. Who you are signed in as and **Sign out** are under diff --git a/docs/dashboard/settings-versions.md b/docs/dashboard/settings-versions.md index aab946951..382304472 100644 --- a/docs/dashboard/settings-versions.md +++ b/docs/dashboard/settings-versions.md @@ -4,13 +4,13 @@ title: "Settings: Versions & updates" # Settings: Versions & updates +![Versions settings](../images/dashboard-settings-versions.png) + The tab **Versions** under *Settings* and the update of the node from the dashboard. ## Versions -![Versions settings](../images/dashboard-settings-versions.png) - This tab shows what is installed on the node. The top card shows the installed package with its version, build date and architecture, and the version the dashboard itself runs as. When the dashboard was updated on its own after the diff --git a/docs/dashboard/settings-wizards.md b/docs/dashboard/settings-wizards.md index 63ff3db67..2c40f52ca 100644 --- a/docs/dashboard/settings-wizards.md +++ b/docs/dashboard/settings-wizards.md @@ -4,13 +4,13 @@ title: "Settings: Tailscale & TinyTuya" # Settings: Tailscale & TinyTuya +![Tailscale wizard](../images/dashboard-settings-tailscale.png) + The tabs **Tailscale** and **TinyTuya** under *Settings*. Each only appears when the matching service is installed on the node. ## Tailscale -![Tailscale wizard](../images/dashboard-settings-tailscale.png) - The wizard has three steps: check the prerequisites, start the login, check the result. It reports whether Tailscale is installed and whether `tailscaled` is active and enabled. Once connected, it shows the connection state, the number diff --git a/docs/dashboard/settings.md b/docs/dashboard/settings.md index c2954614a..05cef0ff7 100644 --- a/docs/dashboard/settings.md +++ b/docs/dashboard/settings.md @@ -1,7 +1,12 @@ --- title: "Settings" anchor_moves: - general: settings.html#learning-features + general: settings-learning.html + learning-features: settings-learning.html + chains: settings-learning.html#chains + automations: settings-learning.html#automations + recording: settings-learning.html#recording + new-features: settings-learning.html#new-features appearance: settings-appearance.html#appearance history: settings-history.html#history mqtt: settings-mqtt.html#mqtt @@ -14,148 +19,36 @@ anchor_moves: # Settings -Settings has twelve pages: Learning features, Appearance, History, MQTT, Tailscale, -TinyTuya, Network, Users, Backup, Versions, Checklist and System. Tailscale and TinyTuya only -appear when the matching service is installed. +![The settings with the list of pages next to the content](../images/dashboard-settings.png) + +Settings has fourteen pages: Appearance, History, Learning features, Network, +MQTT, Tailscale, TinyTuya, Users, Backup, Storage, Performance, Versions, +Checklist and System. Tailscale and TinyTuya only appear when the matching +service is installed. On wide screens the pages are listed in a sidebar next to the content, each with an icon and a short description. On narrow screens a button above the content shows the current page. Tapping it opens the full list as a sheet from the bottom. Swiping sideways on the button moves to the previous or next page. -## Learning features - -The learning features turn the behaviour of your devices into suggestions for -chains and into learned values for rules. They never change a rule or a chain -on their own. Each feature has its own switch, and the page has four cards. - -### Chains - -**Suggestions** searches the power values for devices that measure the same -thing and suggests chains. **Learn values** learns the normal loss of each -measurement chain, see [Efficiency](efficiency.md#learning). When you switch it -off, the values learned so far stay, and the warnings rely on them alone. - -### Automations - -**Learn patterns** learns the switching times, the run times, the use per role -and the energy flows. When you switch it off, the learned values stay at their -last state, so a rule falls back to its default value after 7 days. - -**Location missing** appears on this page while **Learn patterns** is on and no -location is set. Without a location the patterns have no sun times. **Enter location** opens the -automation settings. Meanwhile the node learns neither the best PV curve nor the -PV reserve, the remaining surplus or shade. For a plant with a PV role the -[Monitoring](monitoring.md) page asks for the location too. - -**Outdoor temperature** takes a temperature sensor. The node stores its value in -the daily profiles and uses it for the heating season, see -[Outdoor temperature and heating season](automations-rules.md#outdoor-temperature-and-heating-season). - -Under **Fine-tuning**, two switches sit above **Exclude devices**. They only -appear while **Learn patterns** is on, and each works on its own. - -- **Habits** turns the [suggestions](automations-rules.md#suggestions) for - switching times, run times and devices that follow another device on or off. -- **Reliability** turns the reliability checks of the - [rule check](automations-rules.md#rule-check) on or off: flapping, no effect, - overridden, runs while offline, feedback and competition. - -**Exclude devices** opens a picker for the devices that the learning leaves out. -**Allow all** removes every exclusion. The trigger and value checks of the -[rule check](automations-rules.md#rule-check) always run. They only read the -trigger history and write nothing new, so they have no switch. - -### Recording - -**Keep profiles** sets how many days of daily profiles stay, from 14 to 365 -days. The default is 56 days. Chains and automations share one recording, and -each value is written only once. The card shows the memory in use and how much -is written per day. - -**Seasonal data for a whole year** keeps the PV sun course for a year, also -when the profiles are kept for a shorter time. The rule check needs it to tell -from which calendar week a PV threshold is reached again. When it is off, the -sun course stays as long as the profiles. In the first year, while the summer -sun is still missing, a PV threshold is never reported as **Never triggers**. - -**Record minute values** is on by default. The node keeps the power of each -device and the grid balance for every minute. The chain suggestions use this -record. After a restart they catch up on the minutes they missed, if the record -is kept on the drive or the system drive. Switch it off and the node stops -recording minutes. +The Appearance and Learning features pages keep their earlier versions under +**Settings revisions** at the bottom. The list of bundled libraries with their +licences is at the bottom of every settings page. -The recording has three modes. **Always** records every minute. **Pause while -Home Assistant delivers** stops the own recording as long as the companion -offers minute values from Home Assistant, and starts it again within a minute -when the companion disconnects. It needs a paired companion, so the row stays -greyed out without one. **Off** records nothing. With an extra drive the node -records always. Without a drive but with a paired companion it pauses while -Home Assistant delivers. A mode you choose yourself is never changed. - -**Reconcile with Home Assistant** is on by default and shows only with a paired -companion. Before the heavy nightly calculations the node asks Home Assistant -for the last days that its own recording does not cover without a gap. These -values live in memory for the calculation and are never written to a drive. A -result that rests on five minute values from Home Assistant counts as an -estimate at most. - -**Where minute values are kept** chooses the place: - -- **Memory** keeps the minutes in RAM, for up to 3 days on the economical level - and up to 14 days on the full level. They are lost on restart, so the node - cannot catch up from memory. -- **Extra drive** keeps the minutes on the drive. It is the recommended place - once a drive is set up. The row shows the free space of the drive. -- **System drive** keeps the minutes on the SD card of the node. It writes - about the amount shown on the row each day, so it is never the default. - -Without an extra drive the node records in memory. With a drive, the node -records on the drive. When you set up a drive while the place is on automatic, -the recording moves there by itself, and the page shows the note **An extra -drive is set up. Minute values are now kept there.** with the button **Keep**. -A place you chose yourself is never changed. - -If the drive fails, the recording goes on in memory and the row says **Drive -not available, still recording in memory**. When the drive comes back, the -missing minutes are added, so the day has no gap and no minute twice. - -**Keep minute values** sets how many days stay on the drive or the system drive, -from 1 to 365 days. The default is 60 days. Minute values are large and the node -can learn them again, so they are not part of a backup. **Delete learned data** -removes them too. - -**Delete learned data** asks for confirmation first. It deletes the learned -values and the data behind them, the day profiles and the minute values among -them. Dismissed suggestions, ignored hints and the counters of the rule check -stay. The full list is in -[Deleting the learned data](automations-learning.md#deleting-the-learned-data). - -### New features - -When an update switches a learning feature on for the first time, the page -shows a hint with the new features, and the menu entry and each new feature -carry the pill **newly on**. On a fresh installation the hint says that the node -learns from the start. **Keep all** confirms the features and removes the pills. -Single features can still be switched off on the page. - -### Moved settings - -The General page is gone. **Save running values** is now on the Storage page, -and **Stale values** is on the [MQTT](settings-mqtt.md) page. - -## Other pages +## Pages | Page | Tabs | What you set there | |---|---|---| -| [Learning features](#learning-features) | Chains, Automations, Recording | learning of chains and automations, how long daily profiles are kept, deleting the learned data | | [Appearance](settings-appearance.md) | Appearance | default view, colour scheme, language and number format | | [History](settings-history.md) | History | recording and retention in the browser, exchange between devices, recording of the energy statistics | +| [Learning features](settings-learning.md) | Chains, Automations, Recording | learning of chains and automations, how long daily profiles are kept, deleting the learned data | +| [Network](settings-network.md) | Network | the connection over LAN and Wi-Fi, scanning for Wi-Fi networks, connecting and forgetting networks | | [MQTT](settings-mqtt.md) | MQTT | broker connection, the "Energy Node" device in Home Assistant, the bridge to the main site | | [Tailscale & TinyTuya](settings-wizards.md) | Tailscale, TinyTuya | the setup wizards for the tailnet and for Tuya devices | -| [Network](settings-network.md) | Network | the connection over LAN and Wi-Fi, scanning for Wi-Fi networks, connecting and forgetting networks | | [Users](settings-users.md) | Me, Accounts, Sessions | sign-in and password, accounts and permissions, presets, guest access, Home Assistant users, signed-in sessions | | [Backup](settings-backup.md) | Backup | backup archives of the settings, devices, users, statistics and history, automatic backups before updates and on a schedule, restore | +| [Storage](settings-storage.md) | Storage | the system drive, an additional drive, the storage health check and how often running values are saved | +| [Performance](settings-performance.md) | Performance | the CPU budget, the polling rates of the services and the learning level | | [Versions & updates](settings-versions.md) | Versions | installed versions, changelogs, update check and the update from the dashboard | | [Checklist](settings-checklist.md) | Checklist | the steps of the first-time setup and the tours of new features | | [System](settings-system.md) | System | system actions (restart and shutdown), the central configuration file | diff --git a/docs/developing/data-flow-energy.md b/docs/developing/data-flow-energy.md index 4054f22ea..dec44b082 100644 --- a/docs/developing/data-flow-energy.md +++ b/docs/developing/data-flow-energy.md @@ -340,3 +340,33 @@ seconds, after the balance, from the same snapshot. The code is `energy.BuildCha The balance and the chain signals stay separate topics, so a chain signal never changes the balance. The automation conditions are the only planned readers. The dashboard's own views keep reading the snapshot, not this topic. + +## Learning files + +The learning features keep the PV shade raster, the learned PV model, the +weather data, the device cycles and the surplus forecast in +`autolearn/pvraster.json`, `autolearn/pvmodel.json`, +`autolearn/pvweather.json`, `autolearn/cycles.json` and +`autolearn/forecast.json` in the data directory. + +The origin of a switch comes from the automation state document. It counts the +firings of each rule in `fire_count` and records the time of the last one in +`fired_at`. A switch that follows such a firing counts as a rule switch. + +### Learned keys and their detectors + +| Key | Meaning | Unit | Origin (detector) | +|---|---|---|---| +| `site/day_start` | Start of the day, per day type | Clock time | `learn_day_bounds` | +| `site/night_rest` | Night rest, per day type | Clock time | `learn_day_bounds` | +| `site/house_state` | House state, for example quiet | State | `learn_house_state` | +| `site/pv_reserve_w` | PV reserve | W | `learn_pv_reserve` | +| `site/surplus_left_wh` | Remaining surplus today | Wh | `learn_surplus` | +| `site/base_w` | Base load of the house at night | W | `baseload` | +| `site/battery_full_at` | Time the battery is usually full | Clock time | `battery` | +| `site/night_wh` | Energy the house takes from the battery at night | Wh | `battery` | +| `device//usual_on` | Usual switch-on time | Clock time | `learn_switch_time` | +| `device//usual_off` | Usual switch-off time | Clock time | `learn_switch_time` | +| `device//usual_runtime_s` | Usual runtime of one run | s | `learn_runtime` | +| `device//op_power_w` | Typical operating power | W | `learn_cycles` | +| `device//cycle_wh` | Typical energy of one cycle | Wh | `learn_cycles` | diff --git a/docs/developing/manual-installation-deploy.md b/docs/developing/manual-installation-deploy.md index a977ce72a..8d263e655 100644 --- a/docs/developing/manual-installation-deploy.md +++ b/docs/developing/manual-installation-deploy.md @@ -136,9 +136,9 @@ Plain HTTP on port 8080 works right away. Admin sessions are blocked over plain HTTP, so for HTTPS and the admin login put Caddy in front. The installer sets up Caddy as step 70 from the pinned package in the -installation package, see [Packages you must install outdated -first](manual-installation.md#3-packages-you-must-install-outdated-first). By hand, install -Caddy on the node first. On ARMv6, take the `armv6` or `armhf` build from the +installation package, see +[Packages you must install outdated first](manual-installation.md#3-packages-you-must-install-outdated-first). +By hand, install Caddy on the node first. On ARMv6, take the `armv6` or `armhf` build from the Caddy project, since your distribution may not ship one. Then install the repository's `Caddyfile`: diff --git a/docs/developing/manual-installation.md b/docs/developing/manual-installation.md index 0bc8fdaee..cb0201032 100644 --- a/docs/developing/manual-installation.md +++ b/docs/developing/manual-installation.md @@ -1,8 +1,8 @@ --- title: "Manual installation" anchor_moves: - 31-tailscale--install-1620-then-update: index.html#31-tailscale-install-1620-then-update - 33-go-and-nodejs--do-not-install-them-on-the-node: index.html#33-go-and-nodejs-do-not-install-them-on-the-node + 31-tailscale--install-1620-then-update: manual-installation.html#31-tailscale-install-1620-then-update + 33-go-and-nodejs--do-not-install-them-on-the-node: manual-installation.html#33-go-and-nodejs-do-not-install-them-on-the-node --- # Manual installation diff --git a/docs/developing/releasing.md b/docs/developing/releasing.md index 647d5078b..8b3967fcb 100644 --- a/docs/developing/releasing.md +++ b/docs/developing/releasing.md @@ -74,7 +74,7 @@ The script settles versions and changelogs itself and prints the rest. Resolve every `CONFLICT` path and `git add` it. `--continue` sets the `?v=` marks of the shared assets and the history rows again, so a hand-set mark is only needed for an `ASSET` path. The details are in -[lazy-assets-cache-busting.md](../_internal/lazy-assets-cache-busting.md). Then +`docs/_internal/lazy-assets-cache-busting.md` in the repository. Then finish the merge: ```sh diff --git a/docs/images/dashboard-automation-finding-popover.png b/docs/images/dashboard-automation-finding-popover.png new file mode 100644 index 000000000..829ed0274 Binary files /dev/null and b/docs/images/dashboard-automation-finding-popover.png differ diff --git a/docs/images/dashboard-automation-learned-value.png b/docs/images/dashboard-automation-learned-value.png new file mode 100644 index 000000000..67d52ba5d Binary files /dev/null and b/docs/images/dashboard-automation-learned-value.png differ diff --git a/docs/images/dashboard-automation-learned-values.png b/docs/images/dashboard-automation-learned-values.png new file mode 100644 index 000000000..a5687ceac Binary files /dev/null and b/docs/images/dashboard-automation-learned-values.png differ diff --git a/docs/images/dashboard-automation-learning.png b/docs/images/dashboard-automation-learning.png new file mode 100644 index 000000000..66042de3d Binary files /dev/null and b/docs/images/dashboard-automation-learning.png differ diff --git a/docs/images/dashboard-automation-rule-check.png b/docs/images/dashboard-automation-rule-check.png new file mode 100644 index 000000000..43b9c09a2 Binary files /dev/null and b/docs/images/dashboard-automation-rule-check.png differ diff --git a/docs/images/dashboard-automation-rules.png b/docs/images/dashboard-automation-rules.png new file mode 100644 index 000000000..ea7968269 Binary files /dev/null and b/docs/images/dashboard-automation-rules.png differ diff --git a/docs/images/dashboard-automation-scenarios.png b/docs/images/dashboard-automation-scenarios.png new file mode 100644 index 000000000..4917892e2 Binary files /dev/null and b/docs/images/dashboard-automation-scenarios.png differ diff --git a/docs/images/dashboard-automation-suggestions.png b/docs/images/dashboard-automation-suggestions.png new file mode 100644 index 000000000..f20348e03 Binary files /dev/null and b/docs/images/dashboard-automation-suggestions.png differ diff --git a/docs/images/dashboard-automation.png b/docs/images/dashboard-automation.png index 6206bbb73..0575f8515 100644 Binary files a/docs/images/dashboard-automation.png and b/docs/images/dashboard-automation.png differ diff --git a/docs/images/dashboard-cards.png b/docs/images/dashboard-cards.png new file mode 100644 index 000000000..1e6ee9add Binary files /dev/null and b/docs/images/dashboard-cards.png differ diff --git a/docs/images/dashboard-device-map-balance.png b/docs/images/dashboard-device-map-balance.png index f58945036..48c0fd10d 100644 Binary files a/docs/images/dashboard-device-map-balance.png and b/docs/images/dashboard-device-map-balance.png differ diff --git a/docs/images/dashboard-device-map-dataflow.png b/docs/images/dashboard-device-map-dataflow.png index e96dacdba..c8af8698f 100644 Binary files a/docs/images/dashboard-device-map-dataflow.png and b/docs/images/dashboard-device-map-dataflow.png differ diff --git a/docs/images/dashboard-device-map-filter-menu.png b/docs/images/dashboard-device-map-filter-menu.png index 04e1de6f4..04d01c3a5 100644 Binary files a/docs/images/dashboard-device-map-filter-menu.png and b/docs/images/dashboard-device-map-filter-menu.png differ diff --git a/docs/images/dashboard-device-map-losses.png b/docs/images/dashboard-device-map-losses.png new file mode 100644 index 000000000..c5055fd67 Binary files /dev/null and b/docs/images/dashboard-device-map-losses.png differ diff --git a/docs/images/dashboard-device-map-switch-off.png b/docs/images/dashboard-device-map-switch-off.png index a19b96b13..dd96e56f7 100644 Binary files a/docs/images/dashboard-device-map-switch-off.png and b/docs/images/dashboard-device-map-switch-off.png differ diff --git a/docs/images/dashboard-device-map-view-menu.png b/docs/images/dashboard-device-map-view-menu.png index eb151b945..cbf367d68 100644 Binary files a/docs/images/dashboard-device-map-view-menu.png and b/docs/images/dashboard-device-map-view-menu.png differ diff --git a/docs/images/dashboard-device-map.png b/docs/images/dashboard-device-map.png index d23aeb868..71f72f083 100644 Binary files a/docs/images/dashboard-device-map.png and b/docs/images/dashboard-device-map.png differ diff --git a/docs/images/dashboard-devices.png b/docs/images/dashboard-devices.png index 9dfec663b..8274a11f7 100644 Binary files a/docs/images/dashboard-devices.png and b/docs/images/dashboard-devices.png differ diff --git a/docs/images/dashboard-diagnosis.png b/docs/images/dashboard-diagnosis.png index 20530a426..b341669ae 100644 Binary files a/docs/images/dashboard-diagnosis.png and b/docs/images/dashboard-diagnosis.png differ diff --git a/docs/images/dashboard-efficiency.png b/docs/images/dashboard-efficiency.png new file mode 100644 index 000000000..5cada9a44 Binary files /dev/null and b/docs/images/dashboard-efficiency.png differ diff --git a/docs/images/dashboard-energy-chains.png b/docs/images/dashboard-energy-chains.png new file mode 100644 index 000000000..20062e073 Binary files /dev/null and b/docs/images/dashboard-energy-chains.png differ diff --git a/docs/images/dashboard-energy.png b/docs/images/dashboard-energy.png new file mode 100644 index 000000000..565b2d4df Binary files /dev/null and b/docs/images/dashboard-energy.png differ diff --git a/docs/images/dashboard-layout-editor-tablet.png b/docs/images/dashboard-layout-editor-tablet.png index 53598d962..ef3cef239 100644 Binary files a/docs/images/dashboard-layout-editor-tablet.png and b/docs/images/dashboard-layout-editor-tablet.png differ diff --git a/docs/images/dashboard-learning-results.png b/docs/images/dashboard-learning-results.png new file mode 100644 index 000000000..e7ee7954a Binary files /dev/null and b/docs/images/dashboard-learning-results.png differ diff --git a/docs/images/dashboard-monitoring-forecast.png b/docs/images/dashboard-monitoring-forecast.png new file mode 100644 index 000000000..b82f370d2 Binary files /dev/null and b/docs/images/dashboard-monitoring-forecast.png differ diff --git a/docs/images/dashboard-monitoring-learned.png b/docs/images/dashboard-monitoring-learned.png new file mode 100644 index 000000000..2d5b05e1a Binary files /dev/null and b/docs/images/dashboard-monitoring-learned.png differ diff --git a/docs/images/dashboard-monitoring-notices.png b/docs/images/dashboard-monitoring-notices.png new file mode 100644 index 000000000..450f86674 Binary files /dev/null and b/docs/images/dashboard-monitoring-notices.png differ diff --git a/docs/images/dashboard-monitoring.png b/docs/images/dashboard-monitoring.png new file mode 100644 index 000000000..443154577 Binary files /dev/null and b/docs/images/dashboard-monitoring.png differ diff --git a/docs/images/dashboard-onboarding-setup-start.png b/docs/images/dashboard-onboarding-setup-start.png index a944e4967..2509f7ec5 100644 Binary files a/docs/images/dashboard-onboarding-setup-start.png and b/docs/images/dashboard-onboarding-setup-start.png differ diff --git a/docs/images/dashboard-onboarding-setup-step.png b/docs/images/dashboard-onboarding-setup-step.png index ec43ceec9..84ea20f5b 100644 Binary files a/docs/images/dashboard-onboarding-setup-step.png and b/docs/images/dashboard-onboarding-setup-step.png differ diff --git a/docs/images/dashboard-overview.png b/docs/images/dashboard-overview.png index fd85ce1b5..7de2de27f 100644 Binary files a/docs/images/dashboard-overview.png and b/docs/images/dashboard-overview.png differ diff --git a/docs/images/dashboard-settings-backup.png b/docs/images/dashboard-settings-backup.png index 324ec89d6..a276b0810 100644 Binary files a/docs/images/dashboard-settings-backup.png and b/docs/images/dashboard-settings-backup.png differ diff --git a/docs/images/dashboard-settings-checklist.png b/docs/images/dashboard-settings-checklist.png index f6f123d84..defc2e512 100644 Binary files a/docs/images/dashboard-settings-checklist.png and b/docs/images/dashboard-settings-checklist.png differ diff --git a/docs/images/dashboard-settings-display.png b/docs/images/dashboard-settings-display.png index e592288a8..272b2a1dc 100644 Binary files a/docs/images/dashboard-settings-display.png and b/docs/images/dashboard-settings-display.png differ diff --git a/docs/images/dashboard-settings-history.png b/docs/images/dashboard-settings-history.png index 873164161..ffb4f447f 100644 Binary files a/docs/images/dashboard-settings-history.png and b/docs/images/dashboard-settings-history.png differ diff --git a/docs/images/dashboard-settings-learning-page.png b/docs/images/dashboard-settings-learning-page.png new file mode 100644 index 000000000..29bf0588b Binary files /dev/null and b/docs/images/dashboard-settings-learning-page.png differ diff --git a/docs/images/dashboard-settings-learning.png b/docs/images/dashboard-settings-learning.png new file mode 100644 index 000000000..45e584fb8 Binary files /dev/null and b/docs/images/dashboard-settings-learning.png differ diff --git a/docs/images/dashboard-settings-mqtt-sensors.png b/docs/images/dashboard-settings-mqtt-sensors.png index 563ed37b2..4efd6da7a 100644 Binary files a/docs/images/dashboard-settings-mqtt-sensors.png and b/docs/images/dashboard-settings-mqtt-sensors.png differ diff --git a/docs/images/dashboard-settings-mqtt.png b/docs/images/dashboard-settings-mqtt.png index 5a03c074f..00f74c9b6 100644 Binary files a/docs/images/dashboard-settings-mqtt.png and b/docs/images/dashboard-settings-mqtt.png differ diff --git a/docs/images/dashboard-settings-network-page.png b/docs/images/dashboard-settings-network-page.png new file mode 100644 index 000000000..c7e98f2fa Binary files /dev/null and b/docs/images/dashboard-settings-network-page.png differ diff --git a/docs/images/dashboard-settings-network.png b/docs/images/dashboard-settings-network.png new file mode 100644 index 000000000..862b4ecfc Binary files /dev/null and b/docs/images/dashboard-settings-network.png differ diff --git a/docs/images/dashboard-settings-performance.png b/docs/images/dashboard-settings-performance.png new file mode 100644 index 000000000..ad9cec179 Binary files /dev/null and b/docs/images/dashboard-settings-performance.png differ diff --git a/docs/images/dashboard-settings-storage-page.png b/docs/images/dashboard-settings-storage-page.png new file mode 100644 index 000000000..f87a50b03 Binary files /dev/null and b/docs/images/dashboard-settings-storage-page.png differ diff --git a/docs/images/dashboard-settings-storage.png b/docs/images/dashboard-settings-storage.png new file mode 100644 index 000000000..5b4d7675d Binary files /dev/null and b/docs/images/dashboard-settings-storage.png differ diff --git a/docs/images/dashboard-settings-system.png b/docs/images/dashboard-settings-system.png index 7fa21e917..2d4667894 100644 Binary files a/docs/images/dashboard-settings-system.png and b/docs/images/dashboard-settings-system.png differ diff --git a/docs/images/dashboard-settings-tailscale.png b/docs/images/dashboard-settings-tailscale.png index 7e51ba7d1..e20372113 100644 Binary files a/docs/images/dashboard-settings-tailscale.png and b/docs/images/dashboard-settings-tailscale.png differ diff --git a/docs/images/dashboard-settings-tinytuya.png b/docs/images/dashboard-settings-tinytuya.png index db5e3c9f4..34f7858cd 100644 Binary files a/docs/images/dashboard-settings-tinytuya.png and b/docs/images/dashboard-settings-tinytuya.png differ diff --git a/docs/images/dashboard-settings-users.png b/docs/images/dashboard-settings-users.png index e6ad97cb9..23a915a79 100644 Binary files a/docs/images/dashboard-settings-users.png and b/docs/images/dashboard-settings-users.png differ diff --git a/docs/images/dashboard-settings-versions.png b/docs/images/dashboard-settings-versions.png index f87d77ed2..bd18123ed 100644 Binary files a/docs/images/dashboard-settings-versions.png and b/docs/images/dashboard-settings-versions.png differ diff --git a/docs/images/dashboard-settings.png b/docs/images/dashboard-settings.png new file mode 100644 index 000000000..88c748670 Binary files /dev/null and b/docs/images/dashboard-settings.png differ diff --git a/docs/images/dashboard-theme-blue.png b/docs/images/dashboard-theme-blue.png index 8f02c4e1c..c03f31e32 100644 Binary files a/docs/images/dashboard-theme-blue.png and b/docs/images/dashboard-theme-blue.png differ diff --git a/docs/images/dashboard-theme-default-mint.png b/docs/images/dashboard-theme-default-mint.png index 65184ad6d..6f82a6a31 100644 Binary files a/docs/images/dashboard-theme-default-mint.png and b/docs/images/dashboard-theme-default-mint.png differ diff --git a/docs/images/dashboard-theme-light.png b/docs/images/dashboard-theme-light.png index 862355a0f..7a549f43a 100644 Binary files a/docs/images/dashboard-theme-light.png and b/docs/images/dashboard-theme-light.png differ diff --git a/docs/images/dashboard-theme-yellow.png b/docs/images/dashboard-theme-yellow.png index e2afcd6f2..796a7b1fa 100644 Binary files a/docs/images/dashboard-theme-yellow.png and b/docs/images/dashboard-theme-yellow.png differ diff --git a/docs/images/dashboard-update-available.png b/docs/images/dashboard-update-available.png index 0cd6ab5da..088cf2d3c 100644 Binary files a/docs/images/dashboard-update-available.png and b/docs/images/dashboard-update-available.png differ diff --git a/docs/images/dashboard-update-preview.png b/docs/images/dashboard-update-preview.png index e9b82dbd7..1debe79ce 100644 Binary files a/docs/images/dashboard-update-preview.png and b/docs/images/dashboard-update-preview.png differ diff --git a/docs/images/dashboard-what-is-learned.png b/docs/images/dashboard-what-is-learned.png new file mode 100644 index 000000000..2f839488b Binary files /dev/null and b/docs/images/dashboard-what-is-learned.png differ diff --git a/docs/images/dashboard.png b/docs/images/dashboard.png index 63031cd0b..c4b73dc48 100644 Binary files a/docs/images/dashboard.png and b/docs/images/dashboard.png differ diff --git a/docs/images/installer-connect.png b/docs/images/installer-connect.png index f62468e33..b3bc11c89 100644 Binary files a/docs/images/installer-connect.png and b/docs/images/installer-connect.png differ diff --git a/docs/images/installer-diagnose.png b/docs/images/installer-diagnose.png index b73aadf94..b1294612d 100644 Binary files a/docs/images/installer-diagnose.png and b/docs/images/installer-diagnose.png differ diff --git a/docs/images/installer-fingerprint.png b/docs/images/installer-fingerprint.png index 30be11080..48aed8ab2 100644 Binary files a/docs/images/installer-fingerprint.png and b/docs/images/installer-fingerprint.png differ diff --git a/docs/images/installer-media-debian.png b/docs/images/installer-media-debian.png new file mode 100644 index 000000000..45007f8c8 Binary files /dev/null and b/docs/images/installer-media-debian.png differ diff --git a/docs/images/installer-media-pi.png b/docs/images/installer-media-pi.png new file mode 100644 index 000000000..f01fb796f Binary files /dev/null and b/docs/images/installer-media-pi.png differ diff --git a/docs/images/installer-sudo.png b/docs/images/installer-sudo.png index 9cf601a46..6106d4a8e 100644 Binary files a/docs/images/installer-sudo.png and b/docs/images/installer-sudo.png differ diff --git a/docs/images/installer-update.png b/docs/images/installer-update.png index e819e96b6..a1373ae8e 100644 Binary files a/docs/images/installer-update.png and b/docs/images/installer-update.png differ diff --git a/docs/images/measurement-chain.svg b/docs/images/measurement-chain.svg new file mode 100644 index 000000000..36870ef94 --- /dev/null +++ b/docs/images/measurement-chain.svg @@ -0,0 +1,40 @@ + + Measurement chain: four points from the inverter to the wallbox, with the counting point at the distribution board + + + + + + + + + + + + + + + segment 1 + segment 2 + segment 3 + substitute value + learned loss + + + + + + + + + + + Inverter + reference point + Distribution + counting point + Wallbox meter + reference point + Wallbox + reference point + + diff --git a/docs/images/results-check-timeline.svg b/docs/images/results-check-timeline.svg new file mode 100644 index 000000000..f01e87bd5 --- /dev/null +++ b/docs/images/results-check-timeline.svg @@ -0,0 +1,55 @@ + + Results check timeline: baseline weeks 1 to 4, a partial week 5 after the suggestion is adopted, and weeks 6 to 13 with the measured effect + + + + + + + + + + + + suggestion adopted + + + + + + + + + + + + + + + + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + + baseline, + up to 4 weeks + partial week, + not counted + effect measured, + shown in Monitoring for 8 weeks + + diff --git a/docs/installer-operating-system.md b/docs/installer-operating-system.md index c0d1baa2b..4724dc692 100644 --- a/docs/installer-operating-system.md +++ b/docs/installer-operating-system.md @@ -1,6 +1,9 @@ --- title: "Operating system" component: installer +anchor_moves: + raspberry-pi-with-the-raspberry-pi-imager: installer-operating-system.html#by-hand-raspberry-pi-with-the-raspberry-pi-imager + x86-with-debian: installer-operating-system.html#by-hand-x86-with-debian --- # Operating system @@ -36,10 +39,19 @@ dependencies from the internet instead. You confirm that once, the node then needs internet access, and those files are not covered by the package signature. Everything else in the package stays verified. -## Raspberry Pi with the Raspberry Pi Imager +## The quick way: the Media tab + +The installer's **Media** tab writes the card for a Raspberry Pi, or builds a +USB stick that installs Debian on an x86 or ARM computer by itself. It sets the +device name, the user `node` with key login, the time zone and Wi-Fi for you. +See [Preparing a storage medium](installer.md#preparing-a-storage-medium). The +sections below describe the same steps by hand, for when you do not use the +installer for it. + +## By hand: Raspberry Pi with the Raspberry Pi Imager - Pick the image from the table above. The installer's **Media** tab can also - write the card for you on Linux and Windows, see + write the card for you on Linux, Windows and macOS, see [Preparing a storage medium](installer.md#preparing-a-storage-medium). - Set hostname, user, SSH, WiFi and timezone in the Imager before it writes the card. On a headless remote site you do not want to find out afterwards @@ -49,7 +61,7 @@ signature. Everything else in the package stays verified. energy-node installer at `.local`. The installer updates the system packages itself, which takes a long time on a Pi 1. -## x86 with Debian +## By hand: x86 with Debian Before you start: diff --git a/docs/installer.md b/docs/installer.md index f597b3a02..d23b45259 100644 --- a/docs/installer.md +++ b/docs/installer.md @@ -109,6 +109,8 @@ The same tab also builds a USB stick that installs Debian on other hardware, see ### Raspberry Pi +![The Settings step of the Media tab for a Raspberry Pi](images/installer-media-pi.png) + 1. **Device.** Pick the Pi model. The box below the list shows the image, the installation package and the download size. Models that have not been tested yet carry an experimental label. @@ -158,6 +160,8 @@ question. ### Other hardware (Debian) +![The Settings step of the Media tab for a Debian USB stick](images/installer-media-debian.png) + For x86 64-bit computers, such as the AMD GX-424CC or Intel N100 thin clients, and for 64-bit ARM computers with UEFI, the installer builds a USB stick that installs Debian 13 on the device by itself. Pick the **Generic** entries in the diff --git a/docs/operating/performance.md b/docs/operating/performance.md index 9e0673ed5..2ce1fe19b 100644 --- a/docs/operating/performance.md +++ b/docs/operating/performance.md @@ -14,7 +14,7 @@ that was measured and which optimisations came out of it. > from a shared CPU budget, applies them on one click, checks the effect for 15 > minutes and offers a rollback. The commands in §1 explain where the figures > come from. They are background, not the way to measure any more. See -> [The Performance page](#the-performance-page) at the end of this page. +> [Settings: Performance](../dashboard/settings-performance.md). The measurement was taken on 2026-08-29 on the live node, a Raspberry Pi 1 Model B Rev 2 (ARMv6, single core, 512 MB of which 427 MB are usable and the @@ -231,93 +231,4 @@ dashboard and not in the bridges. The next steps are raising ## 7. The Performance page -Settings, Performance reads `/proc` and the cgroups of the node services every -15 seconds and keeps six hours of samples in memory only. After a restart the -measurement starts again. Proposals need six hours of measurement, until then -the page asks for a confirmation before it applies anything. - -The budget is the share of the CPU the node may use. The default limit is 60 % -on one core and 70 % from two cores. Warning signals such as throttling, high -temperature, little free RAM or swapping reduce the available budget by up to -40 points. You can change the limit in steps of 5 % between 20 and 95 %. - -Every row is one polling rate with the steps the device allows. The lowest step -is the device limit of the service, for example 2 s for Shelly. The limit is stored as -`poll_floor_s` in the manifest of each service. The page of each service -states the source of its value. - -Nothing changes without a click. After you apply, the page records the change -and checks it for 15 minutes. If the 95th percentile of the measured load then -stays below the available budget, the check passes. If it does not, the page -shows the measurement instead of the estimate and makes the rollback the main -button. The rollback puts back the values from before the change. A row that -someone changed in the meantime is a conflict. The page then offers to roll -back only the other rows or to leave everything as it is. The last change is -kept in `performance/last-change.json` in the data directory and survives a -restart. A check that was running then measures again from the start. - -If the node stays over the available budget for 30 minutes, the diagnostics -raise the finding **Performance over budget**. It clears after 10 minutes below -the budget minus 5 points. The measurement itself costs less than 0.5 % of one -core. - -### 7.1 Breakdown of the dashboard and automation load - -In the card Measurements, the rows Dashboard and Automations open on a click. -They show what the load of that row is made of. The label next to the values says -how the shares were found. - -**Dashboard (measured).** The dashboard times its own work in five parts: - -| Part | What it covers | -|---|---| -| Push to browsers | building and sending the live update stream | -| Other requests | all web requests except the live update stream itself | -| MQTT input | processing each state message | -| Node agent | the regular runs of the node agent | -| Background | the other periodic jobs, such as storage checks, the sweep, the scheduler and the energy recorder | - -The sixth entry is the garbage collection, read from the Go runtime. The parts add up -to the load of the dashboard, so each bar reads as a share of that row. Push also -shows the highest number of open browsers in the window. The live update stream -is left out of the request time because a connection stays open for hours and -would otherwise count as work the whole time. - -**Automations (estimated).** The automation service does not time its rules -one by one. The page spreads the cost of the row "Checking rules" evenly over -all active rules and scenarios, and the cost of the row "Regulator" evenly over the -active scenarios that have a regulator. A scenario with a regulator appears in -both groups. Disabled entries do not count. Each group lists at most six entries, -the rest is shown as "more". The regulator row only exists while at least one -active scenario has a regulator. - -Right after a start nothing is measured yet, and the rows look as before -without a button. - -The split also feeds the cost model of the other rows. Live update takes the -push share of the dashboard, Node agent takes the node share, and the MQTT share -goes into the cost of each message. Requests and background work stay in the -base load. The garbage collection is spread over the parts in proportion, so -the sum of the rows does not change. The split is kept in memory only, like the -rest of the measurement. - -### 7.2 Learning level - -The card Polling rates has the row **Learning features**. The level is one of -Automatic, Economical, Balanced and Full. Automatic lets the node choose. A -click on a level only changes the draft. **Apply** saves it together with the -polling rates. - -The effort of learning is part of the total load at the top. The measured share -is already counted there. When the draft level is higher or lower, the total -moves by the estimated difference, so you see the effect before you save. In the -card Measurements, learning is listed inside the breakdown of the dashboard, -with its detectors. - -Each level has a target share of the load: 5 percent on Economical and 10 -percent on the others. If the draft level would exceed its target, the page says -so, and the choice stays possible. - -When the share stays below half of the target for 7 days in a row, the page marks -the next higher level as suggested. Selecting it puts it into the draft like any -other level. +The page that replaced this measurement is described in [Settings: Performance](../dashboard/settings-performance.md). diff --git a/docs/operating/storage.md b/docs/operating/storage.md index 674bb764f..fa9ff90f5 100644 --- a/docs/operating/storage.md +++ b/docs/operating/storage.md @@ -4,6 +4,8 @@ title: "Additional drive" # Additional drive +![The Storage page with the system drive, the storage health and the save interval](../images/dashboard-settings-storage.png) + An additional drive takes the running data and the backups off the SD card. This protects the card, which wears out under constant writes, and gives the node room for backups. The drive is set up under *Settings, Storage*. The tab is only diff --git a/docs/services/automations-how-it-works.md b/docs/services/automations-how-it-works.md index 8b08b94f7..f56fcc832 100644 --- a/docs/services/automations-how-it-works.md +++ b/docs/services/automations-how-it-works.md @@ -396,5 +396,5 @@ or **Do not suggest again**, leave the list before the cap. The band shows at most 20 suggestions. In the first three places at most two suggestions of the same detector appear. -The page [Automations: Learning](../dashboard/automations-learning.md) lists the +The page [Automations: Suggestions](../dashboard/automations-learning.md) lists the minimum data of each kind. diff --git a/installer/webui/CHANGELOG.md b/installer/webui/CHANGELOG.md index ff1041854..bcf853a94 100644 --- a/installer/webui/CHANGELOG.md +++ b/installer/webui/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## v0.3.4-pre.11 (2026-11-06) +## v0.3.4-pre.12 (2026-11-06) ### Features @@ -90,6 +90,8 @@ ### Documentation +- add media screenshots to the installer script and two explanatory sketches (847d02e) +- update the user documentation and screenshots for v0.12.0 (#309) - **installer:** name the winget link kind (fe178db) - **installer:** draw the configure modules in the reference draft (ffb05a9) - **installer:** draw the update preview modules in the reference draft (505550a) @@ -97,6 +99,7 @@ ### Tests +- **installer:** pick the update and diagnose modes by label in the docs shots (76056a6) - **installer:** show the node package and apply selection in the fakehost (2a14121) - **installer:** follow the reworded package text in the connect draft (9a90595) - **installer:** show the journal and tailscale log steps in the fakehost (d894248) diff --git a/installer/webui/VERSION b/installer/webui/VERSION index c4d6f52bf..0e081d506 100644 --- a/installer/webui/VERSION +++ b/installer/webui/VERSION @@ -1 +1 @@ -v0.3.4-pre.11 +v0.3.4-pre.12 diff --git a/installer/webui/test/e2e/docs-screenshots.mjs b/installer/webui/test/e2e/docs-screenshots.mjs index a92758349..d49d2c46f 100644 --- a/installer/webui/test/e2e/docs-screenshots.mjs +++ b/installer/webui/test/e2e/docs-screenshots.mjs @@ -18,7 +18,9 @@ // Testwirt im Szenario vorlage angehalten bei Schritt 85), // installer-connect.png (Verbindung mit ausgefuelltem Formular), // installer-fingerprint.png (erster Kontakt, Fingerabdruck offen) und -// installer-result.png (Ergebnis einer fertigen Erstinstallation). +// installer-result.png (Ergebnis einer fertigen Erstinstallation), +// installer-media-pi.png (Medium fuer den Pi, Einstellungen) und +// installer-media-debian.png (Medium fuer den x86-Stick, Einstellungen). import { chromium } from 'playwright'; import { mkdir } from 'node:fs/promises'; import path from 'node:path'; @@ -55,7 +57,7 @@ async function preview() { const page = await context.newPage(); await page.goto(host.url); await page.locator('.app:not([x-cloak]) .bar-title:not(:empty)').waitFor(); - await page.locator('.mode-i').nth(1).click(); + await page.locator('.mode-i', { hasText: en['entry.redeploy'] }).click(); await page.locator('input[aria-labelledby="connect-address"]').fill('energy-node.local'); await page.locator('input[aria-labelledby="connect-user"]').fill('pi'); await page.locator('input[aria-labelledby="connect-password"]').fill('raspberry-7731'); @@ -141,6 +143,12 @@ async function connectForm({ trusted }) { await page.goto(host.url); await page.locator('.app:not([x-cloak]) .bar-title:not(:empty)').waitFor(); await page.locator('.mode-i', { hasText: en['entry.install'] }).click(); + // Der Hinweis zu den Medien blendet erst ein und gehoert nicht ins Bild. + const tip = page.locator('.mode-tip-t'); + if (await tip.first().isVisible().catch(() => false)) { + await page.locator('.mode-tip-x').first().click(); + await tip.first().waitFor({ state: 'hidden' }); + } await page.locator('input[aria-labelledby="connect-address"]').fill('energy-node.local'); await page.locator('input[aria-labelledby="connect-user"]').fill('pi'); await page.locator('input[aria-labelledby="connect-password"]').fill(SECRETS.login); @@ -168,6 +176,22 @@ async function result() { return { context, page, stop: () => host.stop() }; } +// Medium: Geraet waehlen, weiter zu den Einstellungen des Mediums. +async function media(optionText) { + const host = await startFakehost(['--lang', 'en', '--trusted']); + const context = await browser.newContext({ viewport: { width: 1080, height: 760 } }); + const page = await context.newPage(); + await page.goto(host.url); + await page.locator('.app:not([x-cloak]) .bar-title:not(:empty)').waitFor(); + await page.locator('.mode-i', { hasText: 'Media' }).click(); + await page.locator('.app[data-screen="media-device"] .body [role="radiogroup"]').waitFor(); + await page.locator('.media-opt', { hasText: optionText }).click(); + await page.getByRole('button', { name: en['action.next'], exact: true }).click(); + await page.locator('.app[data-screen="media-settings"]').waitFor(); + await page.waitForTimeout(800); + return { context, page, stop: () => host.stop() }; +} + // Die Diagnose: Modus-Kachel, Verbindung, Live-Log mit Zeilen. async function diagnose() { const host = await startFakehost(['--lang', 'en', '--trusted']); @@ -175,7 +199,7 @@ async function diagnose() { const page = await context.newPage(); await page.goto(host.url); await page.locator('.app:not([x-cloak]) .bar-title:not(:empty)').waitFor(); - await page.locator('.mode-i').nth(2).click(); + await page.locator('.mode-i', { hasText: en['entry.diagnose'] }).click(); await page.locator('input[aria-labelledby="connect-address"]').fill('energy-node.local'); await page.locator('input[aria-labelledby="connect-user"]').fill('pi'); await page.locator('input[aria-labelledby="connect-password"]').fill(SECRETS.login); @@ -260,6 +284,18 @@ try { await shot(page, 'installer-changelog'); await context.close(); } + if (want('installer-media-pi')) { + const { context, page, stop } = await media('Pi 3, 3+, Zero 2 W'); + await shot(page, 'installer-media-pi'); + await context.close(); + await stop(); + } + if (want('installer-media-debian')) { + const { context, page, stop } = await media('x86 64-bit'); + await shot(page, 'installer-media-debian'); + await context.close(); + await stop(); + } } finally { await host.stop(); await browser.close();