Calculating energy use between specific timestamps

I have a EV Charger connected to HA via OCPP, at the end of each charging session I get an update with the exact time of the session start/end and the total energy used. This is great however I would also like to see where that energy came from - grid, solar or battery. For each of these sources I have a utility meter entity (or a sensor coming from ESPHome) which correctly calculates the individual consumptions of each source so what I would like to determine is the difference for each of those continually increasing sensors between two specific timestamps.

In other words - can I “poll” a sensor for its state at a certain timestamp using built-in HA tools or is resorting directly to SQL my only option?

Thanks

Can you create an additional utility meter, and reset it at the start of the monitoring period, and then the value at the end of the monitoring period will be the growth during that period?

Otherwise you can’t access history without SQL sensor.