ha-emporia-vue icon indicating copy to clipboard operation
ha-emporia-vue copied to clipboard

Spike in usage caused by issue resetting daily usage at midnight

Open alex-peck opened this issue 1 year ago • 4 comments

I am seeing a large spike in usage in the HA energy dashboard around midnight Image

Investigating in the history, I see my Vue 2's primary energy usage tracker (which resets daily) seemed to have quickly reset to 0 at midnight only to spike back up and then finally reset around 12:20 Image

My timezones are all set correctly in HA and Emporia systems. Interestingly, looking at the entity directly I don't see the drop Image Not sure if this is just due to smoothing HA does but figured I would pass it along.

alex-peck avatar Oct 02 '24 14:10 alex-peck

The initial drop is artificially added by the integration, but the spike back up is from the API call returning the data from the day before. It drops back down generally 15 minutes later when the next API call is made and returns proper data.

Home Assistant should handle that correctly, jumping the usage up but seeing the dip and cancelling it out. I don't really understand why it sometimes handles it fine and for some people it doesn't. Longer term I want to ignore the spike when it gives old data but I haven't had a chance to add that code yet.

magico13 avatar Oct 02 '24 14:10 magico13

I should call out part of the reason HA probably doesn't like this is because I use a helper Utility Meter on top of the daily sensor from this integration. This let's me separate out different TOU rates but has the effect of recording any increases as usage for that hour even if it drops back to 0 later on.

alex-peck avatar Oct 02 '24 15:10 alex-peck

I should call out part of the reason HA probably doesn't like this is because I use a helper Utility Meter on top of the daily sensor from this integration. This let's me separate out different TOU rates but has the effect of recording any increases as usage for that hour even if it drops back to 0 later on.

I missed this previously, but I had the same issue using a utility meter for TOU rates. Using the raw "home 1, 2, 3" from the integration did away with the spikes at midnight. This must be why only certain people see the issue. If you're not using utility meter for TOU, then the data looks clean. Personally, I'll take the clean data over the TOU stuff any day, but this reply was very helpful. Thank you.

@magico13

Do you already have a note about using utility meter on top of the integration possibly causing this issue somewhere in the documentation?

imadunatic avatar Jan 05 '25 15:01 imadunatic

I just ran into this same issue. Large spike in first hour of the day. Image

I'm using a Vue 3 and I'm seeing the same dual reset. Image

I'm only having this issue with the solar channel and it's sporadic. After reading the discussion above I realized It's probably because I'm using a template helper on that channel to invert the sign and the energy dashboard can't compensate.

Since it's just my solar channel, there's no usage at that time so I updated the template to force the total to zero during the first 45 minutes of the day. Still testing, but figured I'd post here for anyone with a similar issue.

{% if (now().hour*60 + now().minute) > 45 %} {{ 0 - states("sensor.solar_energy_today")|float }} {% else %} {{ 0 }} {% endif %}

Braxton1243 avatar Jan 31 '25 01:01 Braxton1243