kalkih/mini-graph-card

Non existing data shown on group_by date with aggregate_fuct max or last

LayerCakeMakes opened this issue · 6 comments

First of thanks for this awesome card.
I have already found a work arround for myself but I don't think this is expected behaviour so I thought I should report it just in case.

image
image

As seen in the pictures I have a new sensor that doesn't have data outside of today as it's new.
The data is grouped by date to show a 7 day review of the rainfall. For the dates without any data max and last seem to ignore the date requirement and just go with the data from today even for previous days. I also tested diff and this displays the first 6 days with 0 values correctly.

Ahh no, seems it's not quite behaving as expected:
image
image
image

Retest w/o grouping data.

Here the retest with max:
Without grouping it still shows non existing data
image
Here also without setting the aggregate_func
image

You described 2 issues:

  1. Assume hours_to_show = 10, the sensor was created 1 hour ago - but the graph shows a flatline for the first 9 hours.
    This is an expected behaviour.
    Not right, but expected.

  2. Smth strange what you dscribed in the 2nd post. To sort out - retest with "line" graph - with a minimal config for the same hours_to_show. And post a code.
    Minimal config: specify only hours_to_show, points_per_hour = close to the real frequency of reading data.

  1. Hmm I guess if it's expected behaviour it will "heal" itself in a week, still strange to see future(current) values in the past of the graph, maybe it should only display past values and if there is nothing to show just go to 0.

  2. Unfortunately there is no frequency to the data it only notifies after 0.3 L/m² of rain have fallen so very infrequent possibly with hours or days inbetween unless there's heavy rain. Also the amount resets at midnight everyday to 0.

Overall I think this will work just fine in a week it looks like just a problem with the initial empty data being filled in a weird way when using diff on empty data.

Question # 1 will not be discussed here - we may continue discussing in the issue I posted earlier.

As for # 2: I suggested you to perform a simple test. If you think that this is merely an "initial glitch"& in a week it will disappear - then you may easily close the issue now.