The PyTrain Alexa skill is live! There is a bit of setup, and I haven't finished the documentation, but with the skill, you can perform all of the actions listed above with simple, (somewhat) intuitive voice commands! Examples include:
- halt or emergency halt
- start/start up/power on/power up train <tmcc_id>
- start up engine 5 with dialog
- accelerate/speed up/set the speed of train 5 to speed step 100 (or "normal speed" or "limited")
- slow train 6 to slow speed with dialog
- enable smoke on engine 33
- reverse train 53
- tell engine 53 to move forward
- reset engine 25
- refuel train 33
- toggle the bell on engine 54
- blow the horn/whistle on 53 (blows the horn on engine 53)
- shut down train 5 [with dialog]
- release/open/trigger on front/rear coupler on engine 6
- throw switch 7 out
- fire route 6
- get status of train/engine/switch/accessory/route <tmcc_id>
The skill relies on the PyTrain API Server, which you must run locally (the same network as your Base 3). It also must be accessible from the internet and accessed via HTTPs.
Making a host accessible to the internet is relatively easy if you are running a home gateway from NetGear or any of the other major gateway companies. On the advanced setup screen, look for an option named "Port Forwarding" or "Port Triggering". As you see below, I have specified that requests to port 443 (default HTTPS port) from "the outside" should be directed to port 443 on my local host at 192.168.1.155. The interface to do this will vary by gateway manufacturer.

The hard part (at least for me) is enabling HTTPS access. If others are interested in using this skill, I will provide documentation. It isn't really hard, but it does require some moving pieces, such as setting up SSL certificates and using a dynamic IP service to give a "domain name" to your gateway's external IP address. This is what all the machines on your local network are known as on the internet. I use No-IP.com, but there are others out there as well.
With that all done, you say to your local Alexa "Alexa, open PyTrain", and my skill leads you through a small setup process where you give it the domain name you create with No-IP.com (or whomever you use). In my case, this is "77exeter.servemp3.com". With that connection made, the Alexa skill takes your verbal commands, sends them to your local API server (through the port forwarding process), and then onto your Base 3 (or Ser2). I'll post a YouTube video over the next few days showing the system in operation. Again, all of this can run on a low-cost Raspberry Pi!!
In the near term, I plan to add more commands to control accessories (particularly power districts). I may also add commands to control lighting (ditch, mars, etc.) I have volume control wired into the API, but I haven't added it to the Alexa skill yet. Any interest in changing momentum? I tend to think of this as a set once and forget.
It is pretty cool to be able to control my big layout up in New Hampshire with all of this. It won't replace my Cab 2 (or Cab 3), nor will it preempt the control panels I'm currently fabricating, but it is a fun and effective way to make things happen on my layout!
-- Dave