#Solar savings
1 messages ยท Page 1 of 1 (latest)
correct
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
Is there a Core part for the Solar production/Grid import? That does the statistics saving etc.?
That I might just be able to copy some code from, and do a calculation from?
I see there is some "on the fly" calculation of the Self consumed solar here:
https://github.com/home-assistant/frontend/blob/25c702ad2bb1fb7d1f93a2237b2e0035e81d3dc4/src/panels/lovelace/cards/energy/hui-energy-solar-consumed-gauge-card.ts#L104C5-L110C6
I guess all this has to be refactored too then, if I implement statistics/history of the value before a PR would be accepted :/
I have no idea, there are only a few people here who know how any of the frontend stuff works. Perhaps @tight furnace knows
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 ๐
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.
OK.
So if you have an entity that holds the cost there is nothing done in Core?
All calculations are done in the frontend?
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)
Also the "cost" in the Source table?
the cost is a statistic, the frontend doesn't calculate costs, the backend does
well the frontend calculates the total I guess
Ok. Any idea where that is done?
Cuz that's where this Solar savings has to start saving the data I recon..
doesn't your idea fall apart if you have a tariff electrical rate? It's not always just as simple as a fixed price
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.
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
Sure there are edge cases like that
But i don't think that needs to be thought of here
maybe that's ok to ignore ๐คท
that would be the entity you chose for the price that has to calculate that correctly?
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.
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?
backend cost calculation is in homeassistant/components/energy