Skip to content
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

improvement: show battery voltage and power in live view #1131

Conversation

AndreasBoehm
Copy link
Member

@AndreasBoehm AndreasBoehm commented Jul 24, 2024

Resolves #1129

  • rename card title from State of charge to Battery Charge
  • add Battery Power card
  • show SoC, voltage, power and current if available
  • move _current from individual implementations to BatteryStats
  • add _currentPrecision
  • use _socPrecision and _currentPrecision everywhere

@AndreasBoehm AndreasBoehm marked this pull request as ready for review July 24, 2024 14:27
@spcqike
Copy link

spcqike commented Jul 24, 2024

Looks great to me.

One thing to consider:
As everything is calculated to current (ampere), wouldn’t it be good to also see this, somehow?

This would be to much I think, but I guess (dis-)charge current is more important than power, is it?

Edit:
Maybe one could create two fields? One for capacity (SoC/Voltage/Ah, whatever) and one for stress (power/current going in or out)?

@AndreasBoehm
Copy link
Member Author

AndreasBoehm commented Jul 24, 2024

I think that we should not add too much data fields and choose wisely.

But i dont have a clear opinion on current vs watts.

EDIT: missed your edit. Two cards sound good.

Whats your opinion @schlimmchen?

@schlimmchen
Copy link
Member

but I guess (dis-)charge current is more important than power

MPPT Power: Watts. Inverter Power: Watts. Grid Power: Watts. Battery: Amps? Makes no sense to me.

Maybe one could create two fields?

Well... One card for three values does not look appealing to me. So, yeah. Two cards. I would say: "Battery Charge" (SoC and Voltage) and "Battery Power" (Watts and Amps).

@AndreasBoehm Are you interested in trying to optimize the style? Instead of separating the two values of one card with a slash, you could put them in individual div tags and use CSS flex to make them use equal width.

Actually, I just hacked it in the browser dev tools, it as easy as I had hoped:

image
image

And just before the breakpoint where all cards take one row:
image

What do you think of this?

Unfortunately, the second card will get crowded, at least close to the breakpoint 🤷‍♂️
image

I don't care for the amps, to be honest... If you want them in, it's fine. I think they add no value in the header.

@spcqike
Copy link

spcqike commented Jul 24, 2024

Battery: Amps? Makes no sense to me.

well, I thought it is importantly as nearly every aspect of a battery is designed for a certain current. The wire size, fuse, also the discharge power is limited by discharge current, as the current increases with decreasing voltage, yet the power is stable.

If your battery is well sized (not to say oversized for your load), you probably won’t gain anything with the information. But with smaller batteries, current rating gets more important.

And, as I do electrical tests at work and also there everything is designed about current, not power, I’m just used to use amps :)

another point, as battery’s used to have a Ah rating, it’s easier to get a rough feeling of how long you can still discharge a battery. OC only if you see the remaining Ah and the discharge current. 150Ah remaining and 10A current? So you have 15h left. More or less.

and still: it’s just a point I wanted to mentioned and to discuss with you guys :) as I don’t have a battery yet.

@schlimmchen
Copy link
Member

If your battery is well sized

Exactly.

As you know, I am also not a fan of the "battery discharge rate (current) regulation" issue....

@swingstate
Copy link

I would also vote to for having the Ampere being displayed.

@AndreasBoehm
Copy link
Member Author

Here we go, two cards, current added.
Screenshot 2024-07-24 at 23 21 55
Screenshot 2024-07-24 at 23 21 42

@greymda
Copy link

greymda commented Jul 25, 2024

offfopic: the most frustrating part? i can’t enjoy this as i’m on a 4MB board for quite foreseeable future :(

@AndreasBoehm AndreasBoehm force-pushed the feature/live-data-battery-voltage-power branch from a6a261d to 49d62c1 Compare July 26, 2024 20:41
AndreasBoehm and others added 2 commits July 27, 2024 01:42
not all battery providers know all values the base class manages.
make sure to prevent publishing invalid values.
@schlimmchen schlimmchen merged commit accc70d into hoylabs:development Jul 27, 2024
8 checks passed
@AndreasBoehm AndreasBoehm deleted the feature/live-data-battery-voltage-power branch July 27, 2024 20:05
@schlimmchen
Copy link
Member

I did not know how much I needed this... It's awesome! I don't scroll any more to the bottom just to see the important battery stats when I am peeking the state of the system. Thanks, @AndreasBoehm ❤️ @spcqike I even enjoy the amperage, at least when it's high and I am rooting for the battery to fill up 😁

@AndreasBoehm
Copy link
Member Author

Nice to hear that its useful :)

@spcqike
Copy link

spcqike commented Jul 29, 2024

I even enjoy the amperage, at least when it's high and I am rooting for the battery to fill up 😁

glad you like it after all :)

next step could be an estimation, of how long you can (dis-)charge the battery. one could calculate a load1, load5 or load15 (or all), which represents the average current going in/out in the time period. if we know the Ah rating, which is given by some BMS, one could simply calculate (Ah_max-Ah_current)/current and you know the remaining (dis-)charge time (well, like every car does, except for range, not time)

OC this calculation is just be an aproximation (a calculation based on Wh would be more accurate, but also more complex) but i guess thats whats still done a lot when talking about battery capacity and "bridging time" (if thats the right english term :D)

@schlimmchen
Copy link
Member

next step could be an estimation

Der kriegt den Hals nicht voll 🙄

Mach ein Issue (feature request).

@spcqike
Copy link

spcqike commented Jul 29, 2024

Der kriegt den Hals nicht voll 🙄

na, so nun auch nicht :) war nur ne Idee, dass es ginge und evtl. auch interessant wäre in der Darstellung.

Auch hier, da ich bisher gar keine Batterie habe 🤷‍♂️ habe ich von solchen Anpassungen so oder so nichts 😄

Im Zweifel würd ich sowas am Ende aber auch in Node-Red / Grafana einbauen. Ähnlich der "Restlaufzeit Anzeige" meiner USV. (die den Wert aber von sich aus ausgibt)

Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Request] Live Data screen: State of charge in Voltage instead of SoC
5 participants