For each hour of the day, the median of the hourly averages over all the days (the line), and the middle half of the days, between the 25th and 75th percentiles (the band): a narrow band means that hour is much the same every day.
Arguments
- hourly
Data frame from
get_hourly().- variable
Name of the sensor, for the title and the hover labels.
- unit
Unit of the readings,
""for none.- mode
"light"or"dark", the mode of the app.
Examples
hourly <- expand.grid(hour = 0:23, date = as.Date("2026-10-01") + 0:13)
hourly$value <- 21 + 2 * sin((hourly$hour - 9) / 24 * 2 * pi) + rnorm(nrow(hourly), sd = 0.5)
plot_average_day(hourly, "Temperature", "C")
url <- "http://pip1.crabdance.com:1507/api/v1/query_range"
plot_average_day(get_hourly(url, "humidity", days = 30), "Humidity", "%")