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

bar chart shows wrong values

Open miroslavpetrov opened this issue 4 years ago • 7 comments

I am using mini-graph-card with bars to show the energy usage in kwh for the last 31 days. I am running the counter for around 24 hours now and the problem is that for the days before the 24h period the bar chart shows 0.02kwh as daily consumption instead of zero. Here is the config of the card and a screenshot:

type: custom:mini-graph-card
entities:
  - sensor.itd_meter_1_total_energy_daily
name: Дневна консумация
show:
  graph: bar
  extrema: false
  average: false
  labels: false
hour24: true
hours_to_show: 744
group_by: date

Screenshot 2022-02-09 at 10 30 17

miroslavpetrov avatar Feb 09 '22 08:02 miroslavpetrov

:thinking: Could you try with smoothing: false?

jlsjonas avatar Feb 09 '22 11:02 jlsjonas

Btw, should the smoothing option be disabled in case of bars?

ildar170975 avatar Feb 09 '22 12:02 ildar170975

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this is still an active issue, please let us know!

stale[bot] avatar Apr 10 '22 12:04 stale[bot]

Hi!

I think, I have a similar issue with v0.11.0: Sometimes (not figured out when) the card shows instead of 0 the value of the last bar: screenshot

The value (state) is only updated on bars that are non-zero. For bars that should be zero the value of the last bar is shown.

type: custom:mini-graph-card
entities:
  - entity: sensor.wasser_stundlich
    color: blue
group_by: hour
lower_bound: 0
points_per_hour: 1
hour24: true
hours_to_show: 48
aggregate_func: max
smoothing: false
show:
  graph: bar

patman15 avatar Apr 19 '22 08:04 patman15

Still an active issue, got it! Removing stale label.

stale[bot] avatar Apr 19 '22 08:04 stale[bot]

I have the same issue for my raining history. smoothing: false does not change anything. I have two workarounds for this problem:

  1. Using lower_bound: 0.2 (works for me, because the min rain detection is 0.2 in my case)
  2. Make such values dark (depending on the theme):
color_thresholds:
  - value: 0
    color: dark-grey
  - value: 0.1
    color: blue

image

pachi81 avatar Apr 26 '22 07:04 pachi81

I had this issue too. I've just tried setting the aggregate_func to max. I was trying to measure the amount of power generated from my solar panels, and this worked for me. It feels like this should maybe be the default?

vicdavery avatar Jun 21 '22 12:06 vicdavery

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this is still an active issue, please let us know!

stale[bot] avatar Aug 31 '22 00:08 stale[bot]