Google Home App does not show fan speed and temperature settings for AC unit - google-smart-home

I'm trying to add an AC Unit to Google Home via Google Smart Actions. I have the action configured and successfully linked my app server to the Google Home App.
I have been using the following guide from Google to develop my app server:
https://developers.google.com/assistant/smarthome/guides/acunit
In response to Google's action.devices.SYNC request I am providing the following response:
{
"requestId": "request-id-providing-by-google",
"payload": {
"agentUserId": "unique-user-id",
"devices": [
{
"id": "device-id",
"type": "action.devices.types.AC_UNIT",
"traits": [
"action.devices.traits.FanSpeed",
"action.devices.traits.OnOff",
"action.devices.traits.TemperatureSetting"
],
"name": {
"name": "Air Conditioner"
},
"willReportState": false,
"roomHint": "Room 1",
"deviceInfo": {
"manufacturer": "man",
"model": "hs1234",
"hwVersion": "3.2",
"swVersion": "11.4"
},
"attributes": {
"availableFanSpeeds": {
"speeds": [
{
"speed_name": "speed_one",
"speed_values": [
{
"speed_synonym": [
"one"
],
"lang": "en"
}
]
},
{
"speed_name": "speed_two",
"speed_values": [
{
"speed_synonym": [
"two"
],
"lang": "en"
}
]
},
{
"speed_name": "speed_three",
"speed_values": [
{
"speed_synonym": [
"three"
],
"lang": "en"
}
]
},
{
"speed_name": "speed_four",
"speed_values": [
{
"speed_synonym": [
"four"
],
"lang": "en"
}
]
},
{
"speed_name": "speed_five",
"speed_values": [
{
"speed_synonym": [
"five"
],
"lang": "en"
}
]
}
],
"ordered": true
},
"supportsFanSpeedPercent": false,
"availableThermostatModes": [
"off",
"heat",
"cool",
"fan-only",
"dry",
"on"
],
"thermostatTemperatureRange": {
"minThresholdCelsius": 18,
"maxThresholdCelsius": 30
},
"thermostatTemperatureUnit": "C"
}
}
]
}
}
And in response to Google's action.devices.QUERY request I am providing this response:
{
"requestId": "request-id-providing-by-google",
"payload": {
"devices": {
"device-id": {
"status": "SUCCESS",
"online": true,
"on": true,
"currentFanSpeedSetting": "speed-five",
"thermostatMode": "off",
"thermostatTemperatureAmbient": 25,
"thermostatTemperatureSetpoint": 20,
"thermostatHumidityAmbient": 100
}
}
}
}
As you can see, I have:
Specified that my AC unit supports the On / Off, fan speeds and temperature setting traits
Given the necessary attributes for the specified traits
Provided the current values for the device and related traits
However, when I view this device in the Google Home App it only presents an On / Off button and no controls for fan speed and temperature.
I have looked through all related logs on Google Cloud Logging and there are no errors reports.
I have reviewed these seemingly related issues on the topic but the responses and comments have not resolved the issue:
https://github.com/actions-on-google/smart-home-nodejs/issues/500
https://github.com/actions-on-google/smart-home-nodejs/issues/330
Am I missing some parameters or config for these controls to appear?
Update 07/11 - Useful response from #ToniCorinne pointing out that on the Google Home Smartphone app FanSpeed controls are not currently supported, see this link:
https://developers.google.com/assistant/smarthome/develop/touch-controls#google_home_app
Obviously this doesn't account for TemperatureSettings, so I've opened the following bug with Google which at time of writing has not been assigned:
https://issuetracker.google.com/u/1/issues/205157683

FanSpeed is not currently a supported trait with touch controls in the Google Home app.
TemperatureSetting for an AC_Unit should have touch-controls, however. You could file an issue on the public issue tracker with your SYNC response and applicable information like the Google Home app version you're seeing this issue on for more help.

Related

Google Smart Home can't recognize "action.devices.commands.TimerStart" command

I'm integrating my sprinkler product with Google Smart Home. Everything works except that the "action.devices.commands.TimerStart" command cannot be recognized by Google smart home.
Below is my SYNC response:
"body": {
"requestId": "12486236378229063564",
"payload": {
"agentUserId": "Oliver",
"devices": [
{
"id": "AAAA-BBBB-CCCC-DDDD",
"type": "action.devices.types.SPRINKLER",
"traits": [
"action.devices.traits.Timer",
"action.devices.traits.StartStop"
],
"name": {
"name": "Front yard"
},
"willReportState": true,
"deviceInfo": {
"manufacturer": "ABC company",
"model": "ABC",
"hwVersion": "3.2",
"swVersion": "11.4"
},
"attributes": {
"maxTimerLimitSec": 86399
}
}
]
}
}
Below is the QUERY response:
"body": {
"requestId": "7683156339707030974",
"payload": {
"devices": {
"AAAA-BBBB-CCCC-DDDD": {
"status": "SUCCESS",
"online": true,
"isRunning": false,
"timerRemainingSec": -1
}
}
}
}
When I type or speak "Start Front yard" on Google home app, my backend server receives the following command, which is correct.
"payload": {
"commands": [
{
"devices": [
{
"id": "AAAA-BBBB-CCCC-DDDD"
}
],
"execution": [
{
"command": "action.devices.commands.StartStop",
"params": {
"start": true
}
}
]
}
]
}
But when I type or speak "Run Front yard for five minutes" on Google home app, my backend server still receives the same command (action.devices.commands.StartStop) as the above. What I expect to receive is "action.devices.commands.TimerStart" command. Can anyone pls help point out what I'm doing wrong?
I expect to receive the "action.devices.commands.TimerStart" instead of the "action.devices.commands.StartStop" command after typing or speaking "Run Front yard for five minutes" on Google smart home.

Alexa home skill v3 ToggleController skill fails to find devices

I'm trying to use the Alexa Smart Home Skill ToggleController v3 interface to build a skill that will open and close my gate. I read the docs, and successfully implemented the sample light bulb tutorial from end to end. https://developer.amazon.com/en-US/docs/alexa/smarthome/smart-home-skill-tutorial.html
Everything worked fine. Then I created a new skill and tried to implement the ToggleController interface, mapping ON and OFF to Open and Close using semantics.
Account linking works fine
Lambda gets called with discover directive when I enable the skill on
my Alexa app
There are no errors in CloudWatch
Alexa Simulator calls the right directives and receives responses with no errors
Schema validates successfully
When I click discover devices, I get "No new devices found".
I checked all devices in the Alexa app and my device is not there.
Below is the discovery response message that my lambda returns - (from CloudWatch).
Does anyone know what I'm doing wrong?
{
"event": {
"header": {
"namespace": "Alexa.Discovery",
"name": "Discover.Response",
"messageId": "fedfbae4-0ec8-4b4e-81d1-c998bc0ee860",
"payloadVersion": "3"
},
"payload": {
"endpoints": [
{
"endpointId": "pleasant-view-gate",
"manufacturerName": "Ancient Geeks",
"description": "Smart Gate at Pleasant View Cottage",
"friendlyName": "Pleasant Gate",
"displayCategories": [
"OTHER"
],
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa.ToggleController",
"instance": "PleasantView.Gate",
"version": "3",
"properties": {
"supported": [
{
"name": "toggleState"
}
],
"proactivelyReported": false,
"retrievable": true
},
"capabilityResources": {
"friendlyNames": [
{
"#type": "text",
"value": {
"text": "Gate",
"locale": "en-US"
}
}
]
},
"semantics": {
"actionMappings": [
{
"#type": "ActionsToDirective",
"actions": [
"Alexa.Actions.Close"
],
"directive": {
"name": "TurnOff",
"payload": {}
}
},
{
"#type": "ActionsToDirective",
"actions": [
"Alexa.Actions.Open"
],
"directive": {
"name": "TurnOn",
"payload": {}
}
}
],
"stateMappings": [
{
"#type": "StatesToValue",
"states": [
"Alexa.States.Closed"
],
"value": "OFF"
},
{
"#type": "StatesToValue",
"states": [
"Alexa.States.Open"
],
"value": "ON"
}
]
}
},
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
},
{
"type": "AlexaInterface",
"interface": "Alexa.EndpointHealth",
"version": "3",
"properties": {
"supported": [
{
"name": "connectivity"
}
],
"proactivelyReported": false,
"retrievable": true
}
}
]
}
]
}
}
}

Report State Always Return 404 after SYNC

I am able to pass the Test Suite but suddenly I'm getting the error 404 on the first time Report State after SYNC, which causes Account Linking failed. I have used the Validator provided at Smart Home Developer portal for my SYNC response which has no issue. And I found if I STOP then START my instance at GCP console, this issue is gone but comes back after a couple times of Account Linking and Unlink.
SYNC JSON object:
{
"requestId": "8044981777755038463",
"payload": {
"agentUserId": "123456789",
"devices": [
{
"id": "123-Fan",
"type": "action.devices.types.FAN",
"traits": [
"action.devices.traits.OnOff",
"action.devices.traits.FanSpeed"
],
"name": {
"defaultNames": [
"Simple Connect Fan"
],
"name": "Livingroom Fan",
"nicknames": [
"Simple Connect Fan"
]
},
"willReportState": true,
"attributes": {
"availableFanSpeeds": {
"speeds": [
{
"speed_name": "S0",
"speed_values": [
{
"speed_synonym": [
"stopped",
"speed 0"
],
"lang": "en"
}
]
},
{
"speed_name": "S1",
"speed_values": [
{
"speed_synonym": [
"low",
"speed 1"
],
"lang": "en"
}
]
},
{
"speed_name": "S2",
"speed_values": [
{
"speed_synonym": [
"medium",
"speed 2"
],
"lang": "en"
}
]
},
{
"speed_name": "S3",
"speed_values": [
{
"speed_synonym": [
"high",
"speed 3"
],
"lang": "en"
}
]
}
],
"ordered": true
},
"reversible": false
},
"deviceInfo": {
"manufacturer": "company",
"model": "test"
},
"customData": {
"speedType": 3
}
},
{
"id": "123-Light",
"type": "action.devices.types.LIGHT",
"traits": [
"action.devices.traits.OnOff",
"action.devices.traits.Brightness"
],
"name": {
"defaultNames": [
"Simple Connect Light"
],
"name": "Livingroom Light",
"nicknames": [
"Simple Connect LIGHT"
]
},
"willReportState": true,
"attributes": {
"commandOnlyOnOff": false
},
"deviceInfo": {
"manufacturer": "company",
"model": "test"
}
}
]
}
}
Report State JSON object:
{
"requestId": "11859327534344019896",
"agentUserId": "123456789",
"payload": {
"devices": {
"states": {
“123-Fan": {
"online": true,
"on": false,
"currentFanSpeedSetting": "S3"
},
“123-Light": {
"online": true,
"on": false,
"brightness": 70
}
}
}
}
}
I'm getting the error 404 on the first time Report State after SYNC, which causes Account Linking failed.
These two things should not be directly linked. The account linking flow should succeed if:
Google successfully receives an OAuth access token
Initial SYNC intent is successful
Initial QUERY intent is successful
Whether or not you are able to successfully call Report State should not cause account linking to fail. It would be because of an error in one of the above steps.
Regarding the 404 error itself, this is likely a timing issue. Until the above linking process is complete, the agentUserId and corresponding device IDs are not yet written to Home Graph. If the API call comes in too soon, this would cause a 404 error.
For the account linking process, however, this is not necessary. The initial QUERY intent sent during the above flow accomplishes the same end populating the initial state in Home Graph. Our Report State guide was recently updated to reflect this change:
Following the initial SYNC for a device, the platform sends a QUERY intent that gathers the state of the device to populate Home Graph. After that point, Home Graph only stores the state that is sent with Report State.
You should determine if you can get account linking to succeed without making an initial call to Report State.

Some Modes on action.devices.traits.Modes does not seem to be working

I'm playing around with action.devices.traits.Modes trait, and it seems that I cannot get some Mode to work, though I'm 100% sure that I've used mode names exactly as in the documentation.
SYNC Response:
Response {
"status": 200,
"headers": {
"content-type": "application/json;charset=utf-8"
},
"body": {
"requestId": "15896565509066911859",
"payload": {
"agentUserId": "",
"devices": [
{
"id": "Washer",
"type": "action.devices.types.WASHER",
"traits": [
"action.devices.traits.Modes",
"action.devices.traits.OnOff"
],
"name": {
"defaultNames": [
"Washer"
],
"name": "Washer",
"nicknames": [
"Washer"
]
},
"willReportState": false,
"customData": {
"lookupOnExecute": true
},
"attributes": {
"availableModes": [
{
"name": "temperature",
"name_values": [
{
"name_synonym": [
"temperature"
],
"lang": "en"
}
],
"settings": [
{
"setting_name": "Tap Cold",
"setting_values": [
{
"setting_synonym": [
"tap cold"
],
"lang": "en"
}
]
},
{
"setting_name": "Cold Warm",
"setting_values": [
{
"setting_synonym": [
"cold warm"
],
"lang": "en"
}
]
},
{
"setting_name": "Hot",
"setting_values": [
{
"setting_synonym": [
"hot"
],
"lang": "en"
}
]
},
{
"setting_name": "Extra Hot",
"setting_values": [
{
"setting_synonym": [
"extra hot"
],
"lang": "en"
}
]
}
],
"ordered": false
},
{
"name": "Cycle",
"name_values": [
{
"name_synonym": [
"cycle"
],
"lang": "en"
}
],
"settings": [
{
"setting_name": "Low",
"setting_values": [
{
"setting_synonym": [
"low"
],
"lang": "en"
}
]
},
{
"setting_name": "Medium",
"setting_values": [
{
"setting_synonym": [
"medium"
],
"lang": "en"
}
]
},
{
"setting_name": "High",
"setting_values": [
{
"setting_synonym": [
"high"
],
"lang": "en"
}
]
}
],
"ordered": false
}
]
}
}
]
}
}
}
QUERY response:
Response {
"status": 200,
"headers": {
"content-type": "application/json;charset=utf-8"
},
"body": {
"requestId": "17335788264128789760",
"payload": {
"devices": {
"Washer": {
"online": true,
"currentModeSettings": {
"Cycle": "High",
"temperature": "Tap Cold"
},
"on": true
}
}
}
}
}
Why does Cycle query fail? I see Cycle mode in the documentation. Does it support only some settings? Does the case matter? High is also available, so what am I doing wrong?
And Interaction with Google Home:
While the Google Assistant is highly capable of detecting variations in speech while receiving voice commands, it is still a good practice to make the grammar more understandable and as mentioned in the comments. This is related to an issue in the usage of grammar while triggering the right intent, since a change in the way the question was asked solved the purpose.
For the answer to the question "how can I combine Two toggles (Bluetooth and Power Saving) into one trigger – e.g. "Turn on Power Saving and Bluetooth on Home Cinema?" asked in the comments – at the moment Smart Home doesn't allow two commands in a single prompt. For example, you cannot say "Hey Google, turn on my light and change the color". In order to do that you have to execute each command separately.

Support for ColorSetting trait on non-Light device types

Our hood supports a backlight which supports full RGB color change. The backlight on/off switch was implemented with a trigger, and we implemented the ColorSetting trait to change the color.
When trying to use Google Assistant to change the color however, we get the reply 'It looks like the device hasn't been set up yet'.
We tried changing the device type to 'Light', and the commands to change colors work flawlessly. Is the ColorSetting trait restricted to Light type only, and is there a workaround for this?
Thanks for your help
Edit: SYNC response for hood:
{
"requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
"payload": {
"agentUserId": "userID",
"devices": [
{
"id": "HAID",
"type": "action.devices.types.HOOD",
"traits": [
"action.devices.traits.OnOff",
"action.devices.traits.StartStop",
"action.devices.traits.Modes",
"action.devices.traits.FanSpeed",
"action.devices.traits.Toggles",
"action.devices.traits.ColorSetting"
],
"deviceInfo": {
"manufacturer": "MANUFACTURER",
"model": "MODEL",
"hwVersion": "",
"swVersion": ""
},
"name": {
"name": "Dunstabzugshaube",
"nicknames": [
"Dunstabzugshaube"
],
"defaultNames": [
"Dunstabzugshaube"
]
},
"willReportState": true,
"attributes": {
"pausable": false,
"availableModes": [
{
"name": "program",
"name_values": [
{
"name_synonym": [
"program"
],
"lang": "en"
}
],
"settings": [
{
"setting_name": "Auto",
"setting_values": [
{
"lang": "en",
"setting_synonym": [
"auto",
"automatic"
]
}
]
},
{
"setting_name": "circulation",
"setting_values": [
{
"lang": "en",
"setting_synonym": [
"circulation",
"ventilation",
"airflow",
"air flow"
]
}
]
}
],
"ordered": false
}
],
"availableFanSpeeds": {
"speeds": [
{
"speed_name": "S1",
"speed_values": [
{
"lang": "en",
"speed_synonym": [
"fan stage 1",
"Fan Stage 1",
"lowest",
"one"
]
},
{
"lang": "de",
"speed_synonym": [
"lüfter stufe 1",
"Lüfter Stufe 1",
"minimum",
"eins",
"Stufe 1"
]
}
]
},
{
"speed_name": "S2",
"speed_values": [
{
"lang": "en",
"speed_synonym": [
"fan stage 2",
"Fan Stage 2",
"low",
"two"
]
},
{
"lang": "de",
"speed_synonym": [
"lüfter stufe 2",
"Lüfter Stufe 2",
"niedrig",
"zwei",
"Stufe 2"
]
}
]
},
{
"speed_name": "S3",
"speed_values": [
{
"lang": "en",
"speed_synonym": [
"fan stage 3",
"Fan Stage 3",
"medium",
"three"
]
},
{
"lang": "de",
"speed_synonym": [
"lüfter stufe 3",
"Lüfter Stufe 3",
"mittel",
"drei",
"Stufe 3"
]
}
]
}
],
"ordered": true
},
"reversible": false,
"colorModel": "rgb",
"commandOnlyColorSetting": true,
"availableToggles": [
{
"name": "Light",
"name_values": [
{
"name_synonym": [
"light"
],
"lang": "en"
}
]
},
{
"name": "backlight",
"name_values": [
{
"name_synonym": [
"backlight",
"mood light"
],
"lang": "en"
},
{
"name_synonym": [
"Hintergrundbeleuchtung",
"Stimmungslicht"
],
"lang": "de"
}
]
}
]
}
}
]
}
}
Best,
Frank
Your sync response provided above looks correct. Your concern about the command working flawlessly when you set the device type as LIGHT is because LIGHT does have a recommended trait as ColorSetting. To clarify your concern further, some device types do have better support for certain types of relevant grammar/language, which might explain why ColorSetting works better when the device type is set to light.
Google constantly works on the NLU (Natural Language Understanding) algorithms, so this grammar issue would be resolved by now and the ColorSetting trait should now be widely accessible to more devices.
More information about the HOOD and LIGHT device types and their associated traits along with sync, execute and query responses can be found here:
https://developers.google.com/assistant/smarthome/guides/hood
https://developers.google.com/assistant/smarthome/guides/light

Resources