跳到主要内容

Overview

Organize RainMaker nodes into groups, manage membership, share access.

备注

The userInstance refers to ESPRMUser from User Sign in.

What This Module Does ?

Groups (ESPRMGroup) let you bundle nodes for homes, rooms, create and update groups, add/remove nodes, share with other users

Use this when your app organizes devices beyond a flat node list (rooms, homes, shared access for family members).

Use Device Management for provisioning and per-node control. You can add a node to a group during provisioning via optional groupId.

Expected outcome: Groups appear in getGroups(), nodes can be managed per group, and sharing requests can be sent or accepted.

Common Workflows

List groups

const response = await userInstance.getGroups({
resultCount: 10,
withNodeList: true,
withSubGroups: true,
});

See Get Groups.

Create a group and add nodes

const group = await userInstance.createGroup({
name: "Living Room Devices",
nodeIds: ["node_id_1", "node_id_2"],
description: "All devices in the living room",
});

See Manage Groups.

Share a group

await userInstance.shareGroups({
username: "family@example.com",
groupIds: [group.id],
});

See Share Groups.

Update group metadata

await group.updateMetadata({ room: "living_room", floor: 1 });

See Group Metadata.

Developer journey

GoalGuide
List or find groupsGet Groups
Create, update, delete, nodes, subgroupsManage Groups
Share, transfer, sharing requestsShare Groups
Custom metadataGroup Metadata

Best Practices

  1. Fetch groups with withNodeList when building room dashboards
  2. Use subgroups for large homes — parent = floor, child = room
  3. Handle sharing requests in UI — sent and received lists
  4. Provision into a group when you know the target group at onboarding time

For complete API details including method signatures, parameters, return types, interfaces, and type definitions, refer to:

  • API Reference:
    • ESPRMUsergetGroups(), createGroup(), shareGroups(), sharing requests
    • ESPRMGroupaddNodes(), updateGroupInfo(), share(), updateMetadata()

On this page