Lovelace: mini graph card

LINK TO THE FINAL CARD WITH UPDATED CODE

With what you have noted above and me re-reading the docs have explained the behavior I am seeing in the below graphs. With some commentary.

Aggregate functions

Recorded values are grouped in time buckets which are determined by group_by, points_per_hour configuration. These buckets are converted later to single point/bar on the graph. Aggregate function defines the methods of that conversion.

Name Since Description
avg v0.8.0 Average
median v0.11.0 Median
min v0.8.0 Minimum - lowest value
max v0.8.0 Maximum - largest value
first v0.9.0
last v0.9.0
sum v0.9.2
delta v0.9.4 Calculates difference between max and min value
diff v0.11.0 Calculates difference between first and last value
Name Type Default Since Description
group boolean false v0.2.0 Disable paddings and box-shadow, useful when nesting the card. #Not to be confused for group_by
points_per_hour number 0.5 v0.2.0 Specify amount of data points the graph should display for each hour, (basically the detail/accuracy/smoothing of the graph).
aggregate_func string avg v0.8.0 Specify aggregate function used to calculate point/bar in the graph.
group_by string interval v0.8.0 Specify type of grouping of data, dynamic interval, date or hour.

With 0/100- Setting no aggregate_function: for the entity.

  • The door open shows the short duration event at half the range.
  • (Must be some sort of default average?)
    image

With 0/100- Setting aggregate_function: avg for the entity.

  • The door open shows the short duration event at half the range.
  • Showing the average of readings in the time bucket.
    image

With 0/100 - Setting aggregate_function: last for the entity.

  • The door open does not show the short duration event unless it is last in the time bucket.
    image

With 0/100 - Setting aggregate_function:min for the entity.

  • The door open only shows the minimum reading within each time bucket.
  • Short duration events won’t register unless there is a high point per hour count or short group_by time.
    image

With 0/100 - Setting aggregate_function: max for the entity.

  • The door open only shows the maximum reading within each time bucket.
  • The door open uses the full range of graph, even for short duration events.
    image

LINK TO THE FINAL CARD WITH UPDATED CODE