Skip to content

Address the power sequence by id for process control - #257

Open
andig wants to merge 1 commit into
enbility:devfrom
andig:fix/ohpcf-sequence-id
Open

Address the power sequence by id for process control#257
andig wants to merge 1 commit into
enbility:devfrom
andig:fix/ohpcf-sequence-id

Conversation

@andig

@andig andig commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The four scenario 2 process control methods each start with

info, err := o.OptionalPowerConsumption(entity)
if err != nil {
	return nil, err
}

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, IsPausable and IsStoppable are value types, so a missing operatingConstraintsInterrupt would 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 — while PowerConsumptionProcessState and the other readers keep working on the same data. The failure surfaces to the user as

The remote data structure is in an invalid state (alternative attribute present but no power sequence operating interrupt constraints defined)

on 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 same isDataAvailable check and the same "no power sequenceId defined" error, and points the four methods at it. OptionalPowerConsumption keeps its contract unchanged.

Note that the pausable/stoppable question is not lost: it was never enforced here. PausePowerConsumptionProcess validated that operatingConstraintsInterrupt exists and then ignored its values, so callers already have to consult ConsumptionIsPausable/ConsumptionIsStoppable themselves, which is what evcc does.

🤖 Generated with Claude Code

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.
@sthelen-enqs
sthelen-enqs requested a review from Ka0o0 August 17, 2026 11:20
@Ka0o0

Ka0o0 commented Aug 24, 2026

Copy link
Copy Markdown

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 operatingConstraintsInterrupt since this field is marked mandatory. But there might be a bug in our RFE implementation in spine-go that causes this problem. To confirm this logs would be good.

@andig

andig commented Aug 24, 2026

Copy link
Copy Markdown
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants