I’m new to Homeassistant, have been using domoticz for couple of years. Now I’m trying to do the following:
I have a energysensor (aqara smart plug) that shows watt and kwh. Now I want to know how much kwh it has used, but I cant reset the kwh by code. So what I would like to do is end kwh value - start kwh value, where start is when watt > 1 and end watt > 1 (the plug uses 0,5 watt).
Now I can make custom sensors and set the watt values (start, end) and then calculate the difference and set this value in another sensor. But I found out that setting values in custom sensors is not something that is possible in Home Assistant. I found a script that can set the value of a sensor.
This all seems a little bit devious, is there a better\easier way to do this?