AWS Alexa Smart Home Skill: create the skill manage the security – 2

Spread the love

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.

Amazon AWS Smart Home Skill setup and security
Amazon AWS Smart Home Skill setup and security

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.

  1. In your web browser, go to https://developer.amazon.com/lwa/sp/overview.html.
  2. On the Login with Amazon page, click the Create a New Security Profile.
  3. On the Security Profile Management page, enter Smart Home Security Profile Mischianti for the Security Profile Name.
  4. For the Security Profile Description enter A Security profile for Mischianti Alexa Smart Home Skill.
  5. 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.
  6. 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.
  7. If your profile configuration looks like the following, click Save on the Security Profile Management page.
Alexa Skill Smarthome: Security Profile Management
Alexa Skill Smarthome: Security Profile Management

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.

  1. From the list of Security Profiles, click the Show Client ID and Client Secret link for the Sample Alexa Smart Home profile.
  2. Copy the displayed Client ID and Client Secret values and save them to the setup.txt file in the alexa-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

  1. 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.
  2. Click the Create Skill button.
  3. For the Skill name, enter skill-esp8266-nodejs-smarthome-switch.
  4. Select the preferred language.
  5. Under Choose a model to add to your skill select the Smart Home model.
  6. 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.
  7. 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 your alexa-skill-manage-relay directory.
Alexa Skill Smarthome: Alexa Skill Configuration (SkillID, lambda arn, linking)
Alexa Skill Smarthome: Alexa Skill Configuration (SkillID, lambda arn, linking)

Thanks

  1. AWS Alexa Smart Home Skill: introduction and startup
  2. AWS Alexa Smart Home Skill: create the skill manage the security
  3. AWS Alexa Smart Home Skill: create lambda and manage security
  4. AWS Alexa Smart Home Skill: configure lambda for the skill
  5. AWS Alexa Smart Home Skill: setup the DynamoDB database
  6. AWS Alexa Smart Home Skill: load sample code and test Lambda
  7. AWS Alexa Smart Home Skill: test your skill in dev and manage log

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *