1
votes

Is it possible to programmatically trigger an Alexa smart home “discovery”?

I’m working on a custom skill that can be used to add and configure devices in an associated smart home skill. Using the custom skill, the user can add and edit device names recognized by the smart home skill.

This works fine, but as expected requires the user to perform "discover new devices" before the smart home skill will pick up the changes.

Is there a way that the custom skill could trigger a new discovery on the smart home skill to pick up the new device info?

I'd rather not have the custom skill tell the user “Ok, now go open the Alexa app, go to smart home, and select discovery".

1

1 Answers

0
votes

There is a workaround for your problem. If you see how Alexa.Discovery works you have to make a request to the endpoint. If you have the access to the endpoint you can send the request and get the new devices int the response from the endpoint.

Discovery Request :

{
  "directive": {
    "header": {
      "namespace": "Alexa.Discovery",
      "name": "Discover",
      "payloadVersion": "3",
      "messageId": "1bd5d003-31b9-476f-ad03-71d471922820"
    },
    "payload": {
      "scope": {
        "type": "BearerToken",
        "token": "access-token-from-skill"
      }
    }
  }
}