Updated on 2025-08-19 GMT+08:00

IoT Device Access (IoTDA) Trigger

This section describes how to create an IoTDA trigger on the FunctionGraph console.

For details about the IoTDA event source, see Supported Event Sources.

Notes and Constraints

IoTDA triggers are available only in CN North-Beijing4, CN-Hong Kong, and AP-Bangkok. You can check whether the trigger type is supported on the console.

Prerequisites

Creating an IoTDA Trigger

  1. Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click the function to be configured to go to the function details page.
  3. Choose Configuration > Triggers and click Create Trigger.
  4. Configure the following parameters.

    • Trigger Type: Select IoT Device Access (IoTDA).
    • Instance: Select the created IoTDA instance.
    • Data Source, Trigger, and Resource Space: For details, see Table 1.
      Table 1 Configuration

      Data Source

      Trigger

      Resource Space

      Device

      Device added, Device deleted, Device updated

      Select a resource space. Multiple resource spaces can be created and one of them is specified as the default resource space. Each account has only one default resource space, which cannot be deleted.

      Device property

      Device property reported

      Device message

      Device message reported

      Device message status

      Device message status changed

      Device status

      Device status changed

      Product

      Product added, Product deleted, and Product updated

      Asynchronous command status of the device

      Batch task status changed

      Run log

      Log reported

      Batch task

      Batch task status changed

  5. Click OK.

Triggering the Function

  1. Return to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click the name of the function to be configured. The function details page is displayed.
  3. On the function details page, select a version.
  4. On the Code tab page, click Test. The Configure Test Event dialog box is displayed.
  5. Set the parameters listed in Table 2 and click Create.

    Table 2 Test event information

    Parameter

    Description

    Configure Test Event

    You can choose to create a test event (default) or edit an existing one.

    Event Templates

    Select Blank Template.

    Event Name

    The event name can contain 1 to 25 characters and must start with a letter and end with a letter or digit. Only letters, digits, underscores (_), and hyphens (-) are allowed. For example, iotda-123test.

    Event data

    {
    	"resource" : "device",
    	"event" : "create",
    	"event_time" : "20240919T011335Z",
    	"event_time_ms" : "2024-09-19T01:13:35.854Z",
    	"request_id" : "75127474-1a26-4578-8847-3128d6101954",
    	"notify_data" : {
    		"body" : {
    			"app_id" : "3d40caf3ddfc4e83815b54b50f13aad7",
    			"app_name" : "DefaultApp_6439vdv2",
    			"device_id" : "66eb7a0ffa8d9c36870c6892_ttytytytytytyt",
    			"node_id" : "ttytytytytytyt",
    			"gateway_id" : "66eb7a0ffa8d9c36870c6892_ttytytytytytyt",
    			"node_type" : "GATEWAY",
    			"auth_info" : {
    				"auth_type" : "SECRET",
    				"secure_access" : false,
    				"timeout" : 0
    			},
    			"product_id" : "66eb7a0ffa8d9c36870c6892",
    			"product_name" : "test",
    			"status" : "INACTIVE",
    			"create_time" : "20240919T011335Z"
    		}
    	}
    }

  6. Click Test. The function test result is displayed.

Helpful Links

Manage function triggers through APIs. For details, see Function Trigger APIs.