简体   繁体   English

来自 Google Smart Home SDK 的空请求

[英]Empty request from Google Smart Home SDK

I'm creating web server to connect my DIY smart home devices to Google Home app.我正在创建网络服务器以将我的 DIY 智能家居设备连接到 Google Home 应用程序。

After authorisation and token request Google server makes POST request to fullfillment URL, but request is empty for some reason.在授权和令牌请求后,谷歌服务器向 fullfillment URL 发出 POST 请求,但由于某种原因请求为空。 According to documentation, it must be SYNC request, but it does not contain any values, even request ID.根据文档,它必须是 SYNC 请求,但它不包含任何值,甚至请求 ID。

There is error "Couldn't update the setting. Check your Internet connection."出现错误“无法更新设置。请检查您的 Internet 连接。” on my phone after request.请求后在我的手机上。

So why does it happen and how I can fix it?那么为什么会发生这种情况,我该如何解决呢?

const app=smarthome({ debug: true, });

app.onSync( async (body) => {
    return {
        requestId: body.requestId,
        payload: {
            agentUserId: "agentUserId",
            devices                       // devices list
        }
    };
});

server.post("/request", app);

Oh, I forgot to include body-parser 'cause I'm using general web server instead of actions-on-google API.哦,我忘了包含body-parser ,因为我使用的是通用网络服务器而不是actions-on-google API。 LOL哈哈

Case closed.案件结案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 针对 Google Smart Home 错误采取措施的测试套件 - Test Suite for Actions on Google Smart Home Error Alexa 智能家居技能 - 需要帮助才能提出 http 请求 - Alexa Smart Home Skill - Need help to make an http request 当Firebase部署Google Smart Home Codelab操作时发生错误 - Error when `firebase deploy`ing Google Smart Home codelab action 智能家居谷歌操作无响应且设备始终处于离线状态 - Smart home google action not responding and device is always offline 我们可以在dialogflow中从Google Home请求主体解密用户ID吗? - Can we decrypt user id from google home request body in dialogflow? 如何通过谷歌本地首页 sdk 实现 CameraStream 特征 - How to implement CameraStream traits through Google local home sdk 如何为 Google 智能家居操作设置和部署本地执行应用程序? - How do I setup and deploy a local execution app for Google smart home action? “智能家居”物联网WebSocket --> 服务器WebSocket --> 客户端 - “smart home” IOT WebSocket --> Server WebSocket --> Client Alexa 智能家居技能:发现设备的问题 - Alexa smart home skill: problem with discover devices 无法在 googe home 中启用我的智能家居测试应用程序 - Can't enable my smart home test application in googe home
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM