I have a floor heating system, which among others is represented in HA as a climate entity for each room.
This displays very nicely in the history-graph.
Additionally to measuring the air temperature, each room sensor can measure the floor temperature by using an infrared sensor. This value is however quite noisy, and therefore messes up the graph when displaying climate control and floor sensor together.
Here’s an example of a floor sensor:
I have been trying to smooth this sensor.
First I tried to use the statistics platform. Unfortunately it was quite awful, and even had gaps in the resulting sensor.
Next I found the filter platform. At least there are no gaps in the data, and it helps a bit, but it still does not look good I think and the more you want to smooth the more it timeshifts the result.
Here the blue line is filtered, compared to original:
(time_simple_moving_average using a window of 30 minutes)
Question is, wouldn’t it be possible to have an option for the graph to do the smoothing at display time?
Of course not on by default, but some optional argument that could indicate a level of smoothness.
I realize the graph would not go through the exact measured values, but in a case like this the truth is probably the average of nearby measurements anyway.
Benefits of smoothing at display time:
- You can see the result of your configuration right away. With filter and statistics you have to configure these derived sensors, then await new data is collected. Check the result, adjust and wait again…
- The smoothing could be done better, because it can use “future” values in the calculation. For example it could calculate an average based on values some amount of time before and after the point it is calculating the average for.
Filter and statistics must insert values into the DB as current values, meaning it cannot take future values into consideration, only historic. Resulting in some level of time shifting.
It takes some CPU resources of course. On the other hand you’ll save some writes to storage.
The custom:mini-graph-card can do smoothing at display time:
It does it ok I think, but I would still prefer the history graph. Especially because the intent is to have it in the same graph as the climate control.