Home Space developer guide

更新时间:
复制 MD 格式

IoT Platform provides the Home Space feature for private-label apps. This feature organizes devices that are bound to an app into spaces, such as homes, rooms, and device groups.

Function overview

The following figure shows the topology of users, spaces, and devices in the Home Space model.

jt13

Device rules for Home Space

When you develop the Home Space service, consider the following rules for binding devices.

CategoryRule description
Device
  • When an end user creates a home for the first time, the app assigns existing devices to the newly created home.
  • A device cannot exist independently of a home. You must pass the homeId when binding a device.
  • A device can be assigned to a room or exist independently of a room, assigned only to a home.
  • Shared devices are user-level data and do not belong to any home. Use the /uc/listBindingByAccount API to get bound devices.
Device groupA device group is a collection of devices under the same product that can be used for group control.
  • The device group feature currently supports only two product categories: lights and sockets.
  • A device group must contain at least 2 devices and at most 100 devices.
  • A device can be added to only one device group.
  • When the property status of a device group is updated, the status of all devices in the group is also updated. However, when the property status of a single device is updated, the status of the device group is not updated.

    The API to update the status of a device group is /living/controlgroup/properties/set.

  • The property status of a device group can be inconsistent with the property status of a single device within the group.

    The API to get the status of a device group is /living/controlgroup/properties/get.

API call limits

IoT Platform provides a set of APIs for the Home Space service. Some existing APIs have been upgraded to support Home Space features, as shown in the following table.

ServiceAPI pathVersion that supports Home Space serviceVersion that does not support Home Space service
Provisioning Service/awss/token/user/bind1.0.8 and later1.0.7 and earlier
Provisioning Service/awss/time/window/user/bind1.0.8 and later1.0.7 and earlier
Provisioning Service/uc/scanBindByShareQrCode1.0.7 and later1.0.6 and earlier
Provisioning Service/awss/enrollee/user/bind1.0.3 and later1.0.2 and earlier
Network Provisioning Service/awss/ble/user/bind1.0.3 and later1.0.2 and earlier
Network Provisioning Service/awss/gprs/user/bind1.0.3 and later1.0.2 and earlier
Provisioning Service/awss/subdevice/bind1.0.3 and later1.0.2 and earlier
Scene Service/living/scene/create1.0.1 and later1.0.0
Scene Service/scene/create1.0.6 and later1.0.5 and earlier
Scene Service/scene/info/get1.0.6 and later1.0.5 and earlier