Trigger.from_state.last_changed

Hello all,

I use somewhere in my code “(now()-trigger.from_state.last_changed).seconds) > 300”, now I would like to set that for 1 light (eg light.bathroom). Can someone tell me how I do that?

Thanks in advance.