question

shanthi avatar image
shanthi asked

ALEXA discover interface not working, discovery response not taken into account

My lambda receives the following alexa discovery directive


{'directive': {'header': {'namespace': 'Alexa.Discovery', 'name': 'Discover', 'payloadVersion': '3', 'messageId': 'messageid123'}, 'payload': {'scope': {'type': 'BearerToken', 'token': 'blablablablablablablablablabla'}}}}


and my lambda sends the following response

{
    "event": {
        "header": {
            "namespace": "Alexa.Discovery",
            "name": "Discover.Response",
            "payloadVersion": "3",
            "messageId": "messageid123"
        },
        "payload": {
            "endpoints": [
                {
                    "endpointId": "mylock123",
                    "manufacturerName": "Big locks",
                    "description": "big lock One",
                    "friendlyName": "big lock one",
                    "displayCategories": [
                        "SMARTLOCK"
                    ],
                    "additionalAttributes": {
                        "manufacturer": "Custom lock",
                        "model": "Model m234"
                    },
                    "cookie": {
                        "model": "abcd01",
                        "manufacturer": "magiclocks"
                    },
                    "capabilities": [
                        {
                            "type": "AlexaInterface",
                            "interface": "Alexa.LockController",
                            "version": "3",
                            "properties": {
                                "supported": [
                                    {
                                        "name": "lockState"
                                    }
                                ],
                                "proactivelyReported": true,
                                "retrievable": true
                            }
                        }
                    ],
                    "connections": [],
                    "relationships": {}
                }
            ]
        }
    }
}


and alexa.amazon.com webpage is NOT recognizing the new device at all even after clicking the discovery button?


My questions

  1. Should the discovery response messageid 'messageid123' be same as the discovery directive message from alexa? I have tried using both a unique message id as well the same id. but the device is not getting added
  2. I'm testing using alexa.amazon.com website and clicking on discovery button. Is this ok?
  3. Does there need to be an actual device present in the same network as alexa? or alexa will just add whatever response we send and will consider it as a newly found device?
  4. Please note my alexa skills's lambda gets the discovery directive when I press DISCOVER button on alexa.amazon.com




alexa skills kitalexaalexa smart homealexa simulatoralexa dev days
10 |5000

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

1 Answer

Jason@Amazon avatar image
Jason@Amazon answered

I recommend following the guide below first and troubleshooting your discovery response first - your steps to test should be fine as device discovery depends on the response that your Lambda function returns in response to the Discover directive.


https://developer.amazon.com/en-US/blogs/alexa/device-makers/2020/12/common-issues-in-alexa-smart-home-skills-and-how-to-troubleshoot-them


In regards to the message ID, you can set it as you see fit:

https://developer.amazon.com/en-US/docs/alexa/device-apis/message-guide.html#header-object

10 |5000

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