Weird line graphs

I’ve seen that history graphs for temperatures and such look like this:

current

But I find this kind of graph confusing, and I would like a more “linear” approach, like this:

good
(don’t look at data, it’s just a mockup made with LibreOffice)

Is there any setting that makes line graphs behave like this?

Thanks!

1 Like

So, just to clarify what I’m asking, looks like all my line graphs are showing as stepped graphs instead of simple straight line charts. Here’s a quick mockup made with LibreOffice showing the difference:

line-straightline-stepped

That may make sense for some magnitudes, but for most things (temperature, humidity…) it’s just weird. Temperatures don’t abruptly change from 23 ºC to 25 ºC, most probably there’s a 24 ºC in between, even if we don’t have that measurement.

I think HA showed graphs the right way until a few versions ago. I even doubted that, but looking at screenshots they show proper graphs, as also happens in the demo at the website (though that’s running a very old version, 0.26). Browsing the forums, it looks like charts recently switched to stepped charts for certain components (History graphs show weird line), but in my case it happens with each and every graph.

Is that normal or it’s something wrong with my configuration (I’m using latest 0.72.1)? Anybody else having stepped charts everywhere? Is there any way to configure how charts are rendered?

Thanks a lot in advance

Same question here … the curve/smooth line charts looked better imo.

Completely agree Airpal - the old graphs looked a lot better than the current ones. They aren’t quite as bad if the sample rate is at least every 10 mins and there is a reasonable amount of deviation.

It’s not just that they’re ugly, but that, in most cases, they are unrealistic. Temperature, for example, doesn’t abruptly drop from 28 to 26 ºC. It changes smoothly, and those stepped charts doesn’t reflect that.

I’m aware that in other cases stepped charts are a better choice, so perhaps there should be an option somewhere.

I think everyone here is missing the fact that these are based on when the sensor reports a change in home assistant. So home assistant treats everything between reports to be static.

I understand why it is displayed this way but I would prefer if we could choose between a staircase style and a spline graph.

Maybe try to use the Filter Sensor?
I’m looking at the same thing.

HA graphing component treats everything between states as static, sure, but it doesn’t need to be this way. In fact, some versions ago the behaviour was the opposite. For example, the demo in HA website uses conventional (non stepped) line charts.

It’s not that a choice is always better than the other, it depends on every case. For something like CPU usage, stepped is the right way, but for things like temperatures it’s plain wrong.

I tried filtering, graphs are nicer but they don’t reflect actual values anymore, just averages. For example, if temperature was 30 ºC and then got down to 28 ºC, you’ll probably end up with a single 29 ºC value.

Feed it into InfluxDB and use Grafana to view the data. Let HomeAssistant do its automation thing and Grafana do its beautiful graphing thing.

I think you are remembering incorrectly. I’ve been using this for the better part of 2 years and it has always been steps because it bothered me at the beginning.

No, it was a spline style graph back around version 0.5x or so. I don’t remember the exact version, but I remember it changed right around the time the history component had some issues with the data lines having shading under it or only the first couple on a chart showing up. I raised an issue (in a thread here) when that all changed. It changed to a staircase style graph and I immediately went “What the f is this?” and found there was no way to change it back easily. I agree there should be a way to change the graphing style on a per sensor basis, but I feel that would be pretty involved in the back end coding and there will always be edge cases missed because of how a sensor can be customized or represented. I’m currently looking into InfluxDB and Grafana, but haven’t made the switch.

EDIT: It was around version 0.58 the graph style changed. In the thread I linked you’ll see some have the spline style and some have a staircase style. In fact, further down in one of my replies, you’ll see the climate component graphs show a spline style, however now if I go to that same graph in the history component, it displays as a staircase style.

I think it was 0.64 that introduced the new behaviour.

See the issue on github:

Just look at Home Assistant demo, linked in HA front page. It uses an old version and line graphs are non stepped.

That’s a lot of work for just a simple sensor history graph.

I already had influx and grafana setup monitoring other things outside of HA. So it was pretty simple. Should be pretty simple for the Hass.io folks with the add ons too.

My mistake. If you want changes made to the component, write a PR against the component.

Any update on this topic? I’m using HA 0.81.1 and still getting stepped graphs, which are unrealistic. It would be desirable let the user choose the graph type. Python has a lot of modules to deal with that.

2 Likes

I too am looking for a way to revert this back to how it was.