discontinuedPackage thingsboard_pe_client has been discontinued and replaced by thingsboard_client.
TelemetryControllerApi class
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
deleteDeviceAttributes({required String deviceId, required String scope, String? keys, BuiltList<String>? key, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<String>>
-
Delete device attributes (deleteDeviceAttributes)
Delete device attributes using provided Device Id, scope and a list of keys. Referencing a non-existing Device Id will cause an error Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
deleteEntityAttributes({required String entityType, required String entityId, required String scope, String? keys, BuiltList<String>? key, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<String>>
-
Delete entity attributes (deleteEntityAttributes)
Delete entity attributes using provided Entity Id, scope and a list of keys. This operation is idempotent: keys that do not exist are silently ignored and the response is still 200 OK. Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
deleteEntityTimeseries({required String entityType, required String entityId, String? keys, bool? deleteAllDataForKeys = false, int? startTs, int? endTs, bool? deleteLatest = true, bool? rewriteLatestIfDeleted = false, BuiltList<String>? key, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<String>>
-
Delete entity time series data (deleteEntityTimeseries)
Delete time series for selected entity based on entity id, entity type and keys. Use 'deleteAllDataForKeys' to delete all time series data. Use 'startTs' and 'endTs' to specify time-range instead. Use 'deleteLatest' to delete latest value (stored in separate table for performance) if the value's timestamp matches the time-range. Use 'rewriteLatestIfDeleted' to rewrite latest value (stored in separate table for performance) if the value's timestamp matches the time-range and 'deleteLatest' param is true. The replacement value will be fetched from the 'time series' table, and its timestamp will be the most recent one before the defined time-range. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
getAttributeKeys({required String entityType, required String entityId, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<BuiltList<String>>>
-
Get all attribute keys (getAttributeKeys)
Returns a set of unique attribute key names for the selected entity. The response will include merged key names set for all attribute scopes: * SERVER_SCOPE - supported for all entity types; * CLIENT_SCOPE - supported for devices; * SHARED_SCOPE - supported for devices. Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
getAttributeKeysByScope({required String entityType, required String entityId, required String scope, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<BuiltList<String>>>
-
Get all attribute keys by scope (getAttributeKeysByScope)
Returns a set of unique attribute key names for the selected entity and attributes scope: * SERVER_SCOPE - supported for all entity types; * CLIENT_SCOPE - supported for devices; * SHARED_SCOPE - supported for devices. Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
getAttributes({required String entityType, required String entityId, String? keys, BuiltList<String>? key, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<BuiltList<AttributeData>>>
-
Get attributes (getAttributes)
Returns all attributes that belong to specified entity. Use optional 'keys' parameter to return specific attributes. Example of the result: ```json [ {"key": "stringAttributeKey", "value": "value", "lastUpdateTs": 1609459200000}, {"key": "booleanAttributeKey", "value": false, "lastUpdateTs": 1609459200001}, {"key": "doubleAttributeKey", "value": 42.2, "lastUpdateTs": 1609459200002}, {"key": "longKeyExample", "value": 73, "lastUpdateTs": 1609459200003}, {"key": "jsonKeyExample", "value": { "someNumber": 42, "someArray":
1,2,3, "someNestedObject": {"key": "value"} }, "lastUpdateTs": 1609459200004 } ] ``` Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
getAttributesByScope({required String entityType, required String entityId, required String scope, String? keys, BuiltList<String>? key, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<BuiltList<AttributeData>>>
-
Get attributes by scope (getAttributesByScope)
Returns all attributes of a specified scope that belong to specified entity. List of possible attribute scopes depends on the entity type: * SERVER_SCOPE - supported for all entity types; * SHARED_SCOPE - supported for devices; * CLIENT_SCOPE - supported for devices. Use optional 'keys' parameter to return specific attributes. Example of the result: ```json [ {"key": "stringAttributeKey", "value": "value", "lastUpdateTs": 1609459200000}, {"key": "booleanAttributeKey", "value": false, "lastUpdateTs": 1609459200001}, {"key": "doubleAttributeKey", "value": 42.2, "lastUpdateTs": 1609459200002}, {"key": "longKeyExample", "value": 73, "lastUpdateTs": 1609459200003}, {"key": "jsonKeyExample", "value": { "someNumber": 42, "someArray":
1,2,3, "someNestedObject": {"key": "value"} }, "lastUpdateTs": 1609459200004 } ] ``` Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
getLatestTimeseries({required String entityType, required String entityId, String? keys, bool? useStrictDataTypes = false, BuiltList<String>? key, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<BuiltMap<String, BuiltList<TsData>>>>
-
Get latest time series value (getLatestTimeseries)
Returns all time series that belong to specified entity. Use optional 'keys' parameter to return specific time series. The result is a JSON object. The format of the values depends on the 'useStrictDataTypes' parameter. By default, all time series values are converted to strings: ```json { "stringTsKey":
{ \"value\": \"value\", \"ts\": 1609459200000}, "booleanTsKey": { \"value\": \"false\", \"ts\": 1609459200000}, "doubleTsKey": { \"value\": \"42.2\", \"ts\": 1609459200000}, "longTsKey": { \"value\": \"73\", \"ts\": 1609459200000}, "jsonTsKey": [{ "value": "{\"someNumber\": 42,\"someArray\": 1,2,3,\"someNestedObject\": {\"key\": \"value\"}}", "ts": 1609459200000}] } ``` However, it is possible to request the values without conversion ('useStrictDataTypes'=true): ```json { "stringTsKey": { \"value\": \"value\", \"ts\": 1609459200000}, "booleanTsKey": { \"value\": false, \"ts\": 1609459200000}, "doubleTsKey": { \"value\": 42.2, \"ts\": 1609459200000}, "longTsKey": { \"value\": 73, \"ts\": 1609459200000}, "jsonTsKey": [{ "value": { "someNumber": 42, "someArray": 1,2,3, "someNestedObject": {"key": "value"} }, "ts": 1609459200000}] } ``` Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
getTimeseriesByReadTsKvQueries({required String entityType, required String entityId, required BuiltList<BaseReadTsKvQuery> baseReadTsKvQuery, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<BuiltList<ReadTsKvQueryResult>>>
-
Get time series data by read queries (getTimeseriesByReadTsKvQueries)
Returns aggregated time series values according to queries for specified entity. ```json [ { "queryId": 49, "data":
{ \"ts\": 1751450399999, \"kv\": { \"key\": \"temperature\", \"value\": 26, \"doubleValue\": 26, \"valueAsString\": \"26.0\", \"dataType\": \"DOUBLE\", \"longValue\": null, \"booleanValue\": null, \"jsonValue\": null, \"strValue\": null }, \"version\": null } , "lastEntryTs": 1750264592675 }, { "queryId": 50, "data": [], "lastEntryTs": 1751317200000 } ] ``` Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
getTimeseriesHistory({required String entityType, required String entityId, required int startTs, required int endTs, String? keys, String? intervalType, int? interval = 0, String? timeZone, int? limit, String? agg, String? orderBy, bool? useStrictDataTypes = false, BuiltList<String>? key, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<BuiltMap<String, BuiltList<TsData>>>>
-
Get time series data (getTimeseriesHistory)
Returns a range of time series values for specified entity. Returns not aggregated data by default. Use aggregation function ('agg') and aggregation interval ('interval') to enable aggregation of the results on the database / server side. The aggregation is generally more efficient then fetching all records. ```json { "temperature":
{ \"value\": 36.7, \"ts\": 1609459200000 }, { \"value\": 36.6, \"ts\": 1609459201000 } } ``` Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
getTimeseriesKeys({required String entityType, required String entityId, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<BuiltList<String>>>
-
Get time series keys (getTimeseriesKeys)
Returns a set of unique time series key names for the selected entity. Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
saveDeviceAttributes({required String deviceId, required String scope, required String body, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<String>>
-
Save device attributes (saveDeviceAttributes)
Creates or updates the device attributes based on device id and specified attribute scope. The request payload is a JSON object with key-value format of attributes to create or update. For example: ```json { "stringKey":"value1", "booleanKey":true, "doubleKey":42.0, "longKey":73, "jsonKey": { "someNumber": 42, "someArray":
1,2,3, "someNestedObject": {"key": "value"} } } ``` Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
saveEntityAttributesV1({required String entityType, required String entityId, required String scope, required String body, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<String>>
-
Save entity attributes (saveEntityAttributesV1)
Creates or updates the entity attributes based on Entity Id and the specified attribute scope. List of possible attribute scopes depends on the entity type: * SERVER_SCOPE - supported for all entity types; * SHARED_SCOPE - supported for devices. The request payload is a JSON object with key-value format of attributes to create or update. For example: ```json { "stringKey":"value1", "booleanKey":true, "doubleKey":42.0, "longKey":73, "jsonKey": { "someNumber": 42, "someArray":
1,2,3, "someNestedObject": {"key": "value"} } } ``` Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
saveEntityAttributesV2({required String entityType, required String entityId, required String scope, required String body, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<String>>
-
Save entity attributes (saveEntityAttributesV2)
Creates or updates the entity attributes based on Entity Id and the specified attribute scope. List of possible attribute scopes depends on the entity type: * SERVER_SCOPE - supported for all entity types; * SHARED_SCOPE - supported for devices. The request payload is a JSON object with key-value format of attributes to create or update. For example: ```json { "stringKey":"value1", "booleanKey":true, "doubleKey":42.0, "longKey":73, "jsonKey": { "someNumber": 42, "someArray":
1,2,3, "someNestedObject": {"key": "value"} } } ``` Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
saveEntityTelemetry({required String entityType, required String entityId, required String scope, required String body, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<String>>
-
Save or update time series data (saveEntityTelemetry)
Creates or updates the entity time series data based on the Entity Id and request payload.The request payload is a JSON document with three possible formats: Simple format without timestamp. In such a case, current server time will be used: ```json {"temperature": 26} ``` Single JSON object with timestamp: ```json {"ts":1634712287000,"values":{"temperature":26, "humidity":87}} ``` JSON array with timestamps: ```json
{\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, {\"ts\":1634712588000,\"values\":{\"temperature\":25, \"humidity\":88}} ``` The scope parameter is not used in the API call implementation but should be specified whatever value because it is used as a path variable. Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
saveEntityTelemetryWithTTL({required String entityType, required String entityId, required String scope, required int ttl, required String body, CancelToken? cancelToken, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress})
→ Future<Response<String>>
-
Save or update time series data with TTL (saveEntityTelemetryWithTTL)
Creates or updates the entity time series data based on the Entity Id and request payload.The request payload is a JSON document with three possible formats: Simple format without timestamp. In such a case, current server time will be used: ```json {"temperature": 26} ``` Single JSON object with timestamp: ```json {"ts":1634712287000,"values":{"temperature":26, "humidity":87}} ``` JSON array with timestamps: ```json
{\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, {\"ts\":1634712588000,\"values\":{\"temperature\":25, \"humidity\":88}} ``` The scope parameter is not used in the API call implementation but should be specified whatever value because it is used as a path variable. The ttl parameter takes affect only in case of Cassandra DB.Referencing a non-existing entity Id or invalid entity type will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
-
toString()
→ String
-
A string representation of this object.
inherited