Google 智能家居操作成功完成后响应“[服务] 现在不可用”

Google Smart Home action responds "[Service] is not available right now" after the action completed succesfully

我的 Google SmartHome 操作在正确执行命令后给出错误消息“[Service] cannot be reached right now”。我的设备已正确打开/关闭,但 Google 以那条烦人的消息结束。

我从 Google 获得的输入:


{"inputs":[{"context":{"locale_country":"NL","locale_language":"nl"},"intent":"action.devices.EXECUTE","payload":{"commands":[{"devices":[{"id":"6"}],"execution":[{"command":"action.devices.commands.OnOff","params":{"on":true}}]}]}}],"requestId":"1389468583286354563"}

我回复的回复:


{"requestId":"1389468583286354563","payload":{"commands":[{"ids":["6"],"status":"SUCCESS","states":{"on":true,"online":true}}]}}

函数执行耗时 2287 毫秒,完成状态码:200


接下来,我已经(异步)报告状态:


{"requestId":"1389468583286354563","agentUserId":"f0524769-7ffb-4ae4-8cec-5d67e6f6aa92","payload":{"devices":{"states":{"6":{"on":true,"online":true}}}}}

报告状态API返回成功。

我不知道为什么 Google 返回(即使操作已成功执行)他们无法访问我们的服务?

感谢@Devunwired:我忽略了 Google Assistant Action 日志。在其中,它说函数是 returning 一个空的 JSON 响应。原来是return语句过早加了1个括号,导致async函数return为空值