Updated on 2024-12-02 GMT+08:00

Gateway Updating Child Device Status

Function

The gateway updates the child device status and notifies the gateway of the update result through the API for responding to a request for updating child device statuses. For details about the relationship between a gateway and its child devices, see Gateway and Child Devices.

  • The TPS is limited to 1.5 times of the established concurrent connections of directly connected devices. That is, the maximum number of connections established by a single instance per second is 100 x Number of purchased units x 1.5.
  • The TPS of this API called at a time is 1 multiplied by the number of reported child devices.

Topic

Upstream: $oc/devices/{device_id}/sys/events/up

Parameters

Parameter

Mandatory/Optional

Type

Description

object_device_id

Optional

String

Explanation:

This parameter is not in use currently and does not need to be set.

services

Optional

List<EventService>

Explanation:

List of services that an event is about.

EventService structure

Parameter

Mandatory/Optional

Type

Description

service_id

Mandatory

String

Explanation:

System field. The value is fixed to $sub_device_manager.

event_type

Mandatory

String

Explanation:

System field. The value is fixed to sub_device_update_status.

event_time

Optional

String

Explanation:

Event time. UTC time format: yyyyMMdd'T'HHmmss'Z'.

If this parameter is not carried in the reported data or is in incorrect format, the time when the platform receives the data is used.

event_id

Optional

String

Explanation:

Uniquely identifies an event. If this parameter is not carried, an event ID will be generated by the platform. An event ID is a random string of 36 characters consisting of letters, numbers, and hyphens (-).

paras

Mandatory

Object

Explanation:

Event parameters in JSON format.

paras structure

Parameter

Mandatory/Optional

Type

Description

device_statuses

Mandatory

List<DeviceStatus>

Explanation:

Device status list. The list can contain status information of 1 to 100 devices.

DeviceStatus structure

Parameter

Mandatory/Optional

Type

Description

device_id

Mandatory

String

Explanation:

Child device ID.

status

Mandatory

String

Explanation:

Indicates the child device status.

Value range:

  • OFFLINE: The device is offline.
  • ONLINE: The device is online.

Example

Topic: $oc/devices/{device_id}/sys/events/up
Data format:
{
        "object_device_id": "{object_device_id}",
	"services": [{
		"service_id": "$sub_device_manager",
		"event_type": "sub_device_update_status",
		"event_time": "20151212T121212Z",
		"paras": {
			"device_statuses": [{
					"device_id": "bf40f0c4-4022-41c6-a201-c5133122054a",
					"status": "ONLINE"
				},
				{
					"device_id": "4459c0f7-10bb-4718-9b07-7a82c2d508a5",
					"status": "ONLINE"
				}
			]
		}
	}]
}