Skip to content

Add battery mode api #20455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 41 commits into from
Apr 11, 2025
Merged

Conversation

iseeberg79
Copy link
Contributor

@iseeberg79 iseeberg79 commented Apr 6, 2025

work in progress for feature

  • integrated in /api/state
  • set via HTTP/REST
  • set via MQTT
  • publication of the active external battery mode via MQTT

The externally set battery mode is valid for a fixed interval of 60s. After this period and no new external trigger, the external battery mode is invalid. The external mode is embedded in internal functions for calculating the battery modes for mains charge or hold.

At first glance, the user interface seems to be consistent with the externally set battery mode and the function is working as expected. Maybe it's confusing if gridchargelimit is set.

TODO

  • add reset api
  • publish ext mode for UI

Out of scope

  • api error if battery not configured

@iseeberg79 iseeberg79 marked this pull request as draft April 6, 2025 20:29
@iseeberg79 iseeberg79 changed the title Feat/external battery control add feature for external control of the battery mode Apr 7, 2025
@iseeberg79 iseeberg79 changed the title add feature for external control of the battery mode add external control of the battery mode Apr 7, 2025
@iseeberg79
Copy link
Contributor Author

@andig what do you think about it?

@andig andig added the devices Specific device support label Apr 8, 2025
@iseeberg79
Copy link
Contributor Author

Schau mal bitte ob das für dich so ok wäre?

Moin, die Funktion steht im Vordergrund. Da ist eine gewisse coole Code-Evolution passiert. Ich erkenne noch die Idee ;-)

Heute Abend teste ich die Funktion mal durch! Vorweggenommen sieht das für mich sehr schlüssig aus.

Spannend, danke!

Copy link
Contributor Author

@iseeberg79 iseeberg79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mit den Anpassungen macht es per MQTT was es soll; die REST-API klappt auch

@naltatis
Copy link
Member

naltatis commented Apr 9, 2025

Wir sollten batteryModeExternal publishen um einen entsprechenden Hinweis in der UI anzeigen zu können.

@iseeberg79
Copy link
Contributor Author

ich hab das publishing mal mit eingebaut, primär aber die Änderungen, die nötig sind, damit es robust ist. Die Sperren sind jetzt wirksam und nicht blockierend, da die watchdog-Schleife endet. Schaut mal, ob das so in Ordnung ist.

@iseeberg79
Copy link
Contributor Author

Schau' ich mir später an. Die Logs brauchte ich gestern zur Fehlersuche, waren nützlich - können aber natürlich raus

Copy link
Contributor Author

@iseeberg79 iseeberg79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getestet, zurücksetzen per externem BatteryUnknown ohne Anpassung nicht stabil

@iseeberg79 iseeberg79 requested a review from andig April 10, 2025 20:36
@iseeberg79
Copy link
Contributor Author

Der aktuelle Stand passt! Lass' uns gerne abschließen.

@andig andig merged commit 7e9bccf into evcc-io:master Apr 11, 2025
6 checks passed
@iseeberg79 iseeberg79 deleted the feat/externalBatteryControl branch April 11, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs documentation Triggers issue creation in evcc-io/docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants