Open Capabilities of Perimeter Devices

Last Updated on : 2024-06-13 10:48:20download

This topic describes how to integrate with open capabilities of perimeter devices.

Data points of perimeter devices

For more information about data points, see Modify Data Point.

DP code Description
tyabix5h84 Bypass and restore
tyabi33xhy Arm and disarm
tyabi8wxut Mute a host group

API description

Arm/disarm perimeter host

API name API endpoint
Arm/Disarm Host POST: /v1.0/intrusion/{device_id}/actions/chan-action

Bypass/restore perimeter host

API name API endpoint
Bypass/Restore POST: /v1.0/intrusion/{device_id}/actions/by-pass

Mute perimeter host group

API name API endpoint
Mute Host Group POST: /v1.0/intrusion/{device_id}/actions/group-silence

Perimeter event format

After you subscribe to the message service for a cloud development project, you will receive event messages from the linked perimeter devices. For more information about the integration with a message queue, see Message Queue.

Report alarms

API description

When a person enters or leaves a specified defense zone, the perimeter device will be triggered and an alarm will be reported.

Description of value

Parameter Type Description Required
alarmType Integer The type of an alarm. Valid values:
  • 1: alarm
  • 2: restore
Yes
content Integer The content of an alarm. Yes

Example

{
    "dataId":"assist_ogFzb****",
    "devId":"6c98fbf2ce1bd****",
    "productKey":"h83ee7rlx****",
    "status":[
        {
            "code":"",
            "4":"{\"alarmType\":1,\"content\":\"Alarm\"}",
            "t":1654163382790,
            "value":"{\"alarmType\":1,\"content\":\"Alarm\"}"
        }
    ]
}

Report bypassing/restoring events

API description

Report the result of bypassing or restoring a perimeter device.

  • Bypassing is a separate operation for one or several specific devices in the zone. The bypassed devices in the area will not send an alarm.
  • Restoring means that a device in the zone changes from the bypassed status to the normal status.

Description of value

Parameter Type Description Required
value Boolean The status of being bypassed or restored. Valid values:
  • true: bypassed
  • false: restored
Yes

Example

{
    "dataId":"assist_U34****",
    "devId":"6c98fbf2ce1b****",
    "productKey":"h83ee7rlx****",
    "status":[
        {
            "code":"",
            "t":1654163570561,
            "5":"{\"value\":true}",
            "value":"{\"value\":true}"
        }
    ]
}

Arm/disarm a perimeter host

API description

Report the result of arming or disarming a perimeter host device.

  • Arming makes the alarm system in the normal alarm mode. When the alarm device and the defense zone work properly, the user can receive the alarms in real time, if any.
  • Disarming makes the alarm system in the non-alarm mode. Even if the alarm device and defense zone can generate an alarm, the alarm information will not be uploaded to the alarm system, and the user cannot receive the alarm.

Description of value

Parameter Type Description Required
areaId Long The ID of a specified area. Yes
armed Boolean The arming or disarming status. Valid values:
  • true: arming status
  • false: disarming status
Yes

Example

{
    "dataId":"assist_Ac****",
    "devId":"6c98fbf2ce1bd****",
    "productKey":"h83ee7rl****",
    "status":[
        {
            "code":"",
            "t":1654163729548,
            "9":"{\"areaId\":1524295988****,\"armed\":true}",
            "value":"{\"areaId\":1524295988****,\"armed\":true}"
        }
    ]
}

Mute a perimeter host group

API description

Report the result of muting a perimeter host device after an alarm is sent.

Description of value

Parameter Type Description Required
areaId Long The ID of a specified area. Yes

Example

{
    "dataId":"assist_wznI****",
    "devId":"6c98fbf2ce1bd****",
    "productKey":"h83ee7rlx****",
    "status":[
        {
            "code":"",
            "t":1654163916979,
            "value":"{\"areaId\":1524295988****}",
            "10":"{\"areaId\":1524295988****}"
        }
    ]
}

Perimeter event format v1.0

Device event messages are compatible with v1.0 format. If you want to subscribe to the v1.0 format, please contact Tuya’s staff. For more information about the integration process, see Device event format v1.0.

Report alarms

API description

When a person enters or leaves a specified defense zone, the perimeter device will be triggered and an alarm will be reported.

Parameters

Parameter name Data type Description Required
bizCode String The business code of a specified event. Default value: edge_device. Yes
eventType String The type of a specified event. Default value: edge_report_data. Yes
mode String The mode of a specified event. Default value: intrusion-device-alarm. Yes
deviceId String The ID of a specified Tuya device. Yes
alarmType Integer The alert type.
  • 1: alarm
  • 2: restore
Yes
content String The content of a specified alert. Yes

Example

{
    "data": "{\"mode\":\"intrusion-device-alarm\",\"data\":\"{\\\"alarmType\\\":1,\\\"content\\\":\\\"Alarm\\\",\\\"deviceId\\\":\\\"6ce881191dc89*****\\\"}\"}",
    "bizCode": "edge_device",
    "eventType": "edge_report_data"
}

Report bypassing/restoring events

API description

Report the result of bypassing or restoring a perimeter device.

  • Bypassing is a separate operation for one or several specific devices in an area. The bypassed devices in the area will not trigger an alarm.
  • Restoring means that a device in an area changes from the bypassed status to the normal status.

Parameters

Parameter name Data type Description Required
bizCode String The business code of a specified event. Default value: edge_device. Yes
eventType String The type of a specified event. Default value: edge_report_data. Yes
mode String The mode of a specified event. Default value: intrusion-by-pass. Yes
deviceId String The ID of a specified Tuya device. Yes
value Boolean The status of being bypassed or restored. Valid values:
  • true: bypassed
  • false: restored
Yes

Example

{
    "data": "{\"mode\":\"intrusion-by-pass\",\"data\":\"{\\\"deviceId\\\":\\\"6ce881191dc8*****\\\",\\\"value\\\":false}\"}",
    "bizCode": "edge_device",
    "eventType": "edge_report_data"
}

Arm/disarm a perimeter host

API description

Report the result of arming or disarming a perimeter host device.

  • Arming makes the alarm system stay in a normal alarm mode. When the alarm device and the defense zone work properly, the specified user can receive the alarms in real time, if any.
  • Disarming makes the alarm system stay in a non-alarm mode. Even if the alarm device and defense zone can generate an alarm, the alarm information will not be uploaded to the alarm system, and the user cannot receive the alarm.

Parameters

Parameter name Data type Description Required
bizCode String The business code of a specified event. Default value: edge_device. Yes
eventType String The type of a specified event. Default value: edge_report_data. Yes
mode String The mode of a specified event. Default value: intrusion-host-chan-action. Yes
deviceId String The ID of a specified Tuya device. Yes
areaId Long The ID of a specified area. Yes
armed Boolean The arming or disarming status. Valid values:
  • true: arming status
  • false: disarming status
Yes

Example

{
    "data": "{\"mode\":\"intrusion-host-chan-action\",\"data\":\"{\\\"areaId\\\":15242959887*****,\\\"armed\\\":true,\\\"deviceId\\\":\\\"6cf7eb0a3a55d*****\\\"}\"}",
    "bizCode": "edge_device",
    "eventType": "edge_report_data"
}

Mute a perimeter host group

API description

Report the result of muting a perimeter host device after an alarm is sent.

Parameters

Parameter name Data type Description Required
bizCode String The business code of a specified event. Default value: edge_device. Yes
eventType String The type of a specified event. Default value: edge_report_data. Yes
mode String The mode of a specified event. Default value: intrusion-host-chan-action. Yes
deviceId String The ID of a specified Tuya device. Yes
areaId Long The ID of a specified area. Yes

Example

{
    "data": "{\"mode\":\"intrusion-host-group-silence\",\"data\":\"{\\\"areaId\\\":15242959887*****,\\\"deviceId\\\":\\\"6cf7eb0a3a55db*****\\\"}\"}",
    "bizCode": "edge_device",
    "eventType": "edge_report_data"
}