Address the power sequence by id for process control - #257
Open
andig wants to merge 1 commit into
Open
Conversation
SchedulePowerConsumptionProcess, AbortPowerConsumptionProcess, PausePowerConsumptionProcess and ResumePowerConsumptionProcess called OptionalPowerConsumption solely to obtain the sequence id, but that getter validates the complete scenario 1 announcement because its result type cannot express an unknown state, isPausable or isStoppable. A remote that does not announce operatingConstraintsInterrupt or a power time slot value therefore cannot be controlled at all, although the request only carries the sequence id. Look the id up directly instead.
|
Hi @andig , thank you for the PR. I am currently trying to understand the root cause of the problem that you observe. Do you maybe have trace logs available with the SHIP message payloads? In theory it's correct to disregard messages with missing |
Contributor
Author
|
Sure, the detailed logs are right on top in the linked issue: evcc-io/evcc#32252, specifically https://drive.google.com/file/d/1chQU20VKxiXCVEgUJnVya4o3X5Lo8vth/view |
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.
The four scenario 2 process control methods each start with
and then use exactly one field of the result —
info.PowerSequenceId. Everything else the getter produces is discarded.That getter belongs to scenario 1. Its result type cannot express "unknown":
State,IsPausableandIsStoppableare value types, so a missingoperatingConstraintsInterruptwould silently read as "neither pausable nor stoppable", which per OHPCF-011/7 is not a legal announcement. Erroring out is right for the overview call. It is not right for a request whose payload carries the sequence id and a state or a schedule, and nothing else.The effect is that a remote which does not announce
operatingConstraintsInterrupt, or announces a power sequence without a time slot value, cannot be scheduled, paused, resumed or aborted — whilePowerConsumptionProcessStateand the other readers keep working on the same data. The failure surfaces to the user ason every control attempt (evcc-io/evcc#32252, a Vaillant aroTHERM plus whose stored sequence had lost that element).
This adds
powerSequenceId(), which resolves the id through the sameisDataAvailablecheck and the same "no power sequenceId defined" error, and points the four methods at it.OptionalPowerConsumptionkeeps its contract unchanged.Note that the pausable/stoppable question is not lost: it was never enforced here.
PausePowerConsumptionProcessvalidated thatoperatingConstraintsInterruptexists and then ignored its values, so callers already have to consultConsumptionIsPausable/ConsumptionIsStoppablethemselves, which is what evcc does.🤖 Generated with Claude Code