flixlix / power-flow-card-plus

A power distribution card inspired by the official Energy Distribution card for Home Assistant
497 stars 59 forks source link

[BUG] if there is an scond solar, the values aren't add #641

Open RobertPro71 opened 1 month ago

RobertPro71 commented 1 month ago

Describe the bug I have two PV systems. One large and one small. If I add all the values together, then the value of the second solar system is missing. I have not found any hint in the readme.md that I can make an entry that the values are totalized.

Screenshots image

Please make sure all of this applies and check the checkboxes, by writing "X" inside of them.

RobertPro71 commented 1 month ago

I try to commit a fix in a branche, but no access :-(

if (solar.has) {

-- solar.state.toHome = (solar.state.total ?? 0) - (grid.state.toGrid ?? 0) - (battery.state.toBattery ?? 0); ++ solar.state.toHome = (solar.state.total ?? 0) + (solar.secondary.state.total ?? 0) - (grid.state.toGrid ?? 0) - (battery.state.toBattery ?? 0); }

MiniBlister commented 1 month ago

according to my understanding the secondary state is NOT a second solar. The usecase is rather to display the total produced solar energy per day. In your case just use e.g. a home assistant helper to sum the two power states