09-03-2024 11:29 PM
Hi everyone,
I’m experiencing an issue with my smart home action, where Google Assistant isn’t triggering the onQuery functions for certain voice commands related to lighting, AC, and speaker devices.
While basic commands like “Hey Google, turn on the kitchen light” or “Hey Google, turn off the office AC” work as expected and trigger the backend, other more specific commands do not seem to hit my Cloud Function. This applies to both onQuery.
Additionally, I’m facing similar issues with my speaker device commands. Commands like the following are not triggering the onQuery function either:
I expect these specific commands to trigger the onQuery function in my Cloud Function, where the device state is queried and reported back to Google Assistant.
For all of these commands, no requests are hitting my backend onQuery . Other basic commands, such as turning the devices on or off, work perfectly and trigger the expected backend functions.
Google Assistant should trigger the onQuery function to retrieve and report the state of the device.
No requests are received in the onQuery functions for these specific commands, and no logs are generated in Google Cloud for these cases. However, basic commands like “Turn on kitchen light” or “Turn off office AC” trigger the backend functions as expected.
Can anyone help identify why these specific commands are not triggering the necessary backend functions (onQuery)? Any guidance or troubleshooting tips would be greatly appreciated.
Thanks in advance!
Answered! Go to the Recommended Answer.
10-01-2024 01:21 AM
Hi @abhijith007 ,
Since there is a similar ticket in issue tracker, I will follow up the conversation there.
09-05-2024 10:18 AM
Thanks for bringing this up. Can you please share the full sync response and some code snippets from your onQuery
function, especially the parts that handle the query parsing and device state retrieval?
09-11-2024 02:30 AM
Hi Google Support Team,
Thank you for your response. I would like to provide the additional details and code snippets you requested regarding the issue I am encountering with the onQuery function not being triggered for certain commands.
Please find the complete JSON response that I receive when requesting a full sync attached to this message.
{
"requestId":"17211539550413013445",
"payload":{
"agentUserId":"***************************",
"devices":[
{
"id":"1201@40971@PH80070019081955425",
"type":"action.devices.types.CURTAIN",
"traits":[
"action.devices.traits.OpenClose"
],
"name":{
"defaultNames":[
"Curtain"
],
"name":"Curtain",
"nicknames":[
"Curtain"
]
},
"deviceInfo":{
"manufacturer":"**********",
"model":"hs1234",
"hwVersion":"3.2",
"swVersion":"11.4"
},
"willReportState":true
},
{
"id":"1136@40972@PH80070019081955425",
"type":"action.devices.types.THERMOSTAT",
"traits":[
"action.devices.traits.TemperatureSetting",
"action.devices.traits.FanSpeed",
"action.devices.traits.OnOff"
],
"name":{
"defaultNames":[
"Thermostat"
],
"name":"Daikin AC",
"nicknames":[
"Daikin AC"
]
},
"deviceInfo":{
"manufacturer":"**********",
"model":"hs1234",
"hwVersion":"3.2",
"swVersion":"11.4"
},
"willReportState":true,
"attributes":{
"availableThermostatModes":[
"heat",
"cool",
"auto"
],
"availableFanSpeeds":{
"speeds":[
{
"speed_name":"speed_low",
"speed_values":[
{
"speed_synonym":[
"low",
"slow"
],
"lang":"en"
}
]
},
{
"speed_name":"speed_medium",
"speed_values":[
{
"speed_synonym":[
"medium"
],
"lang":"en"
}
]
},
{
"speed_name":"speed_high",
"speed_values":[
{
"speed_synonym":[
"high"
],
"lang":"en"
}
]
}
],
"ordered":true
},
"thermostatTemperatureUnit":"C",
"commandOnlyTemperatureSetting":true
}
},
{
"id":"1056@40973@PH80070019081955425",
"type":"action.devices.types.SPEAKER",
"traits":[
"action.devices.traits.OnOff",
"action.devices.traits.Volume",
"action.devices.traits.TransportControl"
],
"name":{
"defaultNames":[
"Speaker"
],
"name":"sonos Office",
"nicknames":[
"sonos Office"
]
},
"deviceInfo":{
"manufacturer":"**********",
"model":"hs1234",
"hwVersion":"3.2",
"swVersion":"11.4"
},
"willReportState":true,
"attributes":{
"transportControlSupportedCommands":[
"NEXT",
"PREVIOUS",
"PAUSE",
"STOP",
"RESUME"
],
"volumeMaxLevel":100,
"volumeCanMuteAndUnmute":true,
"supportPlaybackState":true
}
},
{
"id":"515@40974@PH80070019081955425",
"type":"action.devices.types.LIGHT",
"traits":[
"action.devices.traits.OnOff",
"action.devices.traits.Brightness",
"action.devices.traits.ColorSetting"
],
"name":{
"defaultNames":[
"Color Light"
],
"name":"Hue color lamp 1",
"nicknames":[
"Hue color lamp 1"
]
},
"deviceInfo":{
"manufacturer":"**********",
"model":"hs1234",
"hwVersion":"3.2",
"swVersion":"11.4"
},
"willReportState":true,
"attributes":{
"colorModel":"hsv",
"commandOnlyBrightness":true
}
},
{
"id":"515@40975@PH80070019081955425",
"type":"action.devices.types.LIGHT",
"traits":[
"action.devices.traits.OnOff",
"action.devices.traits.Brightness",
"action.devices.traits.ColorSetting"
],
"name":{
"defaultNames":[
"Color Light"
],
"name":"Hue color lamp 2",
"nicknames":[
"Hue color lamp 2"
]
},
"deviceInfo":{
"manufacturer":"**********",
"model":"hs1234",
"hwVersion":"3.2",
"swVersion":"11.4"
},
"willReportState":true,
"attributes":{
"colorModel":"hsv",
"commandOnlyBrightness":true
}
},
{
"id":"515@40976@PH80070019081955425",
"type":"action.devices.types.LIGHT",
"traits":[
"action.devices.traits.OnOff",
"action.devices.traits.Brightness",
"action.devices.traits.ColorSetting"
],
"name":{
"defaultNames":[
"Color Light"
],
"name":"Hue color lamp 3",
"nicknames":[
"Hue color lamp 3"
]
},
"deviceInfo":{
"manufacturer":"**********",
"model":"hs1234",
"hwVersion":"3.2",
"swVersion":"11.4"
},
"willReportState":true,
"attributes":{
"colorModel":"hsv",
"commandOnlyBrightness":true
}
},
{
"id":"576@40977@PH80070019081955425",
"type":"action.devices.types.FAN",
"traits":[
"action.devices.traits.OnOff",
"action.devices.traits.FanSpeed"
],
"name":{
"defaultNames":[
"Fan"
],
"name":"Mistral Fan",
"nicknames":[
"Mistral Fan"
]
},
"deviceInfo":{
"manufacturer":"**********",
"model":"hs1234",
"hwVersion":"3.2",
"swVersion":"11.4"
},
"willReportState":true,
"attributes":{
"availableFanSpeeds":{
"speeds":[
{
"speed_name":"speed_low",
"speed_values":[
{
"speed_synonym":[
"low",
"slow"
],
"lang":"en"
}
]
},
{
"speed_name":"speed_medium",
"speed_values":[
{
"speed_synonym":[
"medium"
],
"lang":"en"
}
]
},
{
"speed_name":"speed_high",
"speed_values":[
{
"speed_synonym":[
"high"
],
"lang":"en"
}
]
}
],
"ordered":true
},
"reversible":true,
"supportsFanSpeedPercent":true,
"commandOnlyFanSpeed":true
}
},
{
"id":"1109@40978@PH80070019081955425",
"type":"action.devices.types.TV",
"traits":[
"action.devices.traits.OnOff"
],
"name":{
"defaultNames":[
"TV"
],
"name":"LG TV",
"nicknames":[
"LG TV"
]
},
"deviceInfo":{
"manufacturer":"**********",
"model":"hs1234",
"hwVersion":"3.2",
"swVersion":"11.4"
},
"willReportState":true
},
{
"id":"128@4097@PH80070019081955425",
"type":"action.devices.types.LIGHT",
"traits":[
"action.devices.traits.OnOff"
],
"name":{
"defaultNames":[
"Group"
],
"name":"A1 Group",
"nicknames":[
"A1 Group"
]
},
"deviceInfo":{
"manufacturer":"**********",
"model":"hs1234",
"hwVersion":"3.2",
"swVersion":"11.4"
},
"willReportState":true
},
{
"id":"112@49153@PH80070019081955425",
"type":"action.devices.types.LIGHT",
"traits":[
"action.devices.traits.OnOff"
],
"name":{
"defaultNames":[
"Zone"
],
"name":"K1 Zone",
"nicknames":[
"K1 Zone"
]
},
"deviceInfo":{
"manufacturer":"**********",
"model":"hs1234",
"hwVersion":"3.2",
"swVersion":"11.4"
},
"willReportState":true
},
{
"id":"160@12289@PH80070019081955425",
"type":"action.devices.types.SCENE",
"traits":[
"action.devices.traits.Scene"
],
"name":{
"defaultNames":[
"Simple Event"
],
"name":"Abhijith",
"nicknames":[
"Abhijith"
]
},
"deviceInfo":{
"manufacturer":"**********",
"model":"hs1234",
"hwVersion":"3.2",
"swVersion":"11.4"
},
"willReportState":true,
"attributes":{
"sceneReversible":true
}
},
{
"id":"160@0@PH80070019081955425",
"type":"action.devices.types.SCENE",
"traits":[
"action.devices.traits.Scene"
],
"name":{
"defaultNames":[
"Simple Event"
],
"name":"All Event",
"nicknames":[
"All Event"
]
},
"deviceInfo":{
"manufacturer":"**********",
"model":"hs1234",
"hwVersion":"3.2",
"swVersion":"11.4"
},
"willReportState":true,
"attributes":{
"sceneReversible":true
}
}
]
}
}
Below are the relevant code snippets from my onQuery function, focusing on:
I am extracting the device ID and other relevant information as follows:
const onQuery = (body) => { const deviceId = body.inputs[0].payload.devices[0].id; // Additional parsing logic... };
The device state is being retrieved from an external API and returning the relevant values within the query response.
The following commands also do not seem to trigger the function as expected:
"Hey Google, is my speaker mute?"
"Hey Google, what is the volume of my speaker?"
"Hey Google, did my speaker stop playing a song?"
Despite the devices being successfully discovered and controllable, the onQuery function does not seem to activate for these queries. I would appreciate your assistance in investigating why these particular queries are not being handled by the onQuery function and what additional steps or configuration might be required to support these commands.
Please let me know if any further information is needed. Thank you for your help in resolving this issue.
09-23-2024 07:09 PM
Dear Google Support Team,
I hope you’re doing well. I’m writing to follow up on the issue I raised regarding the check commands in my Google Smart Home integration. As requested, I previously submitted the SYNC response and a code snippet for my onQuery function. However, I have not received any updates or further feedback.
To recap, the issue involves inconsistent responses from Google Assistant when querying device states. I’ve reviewed the SYNC response and the onQuery logic, but the problem persists. Could you kindly provide any insights or further guidance on the matter?
I would appreciate an update or suggestions on how to resolve this issue effectively.
Thank you for your time and support.
Best regards,
Abhijith
10-01-2024 01:21 AM
Hi @abhijith007 ,
Since there is a similar ticket in issue tracker, I will follow up the conversation there.
12-11-2024 01:55 AM
We raised a support ticket with Google regarding an issue where Google Assistant does not trigger onExecute or onQuery for certain specific check commands. As per the response from the support team, this is an expected behavior according to their implementation.
We further sought clarification to confirm whether this behavior applies to commands such as:
As of now, we are waiting for confirmation from Google on the above scenarios. Once clarified, we will proceed accordingly and share further updates.