Control Raspberry Pi using Amazon Echo

It is convenient to control a Raspberry Pi through Amazon Alexa or Echo. Examples of control are:

    • Alexa, <device> <command>

    • Alexa, security on

    • Alexa, security off

    • Alexa, kodi reboot

    • Alexa kodi shutdown

Parts:

Raspberry Pi 3B+ or later running latest version of raspbian


Arrrgh! Does not work on Raspberry PI OS Lite or Raspberry Pi OS. Alexa doesn't discover device. I tried with and without WeMo skill linked to Alexa.

Step 2. Install needed packages and modules

Install pip

$ sudo apt install python-pip -y

The following command allows requests to be found by systemd

$ sudo -H pip install requests

Step 3. Enable writing to the log file

$ touch rpi-echo.log

$ sudo chmod og+w rpi-echo.log

Step 4. Edit rpi-echo.py to do what you want

rpi-echo.py is stored in /usr/local/bin

I have the script setup to turn security on and off, but you can have it do anything that is scriptable

Edit the code as described in rpi-echo.py

An echo command requires, Alexa, turn <device> <command>