Skip to content

Expose batteryBuffered and batteryStart flags on /api/state and MQTT #29287

@impellerturn

Description

@impellerturn

Hi,
ich schreib im Folgenden auf Englisch, damit die Diksussion reibungslos vollzogen werden kann.

Hi,
i want to use 2 states for the battery supported charging inside my homeassistant automation (making the zero-feed-controller smoother by avoiding 2 separate systems trying to compete for the zero-feed value at the grid connection (Netzanschlusspunkt)).

Is your feature request related to a problem? Please describe.
For external consumers (a Home Assistant automation in my case) it would help to
know whether evcc currently considers the house battery available for EV
charging.

Describe the solution you'd like
Both booleans already exist as locals inside core/site.gositePower():

  • batteryBuffered = bufferSoc > 0 && battery.Soc > bufferSoc
    (battery may serve loadpoints)
  • batteryStart = bufferStartSoc > 0 && battery.Soc >= bufferStartSoc
    (PV-surplus charging may start)

Describe alternatives you've considered
These values are not published today, so as an alternative a consumer has to re-implement the comparison
against bufferSoc / bufferStartSoc outside evcc — which breaks as soon as
the user changes the thresholds from the battery UI.

Additional context
These values are not published today, so a consumer has to re-implement the comparison
against bufferSoc / bufferStartSoc outside evcc — which breaks as soon as
the user changes the thresholds from the battery UI.

Publishing the flags themselves would be a ~2-line change in update() plus
the symmetric initial publish in prepare(), showing up on /api/state, the
WebSocket event stream and MQTT.

Branch on my fork for reference:
https://github.com/impellerturn/evcc/tree/feature/publish-battery-flags

Can you (the maintainers) accept this request?

Thanks and BR impellerturn

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions