#Solar savings

1 messages ยท Page 1 of 1 (latest)

thick creek
#

So the data calculation is handled by the frontend? To calculate the values?

rocky temple
#

correct

thick creek
#

Bummer, hoped they were stored in statistics or something

#

I guess Solar production and Grid import is stored there, and not calculated on the fly from history?

#

Makes things a lot more complicated to change

#

I guess all this has to be refactored too then, if I implement statistics/history of the value before a PR would be accepted :/

rocky temple
#

I have no idea, there are only a few people here who know how any of the frontend stuff works. Perhaps @tight furnace knows

thick creek
#

We'll see if anyone else chimes in with some info here then ๐Ÿคž
Meanwhile I'll keep digging to try to understand who it all works.

#

Thanks @rocky temple ๐Ÿ™

tight furnace
#

Yeah consumed solar is a frontend calculation, that link you posted is probably the right place.

#

I think the only thing core does for energy is manage the cost statistic if you select a fixed price.

thick creek
#

OK.
So if you have an entity that holds the cost there is nothing done in Core?
All calculations are done in the frontend?

tight furnace
#

frontend requests from core all of the statistics for all the entities you configure in your energy config page. with that data the frontend computes some of the other displayed values (like consumed solar, total consumption, etc)

thick creek
#

Also the "cost" in the Source table?

tight furnace
#

the cost is a statistic, the frontend doesn't calculate costs, the backend does

#

well the frontend calculates the total I guess

thick creek
#

Ok. Any idea where that is done?
Cuz that's where this Solar savings has to start saving the data I recon..

tight furnace
#

doesn't your idea fall apart if you have a tariff electrical rate? It's not always just as simple as a fixed price

thick creek
#

Why?

#

Import from grid manages to calculate the cost for import already?

#

That's the same price I "save" for the selfconsumed solar.

#

all the numbers are basically there already?

#

Instead of me importing 1 kWh from the grid, because my PV managed to produce that 1 kWh.
Would mean i saved that 1kWh in the current tariff price.

tight furnace
#

I guess I was thinking in some cases you are billed more as consumption increases, like after X kWh consumed the price increases

#

the increased rate wouldn't be captured if you only have hypothetical consumption

thick creek
#

Sure there are edge cases like that

#

But i don't think that needs to be thought of here

tight furnace
#

maybe that's ok to ignore ๐Ÿคท

thick creek
#

that would be the entity you chose for the price that has to calculate that correctly?

tight furnace
#

I guess user can either have choose a dynamic price (and let energy backend calculate), or they can provide a sensor with total cost and calculate themselves.

thick creek
#

There is no advanced pricing method in the energy dashboard as of now anyway. So why complicate things?

You can choose fixed, or a sensor/entity that gives the price, or no price at all?

tight furnace
#

backend cost calculation is in homeassistant/components/energy

thick creek
#

I'll take a look there then if I can make sense of it ๐Ÿ˜„

#

python is not my strongest language