Magic Mirror Update - Tram Tracker
As an extension to my MagicMirror project, I decided to add a tram tracker to lazily assist my communte to the nearest train station. Years ago, I had a LIFX globe that would flash when the tram was about to arrive, but I haven’t used it in a while. I did however, still have the code floating around on my private Bitbucket instance. The finest Node 6.10 code around.
The code for the light was based off the excellent, and apparently still running TramTracker SOAP service. Even way back in 2018 when I put this together, it was a bit of an oddity to use SOAP from a Node application, but with a few upgrades here and there to the various libraries, the thing roared back to life. I have no idea how I got a license key for this service originally, but it’s still up, and it’s still mostly working. You can’t seem to get the type of Tram any more from it (booooooo), but the arrival times are still there.
I ended up using Dennis Rosenbaum’s excellent MagicMirror template to load my new module up into MagicMirror. Effectively, the module has code which runs on the frontend, and then a mechanism to have code run on the backend (see node_helper.js), with an event-based mechanism for communication between them. If the frontend reloads, or a 30 second timer fired on the backend, then the new arrival information is sent down to the display.
The finished product looks like this. Nice and simple, with terrible colours and alignment, but I sort of love it. Even has the old Met logo.
