Reputation: 11
Developing fan trait for Google Actions, query for the status of the fan always returns fail. Here is my step:
Sync
{
"id": "d25dde36-76cb-44aa-a649-b1f61bb3bebb",
"type": "action.devices.types.FAN",
"traits": ["action.devices.traits.OnOff", "action.devices.traits.FanSpeed"],
"name": {
"name": "living room fan"
},
"willReportState": false,
"attributes": {
"availableFanSpeeds": {
"ordered": true,
"speeds": [{
"speed_name": "low",
"speed_values": [{
"lang": "en",
"speed_synonym": ["low"]
}]
}, {
"speed_name": "medium",
"speed_values": [{
"lang": "en",
"speed_synonym": ["medium"]
}]
}, {
"speed_name": "high",
"speed_values": [{
"lang": "en",
"speed_synonym": ["high"]
}]
}]
}
},
"deviceInfo": {
"manufacturer": "XYZ"
},
"customData": {
"serialID": "001D10010334",
"type": "resource"
}
}
Query
{"inputs":[{"intent":"action.devices.QUERY","payload":{"devices":[{"customData":{"serialID":"001D10010334","type":"resource"},"id":"d25dde36-76cb-44aa-a649-b1f61bb3bebb"}]}}],"requestId":"16727804366400067692"}
Skill response
{"requestId":"16727804366400067692","payload":{"devices":{"d25dde36-76cb-44aa-a649-b1f61bb3bebb":{"online":true,"currentFanSpeedSetting":"medium","on":true}}}}
Google home speaker
Sorry, I am unable to reach the living room fan right now. Please try again.
Although the message returned back is compatible with the doc https://developers.google.com/actions/smarthome/traits/fanspeed#device-states, why the speaker doesn't return the "correct" message.
Thought the query for Fan OnOff is ok.
Any ideas?
Thanks.
Upvotes: 1
Views: 449
Reputation: 447
reversible trait is mandatory. If attributes are incomplete, the trait is not active.
If 'reversible' trait set to true, this device supports blowing the fan in both directions and can accept the command to reverse fan direction.
Upvotes: 2