I’ve set up my home-assistant energy dashboard (I had problems as my Chinese sensor was not supported) and at first, everything seemed normal, but after a few hours I noticed that something was “returning” energy back to the grid.
I’ve checked the sensor, it never goes to “negative” or anything (pic below of sensor itself). Why is my graph showing returned energy and total also goes down?
And this is the sensor, it never goes to negative or something, it works and shows pretty much accurate data. I have only 1 sensor for now
I do have some custom code in configuration.yaml for the sensor to work, if that has to do with anything?
Sorry, it won’t let me paste in more than one image because I’m a new user, so I had to use imgur
Edit: I had to correct all links to imgur gallery, because it won’t let me paste in more than 2 links because I’M A NEW USER. This is definitely not funny HomeAssistant, not funny…
Hi, I have. It’s all up. It’s not an image, it’s an image gallery, I can’t do it otherwise as forum is preventing me from uploading more images. They are all in the gallery. Please, click on the image and you will find all 4 of them
Your sensor, even though it has the unit Wh which is a unit of energy looks suspiciously like a power sensor (with the wrong unit).
You can’t just change the unit of a power sensor and expect it to become an energy sensor. You need to integrate power with respect to time to get energy. You can do that with the Integral helper. Feed your amp_meter sensor to this:
Make sure you use method left.
Then use that sensor in the energy dashboard.
Delete the template sensor.
EDIT: actually, what is the unit_of_measurement of sensor.amp_meter
If it is Amps you will need to multiply it by the voltage first.
Thanks, I will look into the integral right now It’s directly wattage. I have all 3 options, volts, amps and wattage, since I did custom integration of the sensor as it was no natively supported (China stuff)
Edit: Despite how the kWh fixed itself somehow and I see all the needed attributes by the docs, I still can’t add it to energy dashboard for some reason
Another edit: Fixed it based on this:
The entity must not have any statistics errors. Go to Developer Tools > Statistics to check your specific entity. If your unit has a listed issue here, you must fix the issue before it can be added to the dashboard.
I went into statistics and I had to fixed old values which were kWhh instead of kWh (HomeAssistant did it itself, I just needed to press fix)