简体   繁体   English

Google Home 不向我的智能家居设备发送 UDP 广播

[英]Google Home doesn't send UDP broadcast to my smart home device

I am trying to develop a smart home action that works with local fulfillment but my device doesn't receive the UDP broadcast request.我正在尝试开发一种适用于本地实现的智能家居操作,但我的设备没有收到 UDP 广播请求。 I have a google home device at home which is connected to my account.我家中有一台连接到我的帐户的 Google Home 设备。

I have made the next steps:我已经做了接下来的步骤:

  • add otherDevicesIds field to my sync response将 otherDevicesIds 字段添加到我的同步响应中
  • add device scan configuration (I have chosen UDP )添加设备扫描配置(我选择了 UDP )
  • implement UDP server on the device.在设备上实现 UDP 服务器。 it listens on 8888 ports and responds to echo -n "test data" | nc -u -b 255.255.255.255 8888它监听 8888 端口并响应echo -n "test data" | nc -u -b 255.255.255.255 8888 echo -n "test data" | nc -u -b 255.255.255.255 8888

Packets from my laptop are received by my DIY smart home device but I don't see any packets from the google home assistant device(it is in the same network as my laptop).我的笔记本电脑的数据包被我的 DIY 智能家居设备接收,但我没有看到来自谷歌家庭助理设备的任何数据包(它与我的笔记本电脑在同一个网络中)。 It seems that google assistant does not send UDP broadcast at all.谷歌助手似乎根本不发送 UDP 广播。 I have added an example of my sync response and a screenshot of Device Scan Configuration for this action.我为此操作添加了我的同步响应示例和设备扫描配置的屏幕截图。 How to make my device receive UDP broadcast?如何让我的设备接收 UDP 广播? Tell me if I have understood the local fulfillment wrong.告诉我我是否理解当地的履行错误。

SYNC response example below下面的同步响应示例

{
"payload": {
    "agentUserId": "fas87df6a8s7d6f",
    "devices": [
      {
        "otherDeviceIds": [
          {
            "agentId": "fasf87da",
            "deviceId": "sdfta87sd6f"
          }
        ],
        "deviceInfo": {
          "model": "LIGHT",
          "manufacturer": "87sd6f87asd",
          "swVersion": "1.0",
          "hwVersion": "LIGHT"
        },
        "customData": {},
        "id": "light-1234112",
        "attributes": {},
        "type": "action.devices.types.LIGHT",
        "name": {
          "defaultNames": [
            "light"
          ],
          "nicknames": [
            "light"
          ],
          "name": "7f6as87fa8"
        },
        "traits": [
          "action.devices.traits.OnOff",
          "action.devices.traits.Brightness"
        ],
        "willReportState": false
      }
    ]
  },
  "requestId": "7298347129347192374"
}

Below is the example of google action UDP config.下面是谷歌操作 UDP 配置的示例。 谷歌行动 UDP 配置

As mentioned in the comments by you, you didn't create a local fulfillment app which is necessary for developing & testing local fulfillment for any of your existing Smart Home Actions.正如您在评论中提到的,您没有创建本地履行应用程序,这是为您现有的任何智能家居操作开发和测试本地履行所必需的。 You can find more information about this at https://developers.google.com/assistant/smarthome/develop/local?hl=en Additionally, make sure that you have added the devices correctly after enabling the test suite.您可以在https://developers.google.com/assistant/smarthome/develop/local?hl=en找到有关此的更多信息此外,请确保在启用测试套件后正确添加了设备。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM