reptilex / tesla-style-solar-power-card

Home assistant power card mimicking the one tesla provides for the powerwall app.
210 stars 59 forks source link

Clarification for math behind visualization #132

Closed huskyte closed 1 year ago

huskyte commented 1 year ago

"You need at least one, the placement of the main bubbles is fixed for now. Some will substract the value from one bubble and will add value to another bubble. For example:

battery_to_house will substract from the battery bubble/icon and add to house bubble/icon."

I was wondering which math is behind which displayed and calculated variable? I couldn't find a glossary. Mine display fine, but the math is completely off, most probably due to the above described effect.

Thx

reptilex commented 1 year ago

Well you can always check the code, since it is open source. Check the following functions: https://github.com/reptilex/tesla-style-solar-power-card/blob/55b06a1890eb059fad12ded85d9d9f1174b4f7ca/src/TeslaStyleSolarPowerCard.ts#L348

reptilex commented 1 year ago

But most probably you did not follow the documentation too well, it clearly requires your flows to be independent, if you don't have those separate flows from your solar installation you have to create them with template sensors.

reptilex commented 1 year ago

If you have an actual bug you need to write down the examples.

huskyte commented 1 year ago

Thx, as far as I can see I figured it out. There is only the problem with two variables showing a factor of 10. Units are all upper case, changing to kW doesn't help and I haven't found the thread with this issue again, but remember it has been discussed.

reptilex commented 1 year ago

Yes, try w instead of W or the other way around.

GregorEstebanCardosoSchiller commented 1 year ago

Hi, please explain why my generation_to_battery_entity: sensor.senec_speicher_battery_charge_power adds the value onto the solar Generation:

Example: Solar is: 3 kw Battery Charge is: 0,6 kw The flow shows 3,6 kw at solar generation and therefore 0,6 more on house consumption. If I remove Battery charge, everything is fine...

So the math here is, that Battery Charge is added onto solar generated...that is wrong. I attached another card with proper flow. Please beware, that I simply used card mod for a nicer coloration

Tesla battery bug

reptilex commented 1 year ago

Because the entity are defining the flows not the states. The bubbles get their data from the sum of the flows. So if you have a sensor that is not showing you the flow, you have to create two template entities to divide this into two flows one for generation_to_battery and one for generation_to_house. Read the docs