0

This question was prompted by our previous question regarding review requirements for QUERY intents, found here.

Although we are currently unable to implement querying a detailed status of many of our devices, we would like to respond properly to attempts at QUERY intents. Specifically: with a notSupported error response seems appropriate. For a general user query, such as "Is the Desk light on?", this works as we would expect:

"That mode isn't available for the Desk light".

However, when attempting relative operations, such as "Dim the Desk light.", the same response format results in the following response by Google Home:

"Encountered an unknown error for the Desk light."

The same json response is returned in both scenarios:

{ 

"requestId": "****************", 

"payload": { 

    "devices": { 
        "********": { 
            "errorCode": "notSupported" 
            } 
        } 
    } 
}

We have verified, by faking a query response with an actual brightness status, that the intent continues properly after the QUERY returns; receiving an EXECUTE intent next to effect the change in brightness.

We are unsure why a notSupported error is handled differently in this case; are we perhaps misunderstanding how an error response to this kind of QUERY should be formatted? If so, how can we distinguish a QUERY intent that will be followed by an EXECUTE intent from a solitary QUERY intent? Perhaps there is something else entirely that we have missed?

Thank you for reading.

2 Answers2

0

When giving a relative command, like "dim the desk light", the Google Assistant first needs to know the current brightness. To do this, the Assistant either needs to first query your server or use REPORT_STATE to store the data directly in the HomeGraph.

The responses are intentional. If I ask if the light is on, the device cannot respond to that type of query.

If I want to change the brightness, that is a mode that your light can support. Saying otherwise would be incorrect. However, the execution flow fails since it cannot retrieve your current brightness. Without knowing what it is now, it cannot relatively change the brightness and returns an error.

Saying something like "set my light to 10 percent" is an absolute change.

Nick Felker
  • 11,536
  • 1
  • 21
  • 35
  • Thank you for the comment. We realize this, however, and our primary concern is the fact that Google states an "unknown error" in the second scenario, despite us (as developers) being very much aware of what the error is; and wanting to communicate this to our users. Changing brightness is indeed something the light supports, but doing so relatively is *not* supported (due to our inability to respond correctly to QUERY commands). Do you perhaps know of a way we can inform Google Home about this, that it might distinguish the two? – Tobias van de Ven Nov 17 '17 at 08:08
  • One of the core aspects of Smart Home is being able to respond to QUERY commands. Can you store the state of your devices in your cloud so you can do so without having to go all the way to the device? – Nick Felker Nov 17 '17 at 19:17
  • We agree that it is desirable to support device status queries. Due to the absence of such functionality in our cloud at this time and the inability to query from some devices because of hardware limitations, unfortunately, we had decided to do without this option initially. After re-evaluating the situation, however, we have elected to implement this immediately. Thank you for your advice. – Tobias van de Ven Nov 20 '17 at 09:15
0

just following up on this - i get the logic in the Query - but the Query itself is totally vanilla - how do we know that it's a query that needs to return: "brightness": 65

rather than - "on": true

Madgeni
  • 65
  • 4
  • 1
    I believe the intent of a QUERY is to always respond with *all states* that a device is in. The assumption is then that *all states* will at least include the state that the query is actually looking for (in this case: "brightness"). In your scenario, then, you might include all of the following in your response { "online": true, "on": true, "brightness": 65 }. – Tobias van de Ven Nov 17 '17 at 08:26
  • ah ok, i'd missed that in the documentation..I'll update my responses with all states - made a quick change, and it works. Very neat actually, better than Alexa – Madgeni Nov 17 '17 at 09:54