Repository navigation
feat(autolearn): record minute values and regulator steps for learning - #293
Merged
Merged
Conversation
Add learning_minutes_mode, learning_minutes_location and learning_minutes_days to the settings, with schema, defaults, and RoleEditSetup access. Add the per-stage RAM budget for minute recording (eco 4 MiB, balanced 16 MiB, full 64 MiB), ResolveMinutes for mode and location, and RAMDays to cap the RAM days by that budget. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Day file with header ENM1, key blocks and value blocks, each framed by length and CRC32. Gaps are NaN. An incomplete or invalid last block is dropped on read, and OpenAppend cuts the file to the end of the last valid block. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…en drive The MinuteStore collects the minute values of entities, balance and outdoor temperature in RAM and writes them at Flush to the day files of the chosen location. While a drive is down, the values stay in RAM and are appended once it is back, without gaps or duplicates. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… to one consumer Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The chain suggestion collector remembers the last counted minute, saves it with the day sums and reports the minute after it through ReplayFrom. Replayed frames do not change the device owner of an entity, since the recording has no device IDs. main.go registers the collector for replay and calls learnHub.Replay once before the energy loop starts. The reader is still nil until the MinuteStore is wired in, so Replay does nothing for now. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Each computed regulator step goes to <base>/scenario/<id>/step, not retained, QoS 0, with err, net, from, to and why (sent, deadband, unchanged or limit). Steps are reported even when no setpoint is sent, and a blocked publish reports why sent with to equal from. The step is not written to the scenario state or the history. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
StepLog holds the regulator steps of each scenario in RAM for the days the learning profile keeps, validates the payloads and derives the day figures (changes, sign flips, out-of-deadband energy). Day files gain an optional steps map, old files load unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…from figures Steps go to learnrec/minutes/YYYY-MM-DD.<scenario>.steps as 24-byte little endian records, appended once per step on each Flush. Steps older than the ring are read back from those files, and old day files are pruned. Day figures skip deadband steps and cap the gap to the next step at 300 s. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… program The MinuteStore and the StepLog start with the dashboard. Their settings and location come from a snapshot that the ten-second loop refreshes, so the minute path never reads a file under the hub mutex. Step topics of the automation service share one WatchTopics call with the node agent. Flush runs every five minutes and once more on shutdown. Reset clears minutes and steps, and chain suggestions take their switch before the replay. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The RAM ring of the step log follows the RAM day budget of the minute store, in every location. The step files keep the configured days. A step older than the ring that is not yet in its file stays in RAM until the next flush writes it. The flush logs its duration when it takes more than two seconds. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The learning status gets a minutes object (resolved settings plus store usage) and a minutes_drive new-hint while an automatic location resolves to the drive and the hint is not acknowledged. The Reset path already clears minutes and steps from 7a. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The learning record card gets the minute recording block above the profile days: a switch for the recording, three location rows (RAM, drive, system) with their sub lines, a stepper for the days on drive and system, the usage line and the hint when the minutes moved to a newly set up drive. Choosing a row writes the location explicitly. Everything is disabled without edit_setup. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The drive row of the minute recording showed the free space in MB
("6000,0 MB frei"). It now uses GB and TB with one decimal from 1000
MB upward, the same 1000 steps as the storage page.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The demo writes three days of minute values (device power, balance and outdoor temperature) into learnrec/minutes under the data directory, and the regulator steps of the nulleinspeisung scenario for the last day. Existing files are kept, so a second seed writes the same bytes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Exemption granted by Developer-Simon with 👍. No tour is required for these highlights:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Squash-merge commit message
Highlight translations
Tour
noneSummary
The node now records minute values per entity, in RAM or in binary day files on the extra drive or the system drive, and keeps every regulator step of a scenario.
Checks
scripts/dev/check_tracked_secrets.shis clean.