MultipassSkill ---Warning!! Mostly complete, but not fully vetted.
Alexa Smart Home Skill that integrates with RPi via MQTT and Shadows
It can be used in conjunction with AlexaPi. It born from this case design: http://www.thingiverse.com/thing:1913786
Basic flow is:
- Alexa calls Smart Home Skill "Multipass" (Utterance to Intent): "Alexa, tell Multipass Power On"
- Smart Home Skill "Multipass" converts this to a "Lambda" request: "intent":{"name":"Multipass","slots":{"Keys":{"name": "Keys","value":"Power"}}}
- The Lambda function takes the request, traps invalid commands, and writes it to a "Shadow" of the thing (written in Python 2.7, (which I didn't find any docs on how to do it): $aws/things/Multipass/shadow/command: {"message":"POWER"}
- The Lambda function also replies back to the Smart Home Skill with a response: "response":{"outputSpeech {"type":"PlainText","text":"Baa Dah boom"}}
- Python code running on the Rasberry Pi (MultipassPubSub.py) polls the shawdow (and it can be modified to place what the RPi is doing on that or other shadows).
Steps for Alexa install:
- Create (if needed, you'd need it for AlexaPi) an Amazon developer account at https://developer.amazon.com
- Navigate to the Alexa Skills page at https://developer.amazon.com/edw/home.html#/skills/list and then add a new skill.
- The Skill Information page: Give your skill a name and click "No" on the Audio Player section. I captured the Applicaiton ID for my records.
- The Intent Schema page: Complete this page from the data provided in the Interaction_IntentSchema file.
- The Configuration page: The Service Endpoint is "AWS Lambda ARN". The geographic region is "North America", and the ARN is from the Lambda fuction from above. Mark "No" for "Account Linking".
- The Publishing Information page: I marked my the "Category" as "Smart Home", "Testing Instructions" as "Raspberry Pi IR Handler, Requires MultipassPubSub.py running on RPi, run from command line to view commands as they are passed." Countries & Region: is "All countries". Short Skill Description is "Raspberry Pi IR Handler". I used the Thingiverse description for the RPi build in the Full Skill Description. For Example Phrases I used: "Alexa tell Multipass to Power", "Alexa tell Multipass Power", "Alexa ask Multipass Power On". Keywords: "Smart,Home,Raspberry,Pi,Lirc,Implementation". You absolutely have to use
Steps for RPi Install:
- Base install, config network and raspi-config
- sudo apt-get update and upgrade
- sudo apt-get install git pip
- sudo pip install paho-mqtt
- sudo pip install AWSIoTPythonSDK
- (Opt). Install Alexa-pi if you want via https://github.com/alexa-pi/AlexaPi
- sudo git clone https://github.com/itdiscovery/MultipassSkill
- cp Multipass.service /lib/systemd/system/Multipass.service
- sudo chmod 644 /lib/systemd/system/Multipass.service
- sudo systemctl daemon-reload
- sudo systemctl enable Multipass.service