Energy Issue - Every Day Starting with a Big Negative

Hi, I am on 2021.12.1, runnning the Docker container.

I setup the energy integration when it was released and set my Sense home energy monitor as the data source. I do NOT have any generation via solar, etc.

For the first month or so everything worked perfectly, but around 2021.10.x I started having a problem where every day starts with a big negative and its throwing off the data. I noticed that the negative to start the day is actually the total amount consumed the day before (if ignoring the negative to start the day).

So here is todays:

and here is yesterdays:

Yesterday was -71.2 to start the day and then ended the day as -12.2. that would make the actual consumed yesterday as 59kwh. Today, it started the day as -59kwh.

For my energy input i am using “sensor.daily_usage” from the Sense integration, which as I said worked great for the first month or two.

I thought perhaps it could be a time zone issue or DST issue but as far as i can tell everything is configured correctly on both.

Thank you.

I had the same problem and tried a solution I read here about adding a calculation. HA is expecting the energy use to be monotonically increasing. So that value you are using needs integrated.

The easiest solution I found was to use the “yearly” usage instead of a smaller timeframe. Then HA will work and take care of spitting out the daily usage by subtracting previous days usage. HA is trying to be too smart here.

Not sure if this is a good long-term solution but it was easy for me. I could never get the calculation stuff to work. I’m not sure what is going to happen Jan 1st.

1 Like

Thanks, I will give yearly usage a try. Odd though that it worked perfect for a month or two. They must have added some logic to it after the intial release that caused this issue. I am surprised there arent more people with this issue though as I thought the Sense was quite popular.

I also am curious what the yearly usage will do on Jan 1st! That should be interesting! I wouldnt be surprised if we start the year with a negative for the usage for the entire previous year…

in Yaml I understand there is a way to set “reset” date which I think would cause it to be a non issue… I’ve not looked into it yet.

so the first day i made the switch to yearly usage it looked like a mess but today, the first full day started with the change it looks correct! thanks for the tip!

So I’m in the same boat, and found this thread while poking around.

I kept poking and found that there’s an open issue about it that also has some info on the pitfalls of using the Riemann “hack” that has been mentioned here and elsewhere.

Hopefully it can be fixed by 2022.2!