History Graph "Hours to Show" only working in preview?

So, this is a weird one.

I’m using the History Graph in a few places and they all work fine, except for one…

I’m trying to improve my wifi reception, so whilst I’m moving the AP around the house, I’m monitoring the wifi signal strength from some devices (Sonoffs in this case).

So, I have the same card, twice, one configured with “Hours to Show” set to 2 hours, and the other with 24 hours, but, they both show 2 hours of data. And, when you then edit the 24hour card, it shows 24 hours of data in the preview…

So.

Here’s the 2 cards in Lovelace:

And when I edit the 24 hour card, I see this:

Which is clearly the correct preview…

Just for completeness, here’s the config of the 2 cards:

24hours:

entities:
  - entity: sensor.cwtchy_lamp_wifi_signal
    name: Cwtchy Corner
  - entity: sensor.dehumidifier_wifi_signal
    name: Dehumidifer
  - entity: sensor.hall_socket_1_wifi_signal
    name: Entrance Hall
  - entity: sensor.tv_relay_wifi_signal
    name: TV Relay
  - entity: sensor.tv_lights_wifi_signal
    name: TV Lights
hours_to_show: 24
refresh_interval: 120
title: House Wi-Fi Signal Strength (Last 24 Hours)
type: history-graph

2 hours:

entities:
  - entity: sensor.cwtchy_lamp_wifi_signal
    name: Cwtchy Corner
  - entity: sensor.dehumidifier_wifi_signal
    name: Dehumidifer
  - entity: sensor.hall_socket_1_wifi_signal
    name: Entrance Hall
  - entity: sensor.tv_relay_wifi_signal
    name: TV Relay
  - entity: sensor.tv_lights_wifi_signal
    name: TV Lights
hours_to_show: 2
refresh_interval: 120
title: House Wi-Fi Signal Strength (Last 2 Hours)
type: history-graph

Any ideas?

1 Like

Have you tried refreshing the browser cache, Ctrl+F5, or Ctrl+Shit+R.

Yeah, that helps, but I’m seeing this on multiple machines / browsers… (Android, Windows, Linux, Firefox, Vivaldi, etc)

One thing I have noticed, is that sometimes the card shows correctly whilst editing Lovelace:

(Notice the left hand card is top of a vertical card stack)

As soon as I save the Lovelace design, it fails again:

Which would imply some form of caching, so opening up that view in a cleaned browser did then show the middle window correctly, but then the 3rd card (last 12 hours) is showing incorrectly:

So, it’s almost as if the “last” card is wrong…

Try removing the dash from your titles (“Wi-Fi” to “WiFi”).

Ah, are you going for the “weird character might mess it up” approach? Nice…

Unfortunately (for me) no change.

However, I’ve reversed the durations on the cards - none are set for 2 hours now - but the middle and right-hand card are still showing the same duration (now 6 hours):

Even tried on Chrome (I rarely use Chrome… even had to login to HA! :))

Seen anything like this before?

I have now. I just created two history graph cards with the same sensors, different titles and different hours to show in the same view. Both showed the same hour range.

There’s an open issue (since Nov 2018!) which was about to go stale. So I commented to prevent it being closed. You might want to sub to the issue for updates.

1 Like

As a work around, if you install the Lovelace config-template-card you can make a graph with adjustable time scale:

Aha, so I’m not going mad! :smiley:

Thanks @tom_l - I’d seen that forum post whilst checking this issue wasn’t already known, so I’ll give it a go.

I’ll also post a link on github to this forum post, just to help tie the info together.

Thanks!

Also having the same issue.

As shown in view mode:


Shown in edit:
image

This happens to me all the time, very frustrating. I’m using Chrome.

Most of the time I can fix it by copy/pasting the code in the card to re-create it.

If I simply duplicate the card then it will copy the hours too, and nothing will fix it.

A fix for this has just been merged, hopefully it will make one of the 0.115 dot releases.