Set last tripped/alarm date, or last action date to an item - best practice?

The usual way would be to start a timer when the lights are switched ON, that when it expires turns the lights OFF. Not really related to storing last timestamp.
See

and many similar.