question

vishal avatar image
vishal asked

No devices found English (India)

My skill is in language English (India) and lambda function in Ireland. When I try to discover devices with alexa, I get "No devices found". Below is the discovery output when I trigger lambda function through AWS console.

{  "event": {
    "header": {
      "namespace": "Alexa.Discovery",
      "name": "Discover.Response",
      "payloadVersion": "3",
      "messageId": "232e94f1-682e-47df-a799-35fca8473f7c"
    },
    "payload": {
      "endpoints": [
        {
          "endpointId": "endpoint-001",
          "manufacturerName": "Sample Manufacturer",
          "friendlyName": "Switch",
          "description": "001 Switch that can only be turned on/off",
          "displayCategories": [
            "SWITCH"
          ],
          "cookie": {
            "detail1": "For simplicity, this is the only appliance",
            "detail2": "that has some values in the additionalApplianceDetails"
          },
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.PowerController",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "powerState"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ]
        }
      ]
    }
  }
}

I don't see any logs for Lambda in cloud watch when I try to discover devices through Alexa. I do see logs for authorization during account linking.

I can also confirm that Alexa Smart Home trigger is enabled on the lambda function.

Any help in this will be highly appreciated.

alexa smart homelambdadevice discovery
2 comments
10 |5000

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

Do you have a step of serialization inside of your lambda? My skill was written in c# and I kind of had the same problem. I fixed it by returning the response as an object graph without serialization because it looks like that the engine is doing that by default. So I guess my response got twice serialized before fix and that caused my trouble.

0 Likes 0 ·

Thanks for your reply Patrick. I am using Python so JSON serialization is not a concern. Below is my discovery v3 handler.

# v3 handlers
def handle_discovery_v3(request):
    endpoints = []
    for appliance in SAMPLE_APPLIANCES:
        endpoints.append(get_endpoint_from_v2_appliance(appliance))
    response = {
        "event": {
            "header": {
                "namespace": "Alexa.Discovery",
                "name": "Discover.Response",
                "payloadVersion": "3",
                "messageId": get_uuid()
            },
            "payload": {
                "endpoints": endpoints
            }
        }
    }
    return response

How did you debug your function? I dont see any logs or any other information to solve this.

0 Likes 0 ·

0 Answers