kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
2.85k stars 231 forks source link

mini-graph-card not showing actual value #1091

Closed smiba closed 3 months ago

smiba commented 3 months ago

Hi,

I have this incredibly odd issue with mini-graph-card where it has stopped showing the right value for the entities.

No matter what I try, all values seem to be roughly 0.03 lower then they should be, possibly from a previous value at some point but I have no clue!

In this screenshot the value for "uur_1" (hour 1) is shown as 0.2285036 in hass (correct), but mini-graph-card shows it as 0.19 Cursor_and_Overview_–_Home_Assistant

I've tried resetting my cache, I've even tried using a totally different browser (chrome instead of safari). On Android (through hass app) it shows even less, which adds to my confusion as it's the same dashboard

Screenshot_20240405_210542_Home Assistant

I don't understand what's causing this, is there a cache somewhere that might need to be expired?

The code for this graph is:

type: custom:mini-graph-card
hours_to_show: 1
icon: none
name: Current energy price
unit: EUR/kWh
tap_action:
  action: none
entities:
  - entity: sensor.price
    name: Current price
    show_indicator: true
    state_adaptive_color: false
    show_state: true
    show_legend: false
    show_graph: false
  - entity: sensor.energieprijs_uur_0
    show_legend: false
    name: 00:00-01:00
  - entity: sensor.energieprijs_uur_1
    show_legend: false
    name: 01:00-02:00
  - entity: sensor.energieprijs_uur_2
    show_legend: false
    name: 02:00-03:00
  - entity: sensor.energieprijs_uur_3
    show_legend: false
    name: 03:00-04:00
  - entity: sensor.energieprijs_uur_4
    show_legend: false
    name: 04:00-05:00
  - entity: sensor.energieprijs_uur_5
    show_legend: false
    name: 05:00-06:00
  - entity: sensor.energieprijs_uur_6
    show_legend: false
    name: 06:00-07:00
  - entity: sensor.energieprijs_uur_7
    show_legend: false
    name: 07:00-08:00
  - entity: sensor.energieprijs_uur_8
    show_legend: false
    name: 08:00-09:00
  - entity: sensor.energieprijs_uur_9
    show_legend: false
    name: 09:00-10:00
  - entity: sensor.energieprijs_uur_10
    show_legend: false
    name: 10:00-11:00
  - entity: sensor.energieprijs_uur_11
    show_legend: false
    name: 11:00-12:00
  - entity: sensor.energieprijs_uur_12
    show_legend: false
    name: 12:00-13:00
  - entity: sensor.energieprijs_uur_13
    show_legend: false
    name: 13:00-14:00
  - entity: sensor.energieprijs_uur_14
    show_legend: false
    name: 14:00-15:00
  - entity: sensor.energieprijs_uur_15
    show_legend: false
    name: 15:00-16:00
  - entity: sensor.energieprijs_uur_16
    show_legend: false
    name: 16:00-17:00
  - entity: sensor.energieprijs_uur_17
    show_legend: false
    name: 17:00-18:00
  - entity: sensor.energieprijs_uur_18
    show_legend: false
    name: 18:00-19:00
  - entity: sensor.energieprijs_uur_19
    show_legend: false
    name: 19:00-20:00
  - entity: sensor.energieprijs_uur_20
    show_legend: false
    name: 20:00-21:00
  - entity: sensor.energieprijs_uur_21
    show_legend: false
    name: 21:00-22:00
  - entity: sensor.energieprijs_uur_22
    show_legend: false
    name: 22:00-23:00
  - entity: sensor.energieprijs_uur_23
    show_legend: false
    name: 23:00-24:00
show:
  graph: bar
  labels: false
lower_bound: ~0
color_thresholds:
  - value: 0
    color: '#04822e'
  - value: 0.1
    color: '#12A141'
  - value: 0.15
    color: '#79B92C'
  - value: 0.2
    color: '#C4D81D'
  - value: 0.25
    color: '#F3DC0C'
  - value: 0.3
    color: '#F4C616'
  - value: 0.35
    color: '#EFA51E'
  - value: 0.4
    color: '#EA8523'
  - value: 0.45
    color: '#E76821'
  - value: 0.5
    color: '#E33F20'
  - value: 0.55
    color: '#DC182F'
smiba commented 3 months ago

Setting cache: false on the card aligns it with the values my phone shows, which is still wrong.

smiba commented 3 months ago

Fixed by setting fixed_value: true on every datapoint.