Setting graph range

I’ve searched the forums and documentation for this, but can’t seem to find any mention of my ‘problem’

When clicking on a temperature sensor I get a nice graph, works fine. But I’d like to be able to set the graph range so that all my temp. sensors have a uniform ‘feel’

For example, inside the huis the temperature is fairly stable, so the graph might show a range of 18 - 21 degrees, any variation looks like a big jump in temperature. My outside temperature sensors show a much graph with a much bigger temperature range, at the moment 10 - 23 degrees.

Is it possible to set the range so that it’s fixed somehow, for example:
temperature_graph_min: 0
temperature_graph_max: 25

I’ll try to show some examples later, I’ve just switch to MariaDB an hour ago so I have very little example data.

1 Like

For now it’s not possible, it’s also not possible to set the time range (to change the default of 1 day).
I think there is already a change/feature request somewhere.

History graph exist but doesn’t allow you to do what you’re looking for (it was introduce in 0.55 last week so new function can still be expected):
https://home-assistant.io/components/history_graph/

You might want to ask here if it’s possible and if someone is willing to code it:

Thanks for your reply touliloup. I might actually look into trying to adapt it myself, I’d like to contribute, but still learning Python.

1 Like

That’s the way to go :grinning: extending the history_graph component might not be too difficult, even for beginners.

@mvdarend

I have the same request, did you find any solution

Sorry, after posting this I sort of forgot about it for a while. haven’t really looked into it further.

I was just thinking about adding entity with fixed maximum and minimum temperature. When these will be shown in the same graph as temperature from real sensor, it will show desired range. I will now try to do it and i will post here later if I’ve had a success.

That should be easy, just make template sensors:

sensor:
- platform: template
  sensors:
    temp_min:
      value_template: "{{ 0 }}"
      unit_of_measurement: °F
    temp_max:
      value_template: "{{ 100 }}"
      unit_of_measurement: °F
1 Like

It took me a while, but today I’ve succesfully tested it and it’s working! Thanks @petro, you’ve saved me a lot of time :slight_smile: