Sensor statistics "change" resets to zero after HA restart

Hi everyone,

I am using the statistics sensor to calculate the change of a value within the past 7 days. However, whenever I restart HA, the sensor only calculates the change from this moment on.

So in the case of the screenshot below, I restarted HA around midnight yesterday. Now, the senor shows β€œ1” (The increase after midnight) and not β€œ3” (The total increase shown on the screenshot).

Does anybody have any idea? Really appreciate all the help I can get :slight_smile:

Thank you!

Ths is the code…

    - platform: statistics
      name: "LWP last 7 days"
      entity_id: sensor.lwp_converted_total
      state_characteristic: change
      max_age:
        days: 7
      precision: 1

…and this the data it uses:

I have the same issue with change statistics resetting after a restart. I haven’t tried the automation in this Github issue comment, but reloading the statistics sensors in Developer tools fixed their values.