interface LoggingDataQuery {
    decimals?: number;
    extendedBoundary?: boolean;
    factor?: number;
    from?: string;
    limit?: number;
    offset?: number;
    order?: "desc" | "asc";
    postAggr?: Aggregrator;
    postTransform?: null | "difference";
    preAggr?: Aggregrator;
    ref?: string;
    selector?: string;
    step?: number | "day" | "week";
    tag?: null | {
        publicId: string;
    };
    to?: string;
    unit?: string;
    variable?: null | {
        publicId: string;
    };
}

Properties

decimals?: number

Number of decimals to be returned

extendedBoundary?: boolean

Whether or not you want to query for extra data-points, one before the start date and one beyond the end date (if they exist).

factor?: number

The factor to multiply the value by

from?: string

Used to override the global time-range for this specific query

For example 2019-01-01T00:00:00Z

limit?: number

How many values should be fetched. The postAggr is applied to reduce the set of points to the limit.

offset?: number

Starting point for returned values

Must be null if postAggr is set

order?: "desc" | "asc"

The order to order datapoints by

postAggr?: Aggregrator

Aggregrator for aggregation after data storage

Must be null if offset is set

postTransform?: null | "difference"

Apply a transform. Only applies when postAggr is 'last'.

'difference' takes the difference between the last value in a bucket and the bucket before it.

preAggr?: Aggregrator

When omitted, the pre-aggregator is determined automatically based on a couple of factors, but in most cases it defaults to "raw".

ref?: string

Reference used to identify the value. If not set, a unique reference is generated.

When the output is formatted as CSV, this reference will be used as the column header. In this case, the variable $TH_UNIT can be used to dynamically render a unit suffix, if applicable. If no unit is configured, it will fallback to an empty string.

For example: a reference value of "Weight$TH_UNIT" would in CSV format output as "Weight (kg)".

selector?: string

The selector for getting data from a specific tag or variable. Can be used instead of tag or variable field

Formatted as .. where is the name of the datas source, is 'tag' or 'variable' and is the slug of the tag or variable.

step?: number | "day" | "week"

Number of seconds between subsequent data-points

tag?: null | {
    publicId: string;
}

The tag to fetch the data from. Must be null if variable is set

to?: string

Used to override the global time-range for this specific query

For example 2019-01-01T23:59:59Z

unit?: string

The unit of the value

variable?: null | {
    publicId: string;
}

The variable to fetch the data from. Must be null if tag is set