I have recently installed Home Assistant on a raspberry pi 4 and have got almost everything working (thank you docs) with the better part of the house automated - still waiting on a few bits to automate the rest.
However, I do not understand why my energy usage charts have gaps and minus (export) activity.
I do not have any devices capable of exporting electricity to the grid so export is just impossible and must be due to some bug/error/misconfiguration. The export usage shows on the second chart regardless of whether there is a gap on the first (see above).
The household is on an electricity-only tariff (no gas) and we are tracking just electricity usage.
This is the data from the entity used by the energy charts to track kWh usage throughout the day.
I thought maybe this was related to the entity zeroing out every day around midnight so I tried to create a config change:
Unfortunately the new entity is still resetting every day. I’m not really sure whether this is even causing the issue and I really do not want to mess up my HA setup so figured it would be worth an ask here.
Any ideas or suggestions?
Note that since I am a new user I cannot put multiple embeds into my message so I will try post this as a reply.
This is the entity history used by the energy charts to track kWh (before I switched to the custom config, as mentioned in the original post). Note that the custom entity looks pretty much the same as this.
I thought maybe this was related to the entity zeroing out every day around midnight
This is normal and you don’t need to work around it. Entities are perfectly able to reset daily and still work for energy dashboard.
If you have gaps, it’s likely because your sensor is not updating fast enough. If there is no measured increase in energy between 1-2am, it will have a blank space on the graph.
Yeah sorry, you are right. I looked at the devices and misread the negative spikes.
The negative spikes in the individual device graph are caused, because your devices use energy, but there is no grid consuption measured so the algorithm zeroes it out.
I ended up setting up a new entity which had more timely updates and the problem seems to be resolved.
The issue is that the entity it was using lagged behind actual usage. i.e if it showed 10 kWh, this was actually the reading from an hour or two ago - since the integration only updates so often.
I’m using a more or less real-time entity now which tracks kWh usage throughout the day.