How to investigate systematic error?

I’ve only set up HA about a week ago. But I’m seeing a systematic issue with the energy panel: there’s a huge spike of random usage/production in the 2-3am time frame. Like 9kWh consumption, and 11kWh TO grid in the middle of the night…

Quite obviously this messes up the overall statistics.

What are my possibilities to understand where that’s coming from? Can I log/look up the individual data points to see whether it’s a problem at the source?

Ok, already found something: according to the entity’s history, those values would be the end values of the previous day. But is there a way to prove this is coming from the source so I could ask the vendor for support? Or a way to suppress such values in a growing entity?

The data is coming from a custom RESTful integration. I might be able to do something there. But I’m still a beginner :grinning:.

Look a the history graph for that sensor for that time period.

You can correct the error in Developer Tools → Statistics → Ramp icon next to your sensor.

Do your sensors reset their value to 0 every day? If yes it is between 2 and 3 am.

No, the reset happens around midnight, as can be seen from the history chart:

This is your problem:


.

What is causing that?

To figure this out I came here in the first place. I know this is the problem. Therefore my question was: can I get a log of all the results received from the device? Is there a way to figure out whether that’s actual data received, or a problem in my rest integration?

Share this configuration.

The relevant part is this:

- scan_interval: 30
  resource: http://192.168.123.123/values.xml
  sensor:
    - name: Smartfox from Grid Day
      unique_id: smartfox.daily.from_grid
      value_template: '{{ value_json["values"].value | selectattr("@id", "eq", "hidFromGridEnergyDay") | map(attribute="#text") | first }}'
      device_class: energy
      unit_of_measurement: Wh
      state_class: total_increasing
    - name: Smartfox to Grid Day
      unique_id: smartfox.daily.to_grid
      value_template: '{{ value_json["values"].value | selectattr("@id", "eq", "hidToGridEnergyDay") | map(attribute="#text") | first }}'
      device_class: energy
      unit_of_measurement: Wh
      state_class: total_increasing

The full file can be found on homeassistant-smartfox/smartfox.yaml at 277341546c9f08570c0c2a41fb667513d048510f · michaelherger/homeassistant-smartfox · GitHub, an example XML on homeassistant-smartfox/README.md at main · michaelherger/homeassistant-smartfox · GitHub.

BTW: last night this didn’t happen… I wonder whether it’s some hiccup somewhere, eg. when the device doesn’t respond. But the fact that it happened around the same time of the night is odd.

…and it hasn’t happened ever after… Oh well. Must have been a hiccup. Thanks for your suggestions anyway!