Custom Widget: Train times

I’ve long wanted to display the local departure times for my local train station so that I could, at a glance, or by asking Alexa, know what time the next train is and how long I have before I need to leave.

NOTE: This widget must be used in conjunction with my Train Times rules posted elsewhere (link)

This has been an afternoon of knocking code about to make it to what I want.

This is a widget which will display up to 4 train times. The current screenshot only displays one because there is only one train for the rest of the day.

A screenprint of the widget

I’m still not sure on how to get this listed in the gallery so for now, here is the link to github:

Update: 29/10/2019

  • Changed the arrival time to depart time.
  • Added verbage on in-time
  • Added a refresh button which, when pressed, will fire the rule.
  • Added option to show/hide the refresh button