Extracting information from binary door sensor

I have a door sensor such as below:

image

image

Now, what I want to do, rather than only showing the door is closed (below), I want it to show that it has been closed for “x hours ago”. That information exists according to the picture above, so how do I extract it?

image

Add secondary_info: last-changed to your entity in the entities card.

2 Likes

This is perfect.

Just wondering, is it possible to have the specific date and time of when that happened (the “last changed”)?

There’s also a custom-card for the secondary info.