A Thing Specification Language (TSL) model is a data model that is defined for a product in IoT Platform. A TSL model is used to describe the features of a product. This article describes the concepts and limits of a TSL model.
A TSL model digitizes a physical entity in the cloud, such as a sensor, vehicle-mounted device, building, or factory. A TSL model includes the properties, services, and events of an entity. A TSL model describes what the entity is, what the entity can do, and what information the entity can provide. You can define the TSL features of a product from the dimensions of properties, services, and events.
|Property||Defines the capabilities of devices that can be read and set. Properties are used to describe a type of data that devices can collect, such as the temperature data that is collected by an environmental sensor. Properties support the GET and SET request methods. Applications can send requests to retrieve and set properties.|
|Service||Defines the capabilities or methods of devices that can be called by applications. You can configure input and output parameters. Services also define the features that can be used by IoT Platform. Compared with properties, services can be called by using a command to implement complex business logic. For example, you can call a service to perform a specific task.|
|Event||Defines the events that devices send to IoT Platform when the devices are running. An event contains a notification that requires action or attention. An event may contain multiple output parameters. For example, an event may be a notification that a task is completed, a device fault has occurred, or a temperature alert is generated. You can subscribe to or push events.|
IoT Platform supports defining multiple sets of features for a product, including properties, services, and events. A TSL module indicates a set of features. Different TSL modules do not affect each other.
TSL modules allow you to resolve complex device modeling issues in industrial scenarios. You can develop devices of different features by using the same product.
For example, the properties of the electric fan heater product include Power Switch, Gear (high, medium, and low), and Indoor Temperature. You can add the first two properties in one module and all three properties in another module. Then, you can develop devices based on TSL modules. This way, different devices under the same product have different features.
IoT Platform provides default modules. You can add custom modules as needed. The total number of modules cannot exceed 10.
IoT Platform provides TSL to describe modules and features of products.
Each TSL file is in the JSON format. You can view or export a JSON-formatted TSL model in the IoT Platform console. On the Product Details page, click the Define Feature tab. On this tab, click TSL Model. For more information about TSL fields, see TSL parameters.
You can add one or more TSL models in IoT Platform. When you import multiple TSL models at the same time, you can customize TSL files. For more information, see Limits.
For information about the limits of TSL features, see Limits. The following table describes the limits that apply when you import TSL files.
|Import a single TSL file||The file suffix is
Valid characters do not include line feeds and alignment characters.
|Import multiple TSL files||