Add Configuration of DHW System Function (CDSF) use case#247
Conversation
Groundwork for the HVAC system function and temperature use cases. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks for putting this together — the overall CDSF structure and public API look very useful. I compared it with our VR940-backed DHW implementation, and I think this PR could eventually replace most of our bridge-local CDSF code. Before switching, I see a few behavioral gaps around write safety and device compatibility that may be worth addressing: 1. Check the advertised write operation
The underlying HVAC write helpers also write directly without checking operations. As a result, the current test fixture only advertises Would it make sense to return
This would also provide a reliable basis for applications that need to expose read-only versus writable controls. 2. Consider omitted changeability flagsFor operation modes, a missing On the Vaillant VR940 we have seen optional changeability flags omitted even though the corresponding function advertises a write operation and accepts the write. Our compatibility rule is therefore: Could the operation-mode path use the same rule as the overrun path? At minimum, a test for 3. Validate the mode against the DHW relation
However, Could the write path resolve the requested mode through the DHW system-function relation, just like 4. Honor full-list versus partial-write semanticsBoth write paths currently send a list containing only the modified entry: Our hardware-validated VR940 path copies the complete cached list, modifies only the selected entry, and writes the complete list. We have confirmed that full-list writes work, but do not yet have evidence that a single-entry write is accepted reliably. Would it make sense for the feature helper to:
This also avoids accidentally dropping unrelated system functions or overruns on servers that interpret the payload as a full replacement. 5. Surface the device resultThe feature helpers return a message counter, but CDSF currently discards it in both write paths. This means the public method reports success after sending, even if the device later responds with a non-zero For control operations, it would be valuable either to return the message counter to the caller or to register a response callback internally and surface device rejection as an error. A successful result could also trigger a fresh read of the affected list. Our bridge currently waits for the matching result, handles cancellation/timeout, maps non-zero error numbers to a device-rejection error, and refreshes the cache afterward. Preserving that behavior is important because the gRPC/HA caller should not see success for a rejected operation. 6. Fail closed on ambiguous IDsAs a smaller defensive improvement, Unless the specification guarantees uniqueness here, returning Suggested additional tests would cover:
These points aside, the separation between MDSF and CDSF and the general package structure look like a good fit for replacing our local implementation. Thanks again for working on this! |
…mitted changeability flag WriteOperationMode had two write-safety gaps: - It blocked the write whenever IsOperationModeIdChangeable was nil. Some devices omit the flag yet still accept the write, so only an explicit false should block it (matching the overrun path). - It resolved the requested mode against the global operation-mode descriptions and wrote the first match, which on a multi-function entity could select a mode that exists globally but is not related to the DHW system function. Resolve the mode through the HvacSystemFunctionOperationModeRelation instead, mirroring OperationModes(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Point 5: the write methods discarded the message counter and reported success as soon as the request was sent, even if the device later rejected it. Return the message counter and accept a resultCB so a non-zero ResultData.ErrorNumber surfaces as a device rejection, matching the OPEV/LPC/OHPCF write pattern. Point 6: systemFunctionId and overrunId returned the first matching entry. Return ErrDataNotAvailable unless exactly one DHW system function / one-time-DHW overrun matches, so the wrong entry is never controlled. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@volschin thanks for the review. Worth noting that I have done all these with AI, while following established processes and spec. I've followed up on all points across all my open PRs. Since #239 provides the shared baseline, it would help if we could that reviewed and merged first to patch the missing pieces on the other ones. |
|
@volschin I had Claude do a cross-check for consistency with the rest of the codebase:
That point is implemented, too. I'm always a big fan of consistency though- if we want to do this we should do it everywhere. Do you want me to raise follow-up PR (...which would to a minor extend be breaking)? |
The Hvac and Setpoint write helpers issued a write command without checking whether the remote server feature advertises the Write() operation for the corresponding function. Guard each write helper so it returns api.ErrNotSupported unless the remote advertises Write(), matching the existing LoadControl/DeviceConfiguration behaviour. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Hvac and Setpoint write helpers sent a list containing only the modified entry. Servers that interpret the payload as a full replacement would then drop unrelated system functions, overruns or setpoints. Send a proper partial write when the remote advertises WritePartial(). Otherwise copy the cached list, merge the modified entries and write the complete list, matching the LoadControl/DeviceConfiguration behaviour. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Now that the Write() advertisement gate is present in the Hvac feature helper, the test fixture must advertise the Write operation for existing write tests to pass, and a dedicated test verifies WriteOperationMode returns ErrNotSupported when the remote advertises the system-function list as read-only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds the Configuration of DHW System Function (CDSF) use case (EEBus UC TS V1.0.0) as a Configuration Appliance client actor in
usecases/ca/cdsf.Scenarios (the DHW circuit has to support at least one of 1 and 2):
OperationModes,CurrentOperationMode,WriteOperationMode(write ofcurrentOperationModeIdviahvacSystemFunctionListData, gated byisOperationModeIdChangeable)StartOneTimeDhw(writesoverrunStatus=activeon theoneTimeDhwoverrun resolved viahvacOverrunDescriptionListData)StopOneTimeDhw(writesoverrunStatus=inactive), gated byisOverrunStatusChangeableServer is a
DHWCircuitentity; the client subscribes to theHVACserver feature (no binding, per spec).Stacked on #239 (Hvac and Setpoint client features) — only the last commit is specific to this PR.
🤖 Generated with Claude Code