@finity@boggiano you are right, the templates still work, I had a typo in my code.
There is a catch, although. The sensor will be evaluated during all the time the switch is in the “on” state, so it will be showing the last time the switch sensor was on.
For example, if the switch was ‘on’ from 8:00 AM to 11:30 AM, the template sensor will display 11:30 am. That behavior did not work for me, I need to know the time it was turn from “off” to “on”.