Garbage statistics data displayed in the UI

I’ve connected a Tasmota based smart meter reader to my HA instance (supervised). Sometimes, it’s not clear when and why, garbage is shown for a timespan in the short term stats in the UI for a single sensor in the data from the smart meter (the smart meter part is probably irrelevant).

The erroneous data looks like this:

image

Note the flat segment around 21:00. That consists of values between 0 and 1.0. Clicking Show more shows the actual data:

image

There’s no sign of the flat part around 21:00. I removed the affected values from the statistics table, but it changed nothing. The bad values are still in the UI. I know I deleted the right rows, because under the same statistics ID, the correct data is still present in the table.

Is there any interim storage that I also need to clear? Where does that made up data set come from? It happened multiple times already. I noticed it after restarts of the Tasmota device. This particular sensor is only sending null values until a set time elapses (currently about 15 minutes) to be able to send meaningful statistics values regarding the smart meter connection. I tried not sending the value at all in that phase, but then HA showed warnings that the entity has disappeared and it never came back, even after sending valid data again. Maybe I will need to change that, but nevertheless, the made up data section should never happen.

Any insight is welcome.

In developer tools, there is an overflow menu in the top right for debug tools. One of the options is debug connection.

If you turn it on, and open this more-info dialog, you should see the following in the browser console, where the frontend is requesting the statistics from the backend, and you can see the data response.

image

Try looking at the statistics query, and the response variable, and see if the backend seems to be sending correct data or not. Once that determination is made you can decide if this is a backend or frontend issue, and file an issue accordingly, or investigate further.

Thanks. This is very useful, for the next time I see this, as the problematic section has already shifted out of the visible area…