Sorry, I was probably a bit unclear. Also, I did a quick test and device_class: timestamp apparently doesn’t do anything with actual timestamps. Apparently the value needs to be a time string.
Anyway, this should do it:
- platform: template
sensors:
vacuum_lastrun_end:
friendly_name: 'Vacuum last run end'
value_template: >
{{ state_attr('vacuum.rockrobo', 'last_run_stats').endTime | timestamp_local }}
Or you could use timestamp_custom(format_string) in place of timestamp_local if you want to control the format of the resulting time string. See Time formatting.