Using history to print the last time an entity was at a specific state

For laundry machines, I would like to create a card or something that can show the last time an entity was a specific state. I tried searching but have not found what I need yet.

For example: My sensor.top_load_washer history chart shows it was last “On” 2 days ago. so I would like to print that on my laundry dashboard. I feel like this shouldn’t be hard and I am not searching correctly for how it would be done.

I thought maybe History Stats - Home Assistant but going through that and it doesn’t seem to work.

I also tried some templates I found on here but now I can’t find them. I think this: Show time since last state change in lovelace - #5 by tom_l