I have been trying to build an Alexa skill for the smart device but thing I don't understand if I send a request to the smart device using my Alexa then how does it know which task to perform. I understand till Alexa made a call to the lambda function then it make an api call to the smart device server but what I don't understand how does the device know that it has to it has to turn itself off or change the color of the light etc. Do we have to write special programming for that? Please, someone, explain how does it works as I am new here I am unable to understand it. Thank you in advance.
-
Have you tried reading the docs from Amazon? https://developer.amazon.com/documentation – Greg McMullen Jun 26 '18 at 13:52
-
yes, but nothing fruitful there. No information about it. – Exterminator Jun 26 '18 at 14:16
-
Which smart devices? – Helmar Jun 28 '18 at 09:56
2 Answers
You are right on the call being made to the smart device server. the activity details lies in the API that is requested.
Check the device URL (generally contains action name eg: Power) and body (contains action detail as Json like {"state":"on"}
)
So to write a smart device application you will need the API list for controlling the device

- 124,011
- 12
- 67
- 124

- 1
- 3
So Basically, Your echo device will give you the Event
and Handler
information when you speak to the Echo device.
Alexa.PowerController and Alexa.ColorController
These are the namespace
by which you will have an idea to your programming which command you would like to use. for ex.
{
"directive": {
"header": {
"namespace": "Alexa.PowerController",
"name": "TurnOn",
"payloadVersion": "3",
"messageId": "1bd5d003-31b9-476f-ad03-71d471922820",
"correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg=="
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-skill"
},
"endpointId": "appliance-001",
"cookie": {}
},
"payload": {}
}
}
For more details in depth please visit powerControl and colorControl documentation. This is one more example.
Hope, this may help you.

- 4,042
- 2
- 20
- 41