To be able to retrieve values via the Influx database per api, the module “States Influxdb Datasource” must be activated under Administration/ Settings/ Permissions/ Modules.
Search query:
SELECT
The SELECT statement is used to select data from a database. The data returned is stored in a result table, called the result-set.
The following tags are available for selecting the data:
Tags |
Description |
|---|---|
value_number |
Values with datatype number. Booleans are also saved as numbers: - 0 for False - 1 for True |
value_string |
Values with datatype string. |
SELECT "value_number"
Functions can also be applied directly to the queried values
Function |
Description |
|---|---|
last() |
Lorem Ipsum https://docs.influxdata.com/flux/v0.x/stdlib/universe/last/ |
mean() |
Lorem Ipsum |
min() |
Lorem Ipsum |
max() |
Lorem Ipsum |
SELECT mean("value_number")
FROM
All values are saved in table state_history.
So all queries should contain:
FROM "states_history"
WHERE
The WHERE clause is used to filter records. It is used to extract only those records that fulfill a specified condition.
The following tags are available for filtering the data:
Tags |
Possible Values |
Description |
|---|---|---|
account_id |
Id of the account for which the data point was created. | |
config_id |
Id of the connector from which the information for this data point originates. | |
dtwin_id |
Id of the digital twin or virtual device. | |
dtwin_title |
Title of the digital twin or virtual device. | |
parser_variable |
Assigned variable in the parser representing this datapoint. | |
source_identifier |
The external ID of the virtual device for which this datapoint was created. | |
source_type |
Source/system from which the data point originates (e.g. connector or aggregation). | |
state_id |
Id of the data state. | |
state_identifier |
Key of the data point. | |
state_type |
number; string; boolean; json |
type of the datapoint. |
twin_ancestor_ids |
Id’s of the parent twins in the hierarchy. | |
twin_category |
virtualDevice; digitalTwin(empty) |
Differentiation whether it is a virtualDevice or digitalTwin. |
twin_tags |
Tag(s) of the digital twin or virtual device. | |
unit |
Unit of the value as stored in the datapoint. | |
vdevice_groups |
Group(s) of a virtual device |