alexa-samples / alexa-smarthome

Resources for Alexa Smart Home developers.
https://alexa.design/smarthome
Other
679 stars 336 forks source link

Devices not discovering anymore for new test users #161

Closed SnehilChouhan closed 9 months ago

SnehilChouhan commented 3 years ago

Few months ago, I had demo Smart Home skill working, in which user can link account, some types of demo devices were discovering and control on it. Currently when I discover devices, it tells 'No new devices found'. It does not show demo/virtual devices in app also. Earlier it was working.

Response to discovery interface is same as earlier.

Here is example request: `{

"directive": {

"header": {

    "namespace": "Alexa.Discovery",
    "name": "Discover",
    "payloadVersion": "3",
    "messageId": "90939566-c7a7-4195-93ad-1a97834a3ab7"
},

"payload": {

    "scope": {

        "type": "BearerToken",
        "token": "Atza|IwEBIAjCr4kpR6T2B1cEdIfvCCxQmwwRBn28bC-pMOT0gmphXVQ1RR7cpuuuyX5Zd3nIKc77VmqeBw1FHP7m2LsOloqErzjHiliicy8pvtlJ1jvUxetVarUj8LvL_e9cT39CTqyERCJLzOKicZsW6z_679I7re1MOIOragx2T6yvrDRUUxo_O3KiflwMVZe87QZqZqURydYIZeCdi1S9SwmqCgPMKBxmsMfRq1vQIFP2RLe63C8VqlkTLvcBsWmVfSNE8SFwDpJuZI3Q2tFy2q2yOgBbLdL1oTd_EK8-mh813fsrzD1GcFixrTKrUgyAZulOmAe7jqB4-4E9eZbqbZ3Iyx1sPX0ltGc1KFjcOs2nZSVnpg"
    }

}

} } `

And here is Response:

`{

"event": {

"header": {
    "namespace": "Alexa.Discovery",
    "name": "Discover.Response",
    "messageId": "288fc958-b7c0-4782-840b-01a40c06f94d",
    "payloadVersion": "3"
},

"payload": {

    "endpoints": [
        {
            "capabilities": [

                {
                    "type": "AlexaInterface",
                    "interface": "Alexa",
                    "version": "3"
                },
                {

                    "type": "AlexaInterface",
                    "interface": "Alexa.PowerController",
                    "version": "3",
                    "properties": {

                        "supported": [
                            {
                                "name": "powerState"
                            }
                        ],
                        "proactivelyReported": false,
                        "retrievable": false
                    }

                }
            ],

            "description": "Sample Endpoint Description",
            "displayCategories": [
                "OTHER"
            ],

            "endpoint_id": "sample-switch-01",
            "friendlyName": "Sample Switch",
            "manufacturerName": "Sample Manufacturer"
        },

        {
            "capabilities": [

                {
                    "type": "AlexaInterface",
                    "interface": "Alexa",
                    "version": "3"
                },
                {
                    "type": "AlexaInterface",
                    "interface": "Alexa.BrightnessController",
                    "version": "3",
                    "properties": {
                        "supported": [
                            {
                                "name": "brightness"
                            }

                        ],
                        "proactivelyReported": false,
                        "retrievable": false
                    }
                }

            ],

            "description": "Sample Endpoint Description",
            "displayCategories": [
                "OTHER"
            ],

            "endpoint_id": "sample-brightness-01",
            "friendlyName": "Sample Brightness Bulb",
            "manufacturerName": "Sample Manufacturer"
        },
        {

            "capabilities": [
                {
                    "type": "AlexaInterface",
                    "interface": "Alexa",
                    "version": "3"
                },

                {
                    "type": "AlexaInterface",
                    "interface": "Alexa.ColorTemperatureController",
                    "version": "3",
                    "properties": {
                        "supported": [
                            {

                                "name": "SetColorTemperature"
                            }
                        ],
                        "proactivelyReported": false,
                        "retrievable": false
                    }
                }

            ],
            "description": "Sample Endpoint Description",
            "displayCategories": [
                "OTHER"
            ],

            "endpoint_id": "sample-dining-room-01",
            "friendlyName": "Sample Dining Room",
            "manufacturerName": "Sample Manufacturer"
        },
        {

            "capabilities": [
                {
                    "type": "AlexaInterface",
                    "interface": "Alexa",
                    "version": "3"
                },
                {

                    "type": "AlexaInterface",
                    "interface": "Alexa.ThermostatController",
                    "version": "3",
                    "properties": {
                        "supported": [
                            {
                                "name": "targetSetpoint"
                            }
                        ],

                        "proactivelyReported": false,
                        "retrievable": false
                    }
                }
            ],
            "description": "Sample Endpoint Description",
            "displayCategories": [
                "OTHER"
            ],

            "endpoint_id": "sample-heater-01",
            "friendlyName": "Sample Heater",
            "manufacturerName": "Sample Manufacturer"
        },
        {
            "capabilities": [
                {
                    "type": "AlexaInterface",
                    "interface": "Alexa",
                    "version": "3"
                },
                {

                    "type": "AlexaInterface",
                    "interface": "Alexa.Speaker",
                    "version": "3",
                    "properties": {
                        "supported": [
                            {
                                "name": "SetVolume"
                            },
                            {
                                "name": "SetMute"
                            }
                        ],

                        "proactivelyReported": false,
                        "retrievable": false
                    }
                }
            ],
            "description": "Sample Endpoint Description",
            "displayCategories": [
                "OTHER"
            ],

            "endpoint_id": "sample-speaker-01",
            "friendlyName": "Sample Speaker",
            "manufacturerName": "Sample Manufacturer"
        }
    ]
}

} }`

Please help, Does it have any relation to different users, database etc?

Thank you

aszk commented 9 months ago

I assume this issue related to account linking because it was working or you are using the same endpointId for multiple devices. Please make sure that your auth server providing new access token with refresh token. For further investigation, we need your customer ID for testing, Skill ID, activity key so please use https://alexa.design/contactus.

To get activity key:

  1. Go to the "Review Voice History" section of your Amazon account: https://www.amazon.com/alexa-privacy/apd/rvh
  2. Open your browser's web developer console: Firefox: Click: Tools > Browser Tools > Web Developer Tools Click the "Console" tab Chrome: Click: View > Developer > Developer Tools Click the "Console" tab
  3. On the "Review Voice History" page, click to expand an interaction
  4. Observe that the activity key for that interaction will be printed in the "Console" tab. It will look similar to the following: A1412N2U20AXFQ#1694546396232#A1Z88NGR2BK6A2#G0B16D0493720033