Google Assistant - Report state returns 200 but Test suite and report state dashboard fails

Viewed 320

I'm implementing a media remote device with OnOff and Volume traits. Report state payload looks like this:

{
    "requestId": "947aa603-1bfe-4bff-bac0-a50101da419d",
    "agentUserId": "13",
    "payload": {
        "devices": {
            "states": {
                "71dbbc93-73c6-46d1-80b0-d988dd8b0835_1": {
                    "on": true,
                    "online": true,
                    "currentVolume": 25,
                    "isMuted": false
                }
            }
        }
    }
}

and the response is 200 OK with this data: {"requestId": "947aa603-1bfe-4bff-bac0-a50101da419d"}

willReportState is also set to true in SYNC response. requestSync works correctly.

I'm having the following issues:

  • The report state dashboard has an empty statescache for my device.
  • The test suite returns the following errors indicating there is no states: "AssertionError: Expected state to include: {"currentVolume":5}, actual state: {}: expected false to be true"

Does anyone know what is going wrong here?

2 Answers

Following up on the discussion in the comments, Home Graph API credentials should be created using a Service Account that has the appropriate Service Account Token Creator permissions on your Actions project. These credentials should not come from a project user's OAuth credentials.

I solved setting "commandOnlyOnOff" to false in SYNC response:

"attributes": {
   "commandOnlyOnOff": false
}
Related