TemperatureSetting "What's the temperature in my living room ?" sometimes answers weird stuff - actions-on-google

I recently released a Smart Home action for interacting with our thermostats. This device type is Thermostat and the single implemented trait is TemperatureSetting.
When I ask my home assistant "What's the temperature in the living room ?", sometimes it answers good, sometimes it answers "Ok, this device has been updated" (this is a translation from my language so it may not be the accurate answer).
Checking the logs on my server, I can see the QUERY intent responses being made.
The following QUERY response provokes a "The temperature in your living room is 20.5 degrees" answer:
{
"aa0c2504f896": {
"status": "SUCCESS",
"online": true,
"thermostatMode": "heat",
"thermostatTemperatureAmbient": 20.7,
"thermostatTemperatureSetpoint": 20.5
}
}
This one provokes "Ok, this device has been updated" :
{
"aa0c2504f896": {
"status": "SUCCESS",
"online": true,
"thermostatMode": "heat",
"thermostatTemperatureAmbient": 20.7,
"thermostatTemperatureSetpoint": 19.5
}
}
I can reproduce it by changing the setpoint 1° lower, as shown by the previous logs. When doing so, the EXECUTE intent sends a ReportState request, so the HomeGraph API is updated synchronously.
Am I doing something wrong ?
Edit:
It happens every time the setpoint and the ambient temperature are different (in a 0.5 degrees interval). The Google Home UI always renders it correctly, it is the voice control that answers something wrong.
Here is also my SYNC payload :
{
"requestId": "5878230358273544341",
"payload": {
"agentUserId": "3101066d-b012-4780-8d77-7297aaea4e37",
"devices": [
{
"id": "aa0c2504f896",
"type": "action.devices.types.THERMOSTAT",
"traits": [
"action.devices.traits.TemperatureSetting"
],
"name": {
"defaultNames": [
"Thermostat COMAP"
],
"name": "Thermostat salon"
},
"willReportState": true,
"attributes": {
"availableThermostatModes": [
"heat",
"on"
],
"thermostatTemperatureRange": {
"minThresholdCelsius": 4,
"maxThresholdCelsius": 30
},
"thermostatTemperatureUnit": "C"
},
"deviceInfo": {
"manufacturer": "COMAP",
"model": "Thermostat",
"swVersion": "1143"
}
}
]
}
}

The query and sync payload provided by you looks good. We have updated the thermostat implementation throughout the last year and it works much better with floating points. If this issue still persists, I recommend creating a ticket on the public issue tracker.
There can also be one more reason as to why you have been encountering this issue. It might be also due to the local language, there can be a possibility that the Google Assistant hasn’t still incorporated the full compatibility for this particular language. Our NLU team is constantly working on incorporating these language capabilities into the system.

Related

Purchase event has been uploaded via Offline Conversions API, but the Event Set does not show any data

I followed the guide here: https://developers.facebook.com/docs/marketing-api/offline-conversions
Unlike "regular" Event Sets, which includes a "Test Events" tab in its dashboard, offline event sets don't seem to have this feature. You must either upload a CSV or call the API.
However, the offline event set shows no data coming from the API at all; the history tab only shows the CSV uploads, which were "last received 10 days ago". It doesn't even include the test upload I made today.
Is this a bug? How long should I wait for the data to appear in the events manager for my offline event?
Sample call
POST https://graph.facebook.com/v15.0/<offline_event_set_id>/events?access_token=<system_user_access_token>
{
"upload_tag": "store_data",
"data": [
{
"match_keys": {
"em": "<hashed>",
"ph": "<hashed>"
},
"currency": "PHP",
"value": 100,
"event_id": "test",
"event_name": "Purchase",
"event_time": "1669633380",
"custom_data": {
"event_source": "in_store"
},
"action_source": "physical_store",
"order_id": "test",
"data_processing_options": []
}
]
}
The response is as follows:
{"id":"<offline_event_set_id>","num_processed_entries":1}
Which seems to indicate that the event was uploaded successfully. But that event never shows up in the Overview tab of that offline event set.
Would appreciate any insights/guides elsewhere/answers, I've spent a few days on this with no success.
The "error": I was encoding the event_time as a string, whereas Facebook expects this value to be an integer. After updating my POST body to correct that, the events started showing up within minutes in the Overview tab.
{
"upload_tag": "store_data",
"data": [
{
"match_keys": {
"em": "<hashed>",
"ph": "<hashed>"
},
"currency": "PHP",
"value": 100,
"event_id": "test",
"event_name": "Purchase",
"event_time": 1669633380, // <-- The only change was removing the quotes
"custom_data": {
"event_source": "in_store"
},
"action_source": "physical_store",
"order_id": "test",
"data_processing_options": []
}
]
}
I really wish Facebook had returned some kind of error or warning, but at least I found the issue. Be careful with your data types, people!

TemperatureControl trait confusion

I have just started with Google Actions. The first trait we want to support is the temperature reading from my device. It's not a thermostat so we'll need to use TemperatureControl trait (readonly-sensor, no control) .
The issue is that after implementing TemperatureControl, I can't request Google Assistant to read out the temperature. Has anyone encountered similar issue? I have search the topic on TemperatureControl, seems there was none similar issue reported. Thanks in advance.
The more detail flow is:
ask "What's the temperature in Bedroom?"
I receive a QUERY intent in my backend server and responded with Ambient Temperature
but, the answer is "Sorry I can't reach the bedroom right now. Please try again"
After that, I tried to add HumiditySetting Trait to verify my SYNC/ QUERY validity.
This is working.
ask "What's the Humidity level in Bedroom?"
I receive a QUERY intent in my backend server and responded with Ambient Humidity. Actually it's the same response as in the case of Temperature.
but, the answer is "the bedroom has a current humidity reading of xx%"
My SYNC Response is validated with https://developers.google.com/assistant/smarthome/tools/validator
Below is a sample:
{
"requestId": "10692316150281033205",
"payload": {
"agentUserId": "1-5671",
"devices": [
{
"id": "3466",
"type": "action.devices.types.CAMERA",
"traits"[
"action.devices.traits.HumiditySetting",
"action.devices.traits.TemperatureControl"
],
"name": {
"defaultNames": [
"bedroom"
],
"name": "bedroom",
"nicknames": [
"bedroom"
]
},
"willReportState": true,
"roomHint": null,
"deviceInfo": null,
"otherDeviceIds": null,
"customData": {
"deviceId": "CQAMNGF"
},
"attributes": {
"temperatureUnitForUX": "C",
"queryOnlyHumiditySetting": true,
"queryOnlyTemperatureControl": true
}
}
],
"errorCode": null
}
}
I found the issue.
I was using thermostatTemperatureSetpoint and thermostatTemperatureAmbient in Query response.
After changing them back to temperatureSetpointCelsius
temperatureAmbientCelsius, it works.

How to use roomHint and structureHint with smarthome actions on Google

We are currently setting un a Smarthome action, and we would like to provide roomHint on the first sync (not on request sync) as it's really tedious to set up rooms on the first sync, but it does not work.
We tried to name rooms in english and also in italian, (as it's not really clear from the documentation if there is a list on room names that we can use?) but no way.
So can you please give us a hint how to use the roomHint field?
Also in the API doc we've found structureHint, does it work? The documentation for SYNC intent does not mention this field.
Here is our SYNC intent with one device and room, we took office from the example JSON:
{
"requestId": "3582198904737125163",
"payload": {
"agentUserId": "xyz#qwertyz.com",
"devices": [
{
"id": "deviceID",
"type": "action.devices.types.LIGHT",
"traits": [
"action.devices.traits.OnOff"
],
"name": {
"name": "Lampadina",
"defaultNames": [
"Lampadina_XYZ"
],
"nicknames": [
"Lampadina"
]
},
"willReportState": false,
"customData": {
"modelType": "DEVICE"
},
"roomHint": "office"
}
]
}
}
Thanks
Unfortunately, I believe the structureHint is only in the HomeGraph API sync response.
It cannot be used in the Sync intent.
If someone can tell me I'm wrong and how to use it, you'd be a hero.

Continue a conversation after Browsing carousel in DialogFlow/Actions

So I have been experimenting with different Response types for DialogFlow through Actions: Actions Responses and Webhook/Fulfillment.
And so far, I have been able to generate proper responses for types like List, Basic Card, Suggestion Chips successfully. What I need now is a list-based response that lets the user open a link in a browser when touched as well as "not" generate a chat bubble. "Browsing carousel" fits the criteria: Browsing Carousel.
I have successfully created and simulated the output with 2 sample items. The issue is when the user wants to continue the conversation. As per the Guidance section in the help above, the browsing carousel:
By default, the mic remains closed after a browse carousel is sent. If you want to continue the conversation afterwards, we strongly recommend adding suggestion chips below the carousel.
From this what I understood is that the user has to invoke the App again by saying "Ok Google, talk to [app]". This doesn't seem very user-friendly as the user expects to return back to the conversation she was having with the agent after she has looked through the links from the carousel. Please note, I have simulated the flow using the Google Actions Simulator on Console.Actions page.
As soon as I invoke the intent with the Browsing Carousel, it is shown to me with the sample Items. But when I enter/say the next command to continue the conversation, the agent simply returns with:
We're sorry, but something went wrong. Please try again.
And the REQUEST/REQUEST window as well as the ERRORS/DEBUG are empty. I have logged calls to the Webhook and there is no call received.
The question: Is there a way to give the user the ability to browse an informative link from a response "list" (not Basic Card) and return to the conversation without ending it.
Here is the response for Browsing Carousel from RESPONSE window in Actions > Simulator (note I've removed non-relevant parts):
{
"conversationToken": "[token info]",
"expectUserResponse": true,
"expectedInputs": [
{
"inputPrompt": {
"richInitialPrompt": {
"items": [
{
"simpleResponse": {
"textToSpeech": "You have the following 2 options:",
"displayText": "You have the following 2 options:"
}
},
{
"carouselBrowse": {
"items": [
{
"title": "Test 1",
"description": "Desc 2",
"image": {
"url": "[some url]"
},
"openUrlAction": {
"url": "[some url]"
}
},
{
"title": "Test 2",
"description": "Desc 2",
"image": {
"url": "[some url]"
},
"openUrlAction": {
"url": "[some url]"
}
}
]
}
}
],
"suggestions": [
{
"title": "Continue"
},
{
"title": "End"
}
]
}
}
}
],
"responseMetadata": {
"status": {
"message": "Success (200)"
},
"queryMatchInfo": {
"queryMatched": true
}
}
}
For all those who are using the Simulator to test the Browsing Carousel and seeing that it stops responding after the output, please use a device instead to test it. When you use a device to render the output and use the Carousel response, it doesn't kill the conversation but turns off the mic. This is the intended behavior. One can introduce Suggestion chips to assist the user to continue the conversation.
Updated: Also make sure each Webhook Intent call has a proper response with Simple Response. As long as the response has required textual and audio information correctly setup, the Simulator will not fail.

Actions on Google Smart Home Skill: Room Hint / Home Graph

The documentation at https://developers.google.com/actions/smarthome/create-app#actiondevicessync mentions that the roomHint field of the JSON response to the sync request can be used to have Google automatically assign devices to correct rooms.
However, no matter what I return in that field, the user still has to manually assign every device to a room and I cannot get Google to automatically recognize the correct room using this roomHint field
Here's an example response:
{
"requestId": "500166151965294748",
"payload": {
"devices": [
{
"id": "9",
"type": "action.devices.types.LIGHT",
"traits": [
"action.devices.traits.OnOff"
],
"name": {
"name": "Light"
},
"willReportState": false,
"roomHint": "Attic"
}
]
}
}
Right now supplying a value for the roomHint is not used by the HomeGraph to determine which room this device is in.