kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
3.04k stars 235 forks source link

Bug: group_by date is applying aggregated values to the wrong date #857

Open tomkessler opened 2 years ago

tomkessler commented 2 years ago

I have a mini-graph-card which should show the amount of heat used by day. My config is exactly like the example given for energy used daily in all foundational respects. However, this week I used heat only on Wednesday, yet the graph attributes the heat usage to Tuesday.

Card config:

type: custom:mini-graph-card
entities:
  - entity: sensor.hvac_heating_today
    name: Heat
    color: '#DB5F59'
    show_state: true
hours_to_show: 196
lower_bound: 0
upper_bound: ~4
min_bound_range: 4
group_by: date
aggregate_func: max
show:
  graph: bar
  labels: true
  legend: false
name: Daily Heat Usage
icon: mdi:heating-coil

If you look at the underlying sensor history values, it shows how the hvac_heating_today had a max of .59 on Wednesday, 19 October, not on Tuesday, 19 Oct.

image

Yet, this is how the card renders:

image