Each time I do a hard reset of my HA PC I lost all the data.
Also, sometimes when there is an internet connection issue, my data shows strange numbers after that (example: daily electricity consumption jumps 500% more than it should be).
If you mean by pulling the power, don’t do that. Do this:
Shut home assistant down from the Supervisor / System / Host box.
You can also reboot the host here instead of rebooting the PC.
You should very rarely have to do this. You should be restarting only the Home Assistatnt core from Configuration / Settings / Server Controls page. And even then most often you should use the reload services under that (after doing a config check):
On the side, I installed mariadb and my house/area sees occasional power cuts which, until now, have never lead to issues with that one. As tom states, in reality I should setup a ups but since I had no damage yet…not spending money…which at some point will lead to me paying dearly
I use two tactics to show kWh from them at the moment.
Convert Watts to kWh:
Show to correct stat of watt (Tuya show 100W instead of 10W, hence I divided it by 10): pomiar_pralka:
** friendly_name: “Pobor Pralka”**
** value_template: “{{ (states(‘sensor.pralka_power’)) | float / 10}}”**
Can you please suggest how to implement your method in my example?
You must set the template to a value just below your current value. There are other alternatives. Show your whole template sensor configuration, correctly formatted, don’t post a picture of text.