Repository navigation
feat(s2-resource): FRBC as a built-in control type (#125) - #136
Open
dirkjanfaber wants to merge 1 commit into
Open
dirkjanfaber wants to merge 1 commit into
dirkjanfaber wants to merge 1 commit into
Conversation
A battery, boiler or buffer tank needed s2-rm, s2-frbc and s2-frbc-config wired up by hand, with fill rates worked out in %/s or °C/s. s2-resource now does FRBC the way it does OMBC: pick a preset, enter the capacity and the power of each operation mode. The runtime only reads the system description JSON. The Friendly form is saved next to it and shown only while it would write exactly that JSON. So JSON edited by hand is never overwritten by a form that does not know about the edit, without a flag saying which view was used last. S2 ids must not change on a save: a CEM holds instructions and timer statuses that refer to them. The actuator id and the operation mode ids are saved with the form; timer and transition ids are derived from those. An instruction is confirmed by the flow with ActuatorConfirmation, or by the node itself with the new auto-confirm option of FRBCController. That option is a property of its own, off by default, so a node that used OMBC's auto-confirm does not silently confirm FRBC instructions too. A node without a valid FRBC system description does not start. An RM that advertises FRBC and then has nothing to describe leaves the CEM waiting. Closes #125.
There was a problem hiding this comment.
🟡 Changes recommended
Negative timer values silently remove operating constraints, and FRBC power-measurement inputs are dropped over WebSocket and External transports.
2 open issues
What changed in this PR
Adds FRBC as a built-in control type in s2-resource, reusing the existing FRBC controller so common storage devices no longer require separately wired FRBC nodes.
Changes:
- Adds battery, boiler, heat-pump buffer and custom presets with power-derived fill rates, stable IDs and guarded Friendly/JSON editing.
- Integrates configuration validation, fill-level input, instruction routing and a separate, opt-in FRBC auto-confirm setting.
- Adds tests, help text and a simulated boiler example.
| File | Description |
|---|---|
test/resources/s2-frbc-editor.test.ts |
Tests presets, fill rates, timers, stable IDs and example consistency. |
test/resources/s2-common.test.ts |
Tests hiding empty validation error boxes. |
test/nodes/s2-resource.test.ts |
Tests built-in FRBC routing, confirmations and invalid configuration handling. |
test/lib/frbc-controller.test.ts |
Tests optional instruction auto-confirmation. |
src/nodes/s2-resource/index.ts |
Integrates FRBC validation, controller setup and input routing. |
src/nodes/s2-resource/index.html |
Adds FRBC configuration controls, validation and help. |
src/lib/s2/frbc-controller.ts |
Exports flow topics and adds opt-in auto-confirmation. |
resources/s2-frbc-editor.js |
Generates preset-based descriptions, fill rates, timers and stable IDs. |
resources/s2-common.js |
Hides error boxes when validation supplies no messages. |
README.md |
Documents built-in FRBC and the boiler example. |
examples/s2-resource-frbc-boiler.json |
Adds a simulated boiler flow with instruction confirmation. |
CHANGELOG.md |
Records built-in FRBC support and its configuration options. |
Review effort: Balanced
| } | ||
| if (!(isNumber(form.size) && form.size > 0)) problems.push(preset.sizeLabel + ': enter a value above 0') | ||
| if (form.preset === 'heatpump' && !(isNumber(form.cop) && form.cop > 0)) problems.push('COP: enter a value above 0') | ||
| if (form.modes.length === 0) problems.push('Add at least one operation mode') |
| done() | ||
| } else { | ||
| ombcController.handleInput(msg, done) | ||
| controller.handleInput(msg, done) |
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.

A battery, boiler or buffer tank needed s2-rm, s2-frbc and s2-frbc-config wired up by hand, with fill rates worked out in %/s or °C/s. s2-resource now does FRBC the way it does OMBC: pick a preset, enter the capacity and the power of each operation mode.
The runtime only reads the system description JSON. The Friendly form is saved next to it and shown only while it would write exactly that JSON. So JSON edited by hand is never overwritten by a form that does not know about the edit, without a flag saying which view was used last.
S2 ids must not change on a save: a CEM holds instructions and timer statuses that refer to them. The actuator id and the operation mode ids are saved with the form; timer and transition ids are derived from those.
An instruction is confirmed by the flow with ActuatorConfirmation, or by the node itself with the new auto-confirm option of FRBCController. That option is a property of its own, off by default, so a node that used OMBC's auto-confirm does not silently confirm FRBC instructions too.
A node without a valid FRBC system description does not start. An RM that advertises FRBC and then has nothing to describe leaves the CEM waiting.
Closes #125.