kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
3.05k stars 237 forks source link

Wrong history graph, if values missing #778

Closed pachi81 closed 2 years ago

pachi81 commented 2 years ago

Hi,

maybe it is a configuration issue from my site or there is a workaround for this case, but I haven´t found one. I collect the daily rain with a rain gauge using mqtt. This will reset every day at 0:00 to zero.

The problem is, if there was no rain for the recording time (10 days), there are no data in the database. The graph shows zero over the time, which is correct, but after the first day it rains, the graph shows the same value for the days before (in the picture, the first day with rain, was 24.04.): image

The current detected values are visible in the HA graph: image

The rain starts at April, 24th... and there is no value before (I think because of the 10 days purge configuration of the recorder, which will delete the oldest values and there was no rain for the last 10 days). Is there any option to force setting zero to database for each day? Or is there any way for setting a default value (0 in my case) in the mini-graph-card configuration?

hcrohland commented 2 years ago

I have a similar problem: My temperature sensor lost connectivity for some hours: Bildschirmfoto 2022-06-05 um 11 56 58

And now the card shows a constant temperature since then:

grafik

Config is:

type: custom:mini-graph-card
entities:
  - entity: sensor.ausentemperatur_temperature
    show_fill: false
  - entity: sensor.ausentemperatur_humidity
    show_fill: false
    show_state: true
    y_axis: secondary
upper_bound_secondary: 100
name: Wetter
icon: mdi:home-thermometer-outline
ildar170975 commented 2 years ago

@hcrohland Did you try to specify points_per_hour at least?

hcrohland commented 2 years ago

Same problem. Or even worse: For some settings the temperature graph disappeared completely

jlsjonas commented 2 years ago

@hcrohland I've moved your comment to https://github.com/kalkih/mini-graph-card/issues/799 as that feels like a new (and different) issue

For this one: we currently indeed use the first value as the start value; which gives a cleaner look -- for most cases. https://github.com/kalkih/mini-graph-card/issues/414 already tracks this Feel free to provide a contribution for it if this is important to you, as we plan to tackle some other areas first