mini-graph-card: If a point with a zero value is selected - then a wrong state is displayed

My weather station measures the amount of rain with a rain counter, which sums up the continuous amount of rain. For showing the daily rain, I’ve configured the following card:

type: custom:mini-graph-card
name: Daily Rain
entities:
  - entity: sensor.weather_station_rain_counter
show:
  graph: bar
hours_to_show: 168
aggregate_func: delta
group_by: date
hour24: true
line_color: '#15317E'
labels: true 

The result seems correct: mgc 01 27.4 mm is the total amount so far.

When hovering over the particular days, the card shows the correct value unless on that day there was no rain. Than it shows the total amount. However, IMHO it should show “0”: mcg06

Is my configuration wrong, or is it a card issue?

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 32

Commits related to this issue

Most upvoted comments

#880 should fix this issue. But we haven’t merged it yet.

I just gave it a try on the dev branch… Great magic. But it has worked, I think. There should be a new pre-release with the latest changes.

Yes, my plan was to create a release, now that I have merged all the fixes. But… I will have to understand how that works. 😃 That might take some more days, because I guess there is some automated way to do this…

There could be another explanation, we probably need more details like a m-g-c code, real db content. We are trying to investigate the issue by comparing with a standard history-graph. In general this is correct - but since 2024.3 the history-graph is broken and can show wrong results - for instance, for periods where: – the entity has no changes – the entity was not created yet – the entity’s changes were not recorded i.e. personally me cannot consider history-graph now as a 100% correct proof.

🎉 This issue has been resolved in version 0.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

before I saw your post, I updated to dev.3 (from dev.2), and I don’t see it anymore. if I see it again, I’ll do as you suggested and post the results

Hmm… Maybe, it’s the same cache issue?

Because I think the fix should be the same for both primary and secondary graphs. So, if #880 fixes the zero tooltip on the primary graph, I would expect it to fix the zero tooltip for the secondary graph, too. But I might be mistaken.

(Thanks for the feedback on #880 fixing the primary tooltip at least, for you too!)

I’m also having this issue with a bar chart 😦

Not a solution, only a workaround:

color_thresholds:
  - value: 0
    color: '#1c1c1c'
  - value: 1
    color: '#a4958b'
  • 0 = colour of the background
  • ≥ 1 = colour of the bars

grafik

I have a similar issue where it’s not just 0 values that don’t update the number displayed, it’s also “small values”. I used 0.55 hours of A/C on Saturday 3 Sept, but the number won’t indicate that.

Here’s the config of the card:

type: custom:mini-graph-card
entities:
  - entity: sensor.hvac_cooling_today
    name: A/C
    color: '#595BBD'
    show_state: true
show:
  graph: bar
  labels: true
  legend: false
hours_to_show: 196
lower_bound: 0
group_by: date
aggregate_func: max
name: Daily A/C Usage
icon: mdi:air-conditioner

The current value is 1.96 hr, yet mousing over the bar which should show 0.55 hr doesn’t cause an update.

image