KAIYIN@AMAZON.COM avatar image

Use Smart Home gitHub sample Skill to test your response

When developing Smart Home Skill, one of the frequently asked questions we got from developers is: "Is this the correct way to call the Smart Home APIs?"

Without messing up your huge and complex Smart Home Skill, you can actually test the Smart Home API response format from the Sample Skill in Python provided by Alexa gitHub repository.

To begin with, follow the instruction on to build this Sample skill on your developer account.

Let's use Lock as an example, in the tech doc it described the response format:

Since we already have sample Lock device and capability for Lock, what's missing in the sample code is the response in Python, we can simply follow the current existing sample response, but make a Lock one:

if request_namespace == "Alexa.LockController":if request_name == "Lock": response ={
"correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg=="

"endpoint": {

"scope": {

"type": "BearerToken",

"token": "access-token-from-Amazon"


"endpointId": "appliance-001"




return response

This is very simple, you just need to figure out what request format is (namespace and value), and follow the existing Python response code to configure the response. The value of each field are coming from the tech doc. You can test the Lock device from test simulator to see if the response format is correct, then use the same response format in your real Smart Home Skill.

Now, please try to do the same for other responses for Lock. :)

smart home
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.



hukaiyin contributed to this article

Related Articles