Google Smart Home can't recognize "action.devices.commands.TimerStart" command - google-smart-home

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.

Related

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
}
}
]
}
]
}
}
}

Google Home App does not show fan speed and temperature settings for AC unit

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.

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.

During Alexa Discovery tower fan not showing up

During Alexa discovery process, we need to send device details and their capabilities. I am sending light and fan details. Light gets showed up in Alexa App but not the fan. Can you please help me to find what I am doing wrong with the following response.
I used this Alexa documentation for creating response. https://developer.amazon.com/docs/smarthome/connect-a-tower-fan-to-alexa.html
{
"event": {
"header": {
"namespace": "Alexa.Discovery",
"name": "Discover.Response",
"payloadVersion": "3",
"messageId": "somd-id"
},
"payload": {
"endpoints": [
{
"endpointId": "fan-i",
"friendlyName": "Fan",
"description": "Fan",
"manufacturerName": "Fan",
"displayCategories": [
"OTHER"
],
"cookie": {},
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [
{
"name": "powerState"
}
],
"proactivelyReported": true,
"retrievable": true
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.RangeController",
"version": "3",
"instance": "speed",
"capabilityResources": {
"friendlyNames": [
{
"#type": "asset",
"value": {
"assetId": "Alexa.Setting.FanSpeed"
}
}
]
},
"properties": {
"supported": [
{
"name": "rangeValue"
}
],
"proactivelyReported": true,
"retrievable": true
},
"configuration": {
"supportedRange": {
"minimumValue": 1,
"maximumValue": 5,
"precision": 1
},
"presets": [
{
"rangeValue": 1,
"presetResources": {
"friendlyNames": [
{
"#type": "asset",
"value": {
"assetId": "Alexa.Value.Minimum"
}
},
{
"#type": "asset",
"value": {
"assetId": "Alexa.Value.Low"
}
}
]
}
},
{
"rangeValue": 5,
"presetResources": {
"friendlyNames": [
{
"#type": "asset",
"value": {
"assetId": "Alexa.Value.Maximum"
}
},
{
"#type": "asset",
"value": {
"assetId": "Alexa.Value.High"
}
}
]
}
},
{
"rangeValue": 3,
"presetResources": {
"friendlyNames": [
{
"#type": "asset",
"value": {
"assetId": "Alexa.Value.Medium"
}
}
]
}
}
]
}
},
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
}
]
},
]
}
}
}
Note: I am just repeating above question below because StackOverflow doesn't allow so much code to be pasted with less description.
During Alexa discovery process, we need to send device details and their capabilities. I am sending light and fan details. Light gets showed up in Alexa App but not the fan. Can you please help me to find what I am doing wrong with the following response.
I think Alexa.RangeController is currently restricted to US region. So if you are trying to discover devices registered to account outside US, then it looks like that Alexa simply ignores the discovery response with RangeController interface. The way I got around this problem is by switching the user account to US and the device appeared immediately. Give it a try and if you a better solution then please do share.

Returning 404 error when asking for userboostrap in microservices

I'm trying to develop microservices on cumulocity.
I'm following this https://cumulocity.com/guides/microservice-sdk/java/.
I'm able to create the application having this response
"availability": "MARKET",
"id": "23",
"key": "TESTMICRO-microservice-key",
"manifest": {
"imports": [],
"noAppSwitcher": true
},
"name": "TESTMICRO",
"owner": {
"self": "my_tenant/tenant/tenants/management",
"tenant": {
"id": "management"
}
},
"requiredRoles": [
"ROLE_INVENTORY_READ"
],
"roles": [
"ROLE_CUSTOM_MICROSERVICE"
],
"self": "my_tenant/application/applications/23",
"type": "MICROSERVICE"
}
Nevertheless when I try the GET URL/application/applications/23/bootstrapUser it returns me 404 Error.
Anyone that can help me?
You probably need to subscribe the application to the tenant:
POST {{url}}/tenant/tenants/{{tenant}}/applications
Body
{
"application": {
"id": "{APPLICATION_ID}"
}
}

Resources