Show today's and yesterday's temperature on the same history graph

I’d like to graph the temperature reading from a sensor over 24 hours, and on the same graph show the values from the 24 hours before that. This is for easy visualisation of differences throughout the day.

The closest i’ve found is this but I don’t know how to modify that for my use case.

I’d have thought this would be a common request but I can’t find many posts about it - am I overlooking something really obvious?

Thanks in advance!

From memory Apex will do that with offset. Good luck on searching through the subject. 2650 posts last time I looked

Apex indeed, e.g.

type: custom:apexcharts-card
graph_span: 30h
header:
  show: true
  title: TempCompare
  show_states: true
  colorize_states: true
series:
  - entity: sensor.garden_temperature
    yaxis_id: temp
    name: Temp today
    stroke_width: 1
    group_by:
      duration: 60min
      func: avg
  - entity: sensor.garden_temperature
    yaxis_id: temp
    name: Temp yesterday
    offset: '-24h'
    color: green
    stroke_width: 1
    group_by:
      duration: 60min
      func: avg

One can also use plotly but I like apex for these too

1 Like

Apex was exactly what I needed! Thanks both!