[英]Visual interface for TemperatureControl trait, google device actions
[英]TemperatureControl trait confusion
我刚刚开始使用 Google Actions。 我们要支持的第一个特征是从我的设备读取温度。 它不是恒温器,所以我们需要使用 TemperatureControl trait (readonly-sensor, no control) 。
问题是,在实施温度控制后,我无法请求 Google 助理读取温度。 有没有人遇到过类似的问题? 我在温度控制上搜索了这个话题,似乎没有报告类似的问题。 提前致谢。
更详细的流程是:
问“卧室的温度是多少?”
我在后端服务器中收到一个 QUERY 意图并以环境温度作为响应
但是,答案是“对不起,我现在无法到达卧室。请再试一次”
之后,我尝试添加 HumiditySetting Trait 来验证我的 SYNC/QUERY 有效性。 这是有效的。
问“卧室的湿度是多少?”
我在后端服务器中收到一个 QUERY 意图并以环境湿度进行响应。 实际上,它的响应与温度的情况相同。
但是,答案是“卧室的当前湿度读数为 xx%”
我的 SYNC 响应已通过https://developers.google.com/assistant/smarthome/tools/validator验证 下面是一个示例:
{
"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
}
}
我发现了这个问题。
我在查询响应中使用了 thermostatTemperatureSetpoint 和 thermostatTemperatureAmbient。
将它们改回 temperatureSetpointCelsius temperatureAmbientCelsius 后,它就可以工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.