Statistic - week vs day - inconsistent results #366
-
I have an increasing energy sensor - I derived other sensors from it to get the daily, weekly and monthly total (they reset at the specific points) In case 1 (figure1), I am using the statistic sum over a period of 1d and filter by delta case1: If I add the values for the day to get the weekly value I get eg for the first week 72.9 and 79,5 for the week after. Why are they different? why is this not the same and what has to be set Code (relevant part) - entity: sensor.bitshake_smartmeterreader_mt681_total_in
texttemplate: '%{y:.2f}'
name: consumed
type: bar
statistic: sum
period: day
filters:
- filter: i>0
- delta
- fn: |
({ys,xs,hass, vars}) => ({
xs: [...xs, new Date().setHours(0,0,0)],
ys: [...ys, hass.states['sensor.from_netz_daily'].state],
}) Appreciate the insights !!!! Luis |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
My guess is that you have home assistant configured to start of the week on Mondays but you are adding them starting on Sunday:
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
No, the statistic is a different api of home assistant, it is not plotly processing. I suggest you try the same plots with the standard history and statistics cards and home assistant. I believe you will see the same result, in which case you can open a bug report to home assistant.
https://www.home-assistant.io/dashboards/statistics-graph/