For the sample environment, a development Login with Amazon (LWA) security profile will be used for configuring Account Linking, which is required for a Smart Home Skill.
If you already have a valid security profile created, you can reuse that profile and skip creating and configuring a new security profile.
Create a Login with Amazon Security Profile
To facilitate account linking in the Smart Home sample code, a security profile is needed to generate a Client ID and Client Secret to use during the configuration of the Alexa skill.
- In your web browser, go to https://developer.amazon.com/lwa/sp/overview.html.
- On the Login with Amazon page, click the Create a New Security Profile.
- On the Security Profile Management page, enter
Smart Home Security Profile Mischianti
for the Security Profile Name. - For the Security Profile Description enter
A Security profile for Mischianti Alexa Smart Home Skill
. - For the Consent Privacy Notice URL/URL del consenso all’Informativa sulla privacy enter https://mischianti.org/privacy-policy-2/ for illustrative purposes or use your own if you already have a public consent privacy policy. For a production Smart Home Skill, a valid consent privacy notice will be required.
- For the Consent Logo Image use the
alexa-mischianti-smarthome-150x
file in the /resources source folder or download to your working directory and then click the Upload Image area to load the PNG file from where you saved it. - If your profile configuration looks like the following, click Save on the Security Profile Management page.
Configure the Login with Amazon Security Profile
If creating the Login with Amazon Security Profile was successful, a message similar to ‘Login with Amazon successfully enabled for Security Profile. Click (gear-icon) to manage Security Profile.’ will be returned.
- From the list of Security Profiles, click the Show Client ID and Client Secret link for the Sample Alexa Smart Home profile.
- Copy the displayed Client ID and Client Secret values and save them to the
setup.txt
file in thealexa-skill-manage-relay
directory replacing the format example entries for [Login with Amazon Client ID] and [Login with Amazon Client Secret] respectively.
[Login with Amazon Client ID]
amzn1.application-oa2-client.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Login with Amazon Client Secret]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Further configuration of the Security Profile Allowed Return URLs will be done during configuration of the Alexa Smart Home Skill Account Linking.
Create the Skill
Create an Alexa Smart Home Skill that will respond to Smart Home commands.
Create a Skill via the Alexa Skills Kit Developer Console
- In a web browser open the Alexa Skills Kit Developer Console at https://developer.amazon.com/alexa/console/ask. If not already authenticated, you may have to Sign In with your Amazon Developer Account.
- Click the Create Skill button.
- For the Skill name, enter
skill-esp8266-nodejs-smarthome-switch
. - Select the preferred language.
- Under Choose a model to add to your skill select the Smart Home model.
- Click the Create a skill button. When completed, you should be at the configuration page for a newly created skill skill-esp8266-nodejs-smarthome-switch.
- In the Smart Home service endpoint section, locate the Your Skill ID value and click the Copy to clipboard link to copy and then paste the Alexa Skill Application ID into the [Alexa Skill Application ID] section of your working
setup.txt
file in youralexa-skill-manage-relay
directory.
Thanks
- AWS Alexa Smart Home Skill: introduction and startup
- AWS Alexa Smart Home Skill: create the skill manage the security
- AWS Alexa Smart Home Skill: create lambda and manage security
- AWS Alexa Smart Home Skill: configure lambda for the skill
- AWS Alexa Smart Home Skill: setup the DynamoDB database
- AWS Alexa Smart Home Skill: load sample code and test Lambda
- AWS Alexa Smart Home Skill: test your skill in dev and manage log