Repository navigation
Pass EMS midnight capability through Hub schedule entities - #5558
Merged
Merged
Conversation
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>
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.
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=Falsecapability.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.pyortests/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.