core: Sense Trend Sensors Incorrect 'last_reset' Value

I was able to use sensor.daily_production and sensor.daily_usage as inputs to two template sensors for “grid consumption” and “return to grid” (max of 0 and the relevant difference). This worked fine(*) during the day.

But there’s another issue: for me the daily reset occurred at 12:02:32 am, not 12:00:00, despite what the “last_reset” property claims. So the day started out with large negative daily production and usage. I’m not sure if this is due to polling schedule, daily reset schedule at Sense, or something else.

(*) – worked fine until Sense had an unrelated outage yesterday due to an expired SSL cert

_Originally posted by @dlarrick in https://github.com/home-assistant/core/issues/53965#issuecomment-894794338_

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 60 (19 by maintainers)

Most upvoted comments

I am currently having this issue every day where the day starts with an extremely large negative value in the first hour due to the reset not happening until after midnight but reporting as midnight still

@kbickar if the sense API updates only hourly, you can consider using the API for injecting external statistics instead of injecting it via a sensor. that will also allow you to import and correct historical data. here’s an example of how it can be implemented: https://github.com/home-assistant/core/pull/62249

tibber is a bit different though since you get details of the past day after midnight, in this case it probably doesn’t matter that the values are off by an hour

This was also an issue with the Tibber energy integration. Not sure if the same fix would work in this case but I figured I would pass it along.

#61551 #61914