Pull sensor history data from exact 24h ago

You can achieve what you have done with a single trigger-based template sensor: see here.

The OP’s question is for fine-grained tracking though — unless you’re going to create 1440 helpers / data elements in an attribute structure, the SQL solution will be better.