im having the problem right now, that i need to store data in some kind.
Im using shelly devices with MQTT, so its reporting its total energy consumption via a /energy topic.
But this amount is only from "powering" the device. If the device lost his power, this total energy is set to zero.
What i need now is:
If i store it in a DB or varbiable or whatever and the value sums up till (for example) 10kWh, then looses his power and get it back.
The amount from NOW has to be sumed up with the already existing 10kWh. This amount should stay also after my Raspberry looses his power.
I hope you understand my problem.