-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Batteries: refactor api appearance (BC) #24887
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Publishing only the raw measurements slice under keys.Battery means power, soc, capacity, and energy aren’t included; consider publishing the full site.battery struct instead.
- Make sure to update downstream MQTT/Influx publishers and the UI to consume the new batteryState JSON structure rather than individual battery metric keys.
- Since the individual battery metric keys were removed, document or version this breaking change so existing integrations aren’t silently broken.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Publishing only the raw measurements slice under keys.Battery means power, soc, capacity, and energy aren’t included; consider publishing the full site.battery struct instead.
- Make sure to update downstream MQTT/Influx publishers and the UI to consume the new batteryState JSON structure rather than individual battery metric keys.
- Since the individual battery metric keys were removed, document or version this breaking change so existing integrations aren’t silently broken.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@MartinRinas could I kindly ask you to check what impact this PR has on Influx publishing? I've added the ability to set a preferred influx tag, this should hopefully keep the influx keys stable. |
|
Influx should remain stable, for mqtt I'm not entirely happy with the result: I'm not sure we should really squash the devices slices instead of giving it a separate sub-slice? Or do we want to publish any of this as json instead of individual topics? |
|
I would like to fix UI, but it seems that the new BatteryState has not yet been applied to Websocket or Json API. Or am I missing something? |
|
I would expect it to be published as /battery? |
|
fixed, aber jetzt! |
|
Wenn keine Batterie konfiguriert ist, taucht im |
fixed |
Co-authored-by: Maschga <[email protected]>
Co-authored-by: Maschga <[email protected]>
Co-authored-by: Maschga <[email protected]>
|
\cc @marq24 |
|
Verstehe ich das grob richtig, |
|
ALT: "battery": [
{
"power": -81.94,
"soc": 68.69,
"capacity": 7.5,
"controllable": false
}
],
"batteryPower": -81.94,
"batteryCapacity": 7.5,
"batterySoc": 68.69,
"batteryEnergy": 0,
"batteryDischargeControl": false,
"batteryMode": "unknown",NEU: "battery": {
"power": -81.94,
"capacity": 7.5,
"soc": 68.69,
"energy": 0,
"devices": [
{
"power": -81.94,
"soc": 68.69,
"capacity": 7.5,
"controllable": false
}
]
},
"batteryDischargeControl": false,
"batteryMode": "unknown",also Und das ist dann ab welcher evcc Versionsnummer so? |
Jaein. Es gibt totals und individuelle Geräte. Verwendest Du HTTP oder MQTT? |
|
also ich verwende den Websocket... der aber meiner bisherigen Erfahrung analog zum HTTP Wenn die Integration Werte schreibt dann über die HTTP REST API |
|
Also ich habe jetzt "beides" implementiert (aber noch nicht released)... Also die Integration kommt mit beiden JSON Formaten klar... ich fasse das nochmal zusammen (um sicher zu gehen, dass ich es richtig verstanden habe): also die Änderungen sind:
wenn das oben genannte so stimmt, habe ich noch die Frage, warum der Und ich wiederhole meine Frage, in welchem Release (Versionsnummer) wohl diese Änderung live geht? |
|
Es ist einfach noch nicht fertig… |
:-) na dann lass ich es noch eine Weile liegen |
TODO
totalssub key