Convert epoch timestamp from sensor

Using the rest I’m able to pull time for the next bus but they are in epoch time. I can’t seem to work out how to convert it to something readable. Should I be doing this in the value_template?

sensor:
- platform: rest
resource: http://webservices.nextbus.com/service/publicJSONFeed?command=predictions&a=sf-muni&stopId=14970&routeTag=27
value_template: '{{ value_json["predictions"]["direction"]["prediction"][1]["epochTime"]|int|timestamp_custom(True)}}'
name: nextbus-27-0
scan_interval: 300

Assuming your epoch is in millisec

value_template: '{{ value_json["predictions"]["direction"]["prediction"][1]["epochTime"] | int / 1000 timestamp_custom("%x %X")}}'

I’ve not fully tested above (not created a rest sensor) but copying one of the epoch values, the | int / 1000 timestamp_custom("%x %X") works