Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
992 views
in Technique[技术] by (71.8m points)

iot - 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. I have a google home device at home which is connected to my account.

I have made the next steps:

  • add otherDevicesIds field to my sync response
  • add device scan configuration (I have chosen UDP )
  • implement UDP server on the device. it listens on 8888 ports and responds to 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). It seems that google assistant does not send UDP broadcast at all. 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? 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. google action UDP confi

question from:https://stackoverflow.com/questions/65907116/google-home-doesnt-send-udp-broadcast-to-my-smart-home-device

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...