Last time 'input_boolean' state was on

Hi.
I trying to get the last time some generic ‘input_boolean’ turns into ‘on’ state.
It’s possible?
I prefer to do it with one line template.

Thanks!