How to: Setting up the Lighting API with Login with Amazon authentication
I finally have my lighting skill adapter set up and approved through Amazon. My custom skill adapter now shows up in the Alexa app under settings->connected home. The documentation for setting this up is pretty straight forward up to the point of setting up an OAuth2 provider. First, read the documentation over really well:
https://developer.amazon.com/public/binaries/content/assets/html/alexa-lighting-api.html There are some detailed walkthroughs for setting up a Lambda function, installing AWS CLI, creating an IAM and giving a couple of the backend endpoints permissions to invoke your lambda function. It'll take a few minutes to set it all up, but that's the first step. After following the instructions for setting up the Lambda function, we can set up Login with Amazon as the OAuth provider. Of course, you can do this on your own server if you want, but some devices just aren't capable. Go to
login.amazon.com and create an account, then register a new application. Here are some example settings to use in setting up the new application: Name: MyLightingAdapter Description: My own home automation lighting skill adapter Privacy Notice URL: Submit that form and next you'll select web settings. Here you want to note your client ID and client secret, and add https://pitangui.amazon.com/partner-authorization/establish to the allowed return URLs. From here, just submit an email to
firstname.lastname@example.org with the following information: (this is a copy and paste from my own email that I sent, use your own information where appropriate) Skill adapter display name: ASKLightingSkillAdapter Skill adapter description: Personal Skill Adapter for my home automation system AWS Lambda function name: OAuth Client ID: OAuth Client Secret: OAuth Scope: profile OAuth authorization URL:
https://www.amazon.com/ap/oa OAuth token URL:
https://api.amazon.com/auth/o2/token Amazon Customer ID:
Thank you for posting this! Did you develop your custom adapter for a personal project? I just want to build my own home lighting system that works with Echo, and I don't really care about making it useable for the world. I am trying to do the minimal amount of oAuth required for things to work and I am fine with hard-coding secrets into the Lambda function's code. Saw you are using a Raspberry Pi. I am using a Particle Photon for the microcontroller, but my "cloud" is just my Lambda function making a call to an API which in turn calls a function on my microcontroller (all a service of Particle). I just emailed my credentials to CoHo and am anxious for a response.