0

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

fdistorted
  • 343
  • 3
  • 15
  • is your `agentId` corresponding to your project id? Note that usually, you don't need to return that field as it can be inferred from your project by the platform. – proppy Feb 02 '21 at 01:59
  • @proppy yes, that's right. It is a project id. I have added it later when tried to resolve this issue. I have tried without it too. Do you have any other suggestions what can be wrong? – fdistorted Feb 02 '21 at 11:11
  • did you complete the flow to add devices to your home after enabling the test agent? https://developers.google.com/assistant/smarthome/develop/testing#run-tests – proppy Feb 02 '21 at 15:03
  • I have fixed it. I thought that it should send UDP even without a local app so I didn't build it. I have implemented it and it started to send requests to my devices. – fdistorted Feb 03 '21 at 10:45

1 Answers1

0

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.

Anish Yadav
  • 141
  • 4