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_hourconfiguration. These buckets are converted later to single point/bar on the graph. Aggregate function defines the methods of that conversion.
Name Since Description avgv0.8.0 Average medianv0.11.0 Median minv0.8.0 Minimum - lowest value maxv0.8.0 Maximum - largest value firstv0.9.0 lastv0.9.0 sumv0.9.2 deltav0.9.4 Calculates difference between max and min value diffv0.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?)

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.

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.

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.

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.
