mini-graph-card icon indicating copy to clipboard operation
mini-graph-card copied to clipboard

bug: `state: last` and `graph: bar` breaks graph rendering

Open tomkessler opened this issue 4 years ago • 9 comments

I have always increasing sensors for internet upload and download and I'm trying to make an hourly upload and download bar graph. Everything works great except I'm trying to have the latest graph values show for the state rather than the actual sensor state values (as they are meaningless ... total upload and download since last router reboot). If I change the show > state to true or false, everything is fine; it doesn't seem to like 'last' although that is the setting according to the docs which will render what I'm looking for.

I'm on the latest version of HA (2022.2.8), HACS, and the mini graph card.

type: custom:mini-graph-card
entities:
  - entity: sensor.asuswrt_download
    name: Download
    color: '#595BBD'
    show_state: true
  - entity: sensor.asuswrt_upload
    name: Upload
    color: '#CD90EA'
    show_state: true
show:
  state: last
  graph: bar
  labels: true
  legend: false
hours_to_show: 24
group_by: hour
aggregate_func: diff
name: Hourly Internet Bandwidth Used
icon: mdi:wan

This image is with the show > state set to true and everything looks good except the sensor states are showing.

image

tomkessler avatar Feb 19 '22 17:02 tomkessler

I noticed the same issue, it's the case if state: last and graph: bar are used together.

EmJay276 avatar Feb 22 '22 21:02 EmJay276

Same here.

osos avatar Feb 26 '22 18:02 osos

Seems this commit: https://github.com/kalkih/mini-graph-card/commit/dbd64d9f0af02495009ee926c2ec660afdabc37a was not merged to master ?

osos avatar Feb 26 '22 18:02 osos

@osos it was (https://github.com/kalkih/mini-graph-card/commit/d32de3da5df2aa7ad0ef7c7f1fd3ff2cacc0ae08)

@EmJay276 thanks for finding the root cause!

jlsjonas avatar Mar 06 '22 09:03 jlsjonas

@jlsjonas This is still a thing, any eta on v0.12.0 ?

MSZ-Spyro avatar Oct 16 '22 12:10 MSZ-Spyro

Same, posting so I can track this bug

treyd avatar May 17 '23 00:05 treyd

Still a thing.

hellomarb avatar Dec 23 '23 15:12 hellomarb