Skip to content

Pass EMS midnight capability through Hub schedule entities - #5558

Merged
springfall2008 merged 3 commits into
mainfrom
fix/hub-ems-midnight-capability
Oct 16, 2026
Merged

springfall2008 merged 3 commits into
mainfrom
fix/hub-ems-midnight-capability

Conversation

@mgazza

@mgazza mgazza commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

An EMS controlled through a PredBat Hub can receive a 23:30–05:30 native window, even though EMS charge/export slots must stay within one day. The generic GWMQTT profile permits midnight crossing, but the gateway was not passing on the EMS-specific can_span_midnight=False capability.

Publish that capability on the EMS's own schedule entities and consume it per inverter during configuration refresh, so the existing executor's normal midnight handling applies. Other Hub inverter types retain their current capability and the shared attribute table is not mutated. Also split the Hub's cached native fallback plan at midnight, preserving absolute future-day hours, rates and SOC targets within the existing sorted six-entry limit.

The shared executor edge-case changes and their tests have been split into #5560. This PR now changes only gateway capability/backup-plan handling, inverter capability consumption, and their tests. There is no diff in execute.py or tests/test_execute.py. History is preserved with a follow-up commit, rather than rewritten.

Validation:

No production deployment or firmware update is included. The existing executor's retained previous-day start and following-day boundary cases are reviewed independently in #5560.

Vendor scheduling rule: GivEnergy Energy Management System guide.

@mgazza mgazza changed the title Fix EMS Hub scheduling across midnight Pass EMS midnight capability through Hub schedule entities Oct 16, 2026
Read the per-device can_span_midnight attribute for every inverter type
rather than only GWMQTT. The attribute may only restrict: False forces a
same-day schedule, while True or a missing attribute leaves the type's
profile in place, so an entity can never loosen a profile that cannot
span midnight. The apps.yaml inverter override cannot express this per
device, as it rewrites the INVERTER_DEF row shared by every inverter of
that type.

Skip the read when charge_start_time is a fixed time, as the Sofar
templates use, so those configurations do not warn on every refresh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@springfall2008
springfall2008 merged commit ffd67fb into main Oct 16, 2026
2 checks passed
@springfall2008
springfall2008 deleted the fix/hub-ems-midnight-capability branch October 16, 2026 07:13
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