Graph actual value and 24h ago

Hi, I’m a little bit new here. I want to graph a comparisson betwen today and yesterday energy consumption. I am using the mini graph card from HACS to graph the last 48 hours so I know that the data is there. I would like to make an input or a template that can give me the value 24 hours ago. so that way I can graph that input and the actual value from the sensor.

Is it possible?

I’ve never tried this, so I can’t be certain it would work. You may be able to set up the history_stats sensor using a short sample time beginning at the same time the previous day. I currently use history_stats to give me a running 5 day temperature average.

History stats info is here:

The key thing is ‘start’ this should give you a start time of 24hrs ago, with a 30 second duration:

start: '{{ now().replace(day = now().day - 1) }}'
duration: 00:00:30

Resurrecting a very old post here but this looks like just what I need. Would you please be able to share the config for how you created the graph and history_sensor(s) @eggman ?

history_graph seems to require a state, but I’m not sure what to provide it with here for a sensor which returns a float.