I’d like to have a dashboard which plots some sensor values in a similar way to the default Energy dashboard – daily, monthly usage, etc. What’s the optimal way to achieve that?
I thought the statistics card would be the thing, but the bar chart just shows the absolute value for total_inscreasing sensors, rather than the difference between the final values in a time period.
Is the optimal solution here to employ the Utility Meter integration, and set it up for every sensor of interest, E.g. my time present in the office, amount of time running, time on Zoom, etc.
Seems like the creation of many copy sensors which have practically the same data, just for the purpose of plotting something on the dashboard. I don’t care about keeping this data, the unprocessed sensor is good enough for the historical record. It’s just about the frontend presentation. Is there some better way? Or am I overthinking this?
I was looking for exactly this and managed to do it with the amazing apexcharts-card.
Example:
type: custom:apexcharts-card
graph_span: 7d
span:
end: day
series:
- entity: sensor.my_total_increasing_sensor
type: column
# Data from long-term stats: sensor sum for each day
statistics:
type: sum
period: day
# Abuse "group by" to diff each value with the previous one.
group_by:
duration: 1d # group of just 1 value for that day
start_with_last: true # but also include the previous one
func: diff # and plot the diff between the two
Do you know if there’s a way to do this monthly but with an arbitrary start and end day? Say group by the 20th of this month to the 20th of next month.