my first Alexa routine

For my first try I chose to implement a simple “missing” Alexa command: Restart Fire TV Stick. Amazon Fire TV Stick, like every Android program, is prone to losing its internet connection while still connected to WiFi. The only way to restore the internet connection is to restart the program. Restart has two steps: turn off power; turn on power.

An Alexa routine consists of a trigger phrase, a list of action phrases and an Alexa  device name. It is stored with all other Alexa information at http://alexa.amazon.com. To define and/or edit a routine you must use the Amazon Alexa app on an Android phone or iPhone. You can choose your own trigger phrase, but you have to test whether Alexa can distinguish it from other valid phrases. Each action phrase is chosen from a fixed list of alternatives.

This is my intended restart routine:

WHEN

Alexa, Restart Fire TV Stick

ALEXA WILL

Turn Off rhmFireTV

Turn On rhmFireTV

FROM

The device you speak to

When I execute the Amazon Alexa app on my Android phone, it enables Routines and checks the validity of my mobile phone number. I then select the Routines menu and enter my new routine. But I find that rhmFireTV is not an allowed object for an action — it is not a Smart Home device. Fortunately, I have a TP-Link mini smart plug. I change its name to “Fire TV power”, and use that name instead of rhmFireTV. I check my routine and discover that the editor has changed the order of my actions. I press the six dots and slide my second action to the bottom of the list. I click CREATE to record my new routine at http://alexa.amazon.com, wait a minute, and test my new routine:

Alexa, Restart Fire TV Stick

and Alexa responds

Sorry, I am unable to restart the book right now.

I make a good guess: I change the trigger phrase to “Restart” and Alexa executes my routine. But my second action does not work; I need a delay before turning the power back on. I insert an Alexa Says action: “Au revoir!”. I test again, and it works as intended!

Alexa Routines are still in an early stage of development. I expect that future changes will make Routines into a powerful, useful tool.

myenv package for Windows 10 + Cygwin + WSL/Ubuntu

Windows 10 can run two Linux subsystems simultaneously: Cygwin and Ubuntu. I developed a small package of commands (myenv.zip) to conveniently access files from all three operating systems. It creates five environment variables

myOS — Cygwin or GNU/Linux

myDRIVE — install drive of Windows 10

WHOME — Windows home directory

CHOME — Cygwin home directory

LHOME — Ubuntu home directory

Just add “.  myenv” to your .profile and you can access files like this:

$WHOME/OneDrive     (Microsoft cloud store)

$CHOME/KE/bin/ke.exe     (my Knowledge Explorer)

$LHOME/../../rootfs/etc/shadow     (to delete forgotten password)

There’s one caveat: Microsoft has a complex scheme for buffering $LHOME (Windows file system) and $HOME (Ubuntu file system). Don’t try to access $LHOME until you exit the Ubuntu terminal window.

The myenv package includes three other useful commands:

path — prints each $PATH directory on separate line

wordpad — example command not found in $PATH directory

mkzip — zip all files in directory and its subdirectories

To install the free myenv package, download http://ContextKnowledgeSystems.org/download/myenv.zip and unzip in any directory in $PATH. I suggest using directory $myDRIVE/bin or /usr/local/bin or $HOME/bin.