You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否从Fulfillment Service中获取已配置的Google Smart Home房间/位置信息?

Google Smart Home: Retrieving User-Assigned Room/Location Data in Fulfillment

Great question! I’ve built several Google Smart Home integrations, so I can confirm this is totally possible—here’s how it works:

  • You’ll get room context in action.devices.EXECUTE requests
    When a user issues a room-targeted command like "Turn off all devices in my office", Google includes the room/location details directly in the EXECUTE request payload. Look for the context object, which contains a location field with the user-configured room name.

    Here’s a simplified example of what that payload might look like:

    {
      "requestId": "abc123",
      "inputs": [
        {
          "intent": "action.devices.EXECUTE",
          "payload": {
            "commands": [
              {
                "devices": [{"id": "my-office-lamp-01"}],
                "execution": [{"command": "action.devices.commands.OnOff", "params": {"on": false}}]
              }
            ]
          },
          "context": {
            "location": {
              "name": "Office",
              "roomHint": "Office"
            }
          }
        }
      ]
    }
    

    The roomHint field is your go-to here—it’s the exact room name the user set up in their Google Home app.

  • SYNC requests don’t include user-assigned rooms (but you can pre-set defaults)
    The action.devices.SYNC intent is only for listing your available devices to Google. While you can add a roomHint attribute to your device objects in the SYNC response to suggest a default room, users can override this in the app. To get the actual room the user chose, always rely on the EXECUTE request context.

  • A few quick tips

    • Room names are user-defined, so they might be inconsistent (e.g., "Office", "Home Office", "Work Nook")—build flexible string matching into your fulfillment logic if you need to map rooms to internal systems.
    • If you want to persist room associations for devices, cache the roomHint value from EXECUTE requests linked to each device ID.

内容的提问来源于stack exchange,提问作者Andrew Eers

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 07:24:39