Nano Banana Pro
Agent skill for nano-banana-pro
Here, we will play the role of smart home customer by registering to use our thermostat skill with Alexa. We will then "map" our AWS IoT thing to our new user ID and finally run the Alexa discovery process to allow Alexa to interact with our device.
Sign in to like and favorite skills
Here, we will play the role of smart home customer by registering to use our thermostat skill with Alexa. We will then "map" our AWS IoT thing to our new user ID and finally run the Alexa discovery process to allow Alexa to interact with our device.
Now that our skill and backend cloud infrastructure exists, we can now sign up to use the skill:
Install the Amazon Alexa app (Android, iOS) and sign in using the same email address that you used to create your Alexa skill. Alternatively, you may follow the Alexa Beta Tester Guide to invite others to use your skill.
Open the Alexa app and click Devices in the lower right:
Click Your Smart Home Skills in the middle of the screen:
You should see a skill named alexa-smart-home-demo (or, whatever name you used when creating your skill in the Alexa Developer Console). If you do not see your skill, ensure that you are signed in to the Alexa app using the same email you used in the Alexa Developer Console or using an email that you sent a beta invitation to. Click the skill name:
Click Enable to use:
You will be brought to a sign-in screen. Click sign up:
Sign up for your skill with your mobile number (for US numbers, must be in the format "+1xxxyyyzzzz"):
You will receive a verification code via SMS text. Enter that code to complete the sign-up process:
You should be greeted with a successfully linked message:
At this point, we need to link your new app user ID (from Amazon Cognito) to the demo AWS IoT thing we created for you previously in the Part 1 CloudFormation Template. Normally, a device manufacturer would have some process to do this for us (e.g. a web or mobile app), but we will manually create this association by adding it to a DynamoDB table used by our skill's Lambda function. The Lambda will query this table to find the device(s) owned by our user.
Proceed as follows:
Navigate to the Cognito user pool console and click the user pool with a name like
CognitoUserPool-XXXXXXXXXXXX, click the Users and groups on the left:
You should see only one username similar to
e478e49d-e8d9-4490-9b53-bcb0fba2f18b, since you're app is not publically open for registration. Just to be sure, click the username and on the next page, verify that the user's phone number matches the number you used when signing up. If it matches, make note of the username; you will need this in step 5.
Navigate to the IoT thing list and make note of the thing name that looks similar to
alexa-smart-home-demo-SmartHomeThing-1LW418RIHGL2X; you will need this in step 5.
Navigate to the DynamoDB table list, click the table with a name similar to
alexa-smart-home-demo-DeviceTable-1EM716Y4F5F6H, click the Items tab, and click Create item:
On the create item popup window, click the top-left dropdown and change it from "Tree" to "Text", then copy paste the info below and click Save. Be sure to replace the user ID and thing name with your unique values from Steps 1 and 2:
{ "hashId": "userId_e478e49d-e8d9-4490-9b53-bcb0fba2f18b", "sortId": "thingName_alexa-smart-home-demo-SmartHomeThing-1LW418RIHGL2X", "thingName": "alexa-smart-home-demo-SmartHomeThing-1LW418RIHGL2X", "userId": "e478e49d-e8d9-4490-9b53-bcb0fba2f18b" }
Note - be sure to include the
userId_ and thingName_ prefix in the hashId and sortId columns, but do not keep them in the thingName and userId columns.
Now that our backend has an association between our skill's user ID and our IoT thing, we can Ask Alexa (or use the Alexa web or mobile app) to discover our devices. The examples below show the mobile app, but you could just as easily ask your Alexa device "Alexa, discover devices".
Click Discover Devices to have the Alexa Cloud invoke your skill's Lambda function to search for and tell Alexa which device(s) are registered to your account:
If Alexa says/shows that a new device was discovered, you can proceed. You can also verify that the proper device was added by viewing the list of your smart home devices from within the Alexa web or mobile app and confirming a new "Smart Thermostat" device is listed.
Proceed to Step 3 - Test your skill.