How to configure: card showing how many hours a light have been turned on/off?

Hello, I’m not sure if this is possible, but I would like a card on my dashboard showing how many accumulated hours + minutes a specific light have been turned on/off.

case example (24h):
I turn on the light at 09:15. time goes by… it is now 11:35. The card on the dashboard shows:
Office lamp have been on for 2 hours and 20 minutes.

I then turn off the lamp and time goes by… it is now 17:00 The card on the dashboard shows:
Office lamp have been turned off for 5 hours and 25 minutes.

Any ideas which kind of card a should use for this? And what the configuration might look like?

Thanks for pointing me in the right direction, this looks promising. How do I get the data into a card on the dashboard?

Or: