I'm encountering an issue with Google Assistant when I request to "turn on all devices." Even when I send a "FAILED" status for some devices, Google Assistant responds with "Ok, turning on x things" without any indication of the failure. Here's the JSON response I'm sending for the action.devices.EXECUTE action:
{
"requestId": "617XXX27787XXX16813",
"payload": {
"devices": {
"1081614XXX": {
"on": false,
"online": true,
"status": "SUCCESS"
},
// ... (other device entries)
"4153991XXX": {
"on": false,
"online": true,
"status": "FAILED"
}
}
}
}
Here's an overview of how my system works:
- I issue a command to Google Assistant to turn devices on/off.
- Google Assistant triggers my Lambda function.
- My Lambda function processes the request and calls backend APIs. It processes as many requests/devices as possible within 4 seconds. After 4 seconds, it sends a "FAILED" status for any remaining devices and "PENDING" for devices with a 202 HTTP Status Code. This is done to respond to Google Home within the 5-second time limit.
I have several questions:
Does Google Assistant provide a negative response for devices with a "FAILED" status, such as "Unable to turn on/off device"? I'm not receiving such responses.
I tried actuating a single device with a default status of "PENDING" and "FAILED," but I still received the same response ("Ok, turning on the <name of the device>"). Why is this happening?
Is there anything I might be missing in the response I'm sending to Google Assistant?
I'm facing a challenge when I have more than 20 devices to process within the 5-second time limit. Currently, I'm sending "PENDING" for devices with successful actuation but which take time. Is there a better approach to handle this issue without sending "FAILED"?
I appreciate any insights or suggestions to improve this situation. Thank you!
The issue was with the
statuskey itself, it should have beenERRORand notFAILED.Here's an example: