The process involves two steps. The first step is the binding between the device and the user, and the second step is for Device Cloud to sends users’ device information back to Alexa when it receives ‘Alexa.Discovery’ command. Let’s understand the steps one by one.
When bind a device to a user, it will invoke the API and create an record in DynamoDB.
For a physical device, a serial number is usually being used as an uniquely identify a device. In this proposal, the serial number has been encoded into a QR code together with a link to a web page. Customers simply need to scan the QR code to bind the devices. In real word, the QR Code could be packed inside the device.
The following flow chart describes a proposed design of how to bind physical device to users.
The Alexa does not have any requirement for creating the relationship between devices and users. You can always design your own work flow.
Once the Alexa backend server receives the Alexa.Discovery, the server can retrieve device information from the database and return to Alexa.
Open Amplify Console in AWS Console, click Get started in Deploy session
Choose the Git repo provider and select Continue
Github will automatically ask for the authorization, after that, Choose the repo and branch, select Next
Input App name
Create a new environment, input the environment name of leave it as default
Select or create a new service role, and click Next
Click Save and deploy
Wait for the deployment to be finished. You will be see the URL for the web application.
You will ONLY need to run this if you would like to develop locally. Skip this part if you have already finished Deployment to Amplify Console.
In this application, Yarn and node.js are used to build the application.
amplify init, enter dev for environment name
amplify pushand type Yes when asked to confirm
yarn installto install dependencies
yarn startto start the web application