'Can I bound one same device (same id) with two different account(two different agentuserID)?

I'm developing an Action on Google and I have a question about agentUserID. In documentation I see this information to reportstate command:

{
  "requestId": "123ABC",
  "agentUserId": "user-123",
  "payload": {
    "devices": {
      "states": {
        "light-123": {
          "on": true
        }
      }
    }
  }
}

In this reportstate command there is the agentUserId.

1 - Can I to bound the same device with two agentUserId(i.e. two accounts)?

2 - If the anwser of question 1 one is yes, Should I send two reportstate command for Home Graph, one with agentUserID-1 and other with agentUserID-2?



Solution 1:[1]

As it is defined in the reference documentation, the agentUserId:

Reflects the unique (and immutable) user ID on the agent's platform. The string is opaque to Google, so if there's an immutable form vs a mutable form on the agent side, use the immutable form (e.g. an account number rather than email).

On your end, you can bind the same device to two separate user accounts and agentUserIds, although from the perspective of the platform they will be internally viewed as two separate devices.

So if you have one light and two accounts, you can still handle execution commands for both by mapping devices to a single entity on your side and it will work without issue.

But yes it does mean you will need to report two separate states to update both devices from the perspective of the Home Graph.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nick Felker