hif2k1 / battery_sim

Home assistant home battery simulator - allows you to model how much energy you would save with a home battery
117 stars 14 forks source link

Energy saved is not preserved after reboot and new value money saved #5

Closed RalfPfitzner closed 2 years ago

RalfPfitzner commented 2 years ago

Now that for me most critical issues seem to be resolved I just have one minor request.

It would be really good if the value for "energy saved" would be preserved after a reboot. Otherwise I would have to use another utility meter to collect the values for daily / weekly / monthly / yearly evaluation.

Additionally it would be nice to have a value for "money saved". As I have a tarrif with hourly changing values (aWattar) it might be a bit tricky, but I have another sensor with the actual value which can be used.

Thanks for looking into this and keep the spirit up!

hif2k1 commented 2 years ago

I have made an update that will hopefully maintain energy saved on reboot, but I don't fully understand how home assistant handles this so it might not work. Will have to wait for the sun to come up to find out!

In terms of money saved, we would just need to multiply the energy saved by the tariff at that time so shouldn't be too hard. Not sure how to handle support for different currencies though...

NBS1997 commented 2 years ago

I would 2nd the 'energy_saved' as a seperate Sensor Entity/Meter.

With a templated sensor for the Attribute, it can be used along side the original Battery Entity in the Home Assistant Energy Management, Some of the Tariffing could then be handled externally.

RalfPfitzner commented 2 years ago

Preservation of "energy_saved" value successfully solved.

RalfPfitzner commented 2 years ago

Working fine now