Spanish Total.js
Deutsch
Dokumentation Für KI-Agenten
Inhalt

Data for reports

The views and tables to use in the SQL queries of reports.

.md Website

Diese Seite ist noch nicht übersetzt. Du liest das Original.

Auf dieser Seite

Reports read the PostgreSQL database of the platform. These views and tables hold what you usually need. Times are in UTC.

view_sensor

One row for each sensor of each device, with its last value.

ColumnContent
deviceThe name of the device.
sensorThe name of the sensor.
labelLocality, device and sensor in one text.
deviceid, sensoridThe ids of the device and the sensor.
snThe device identifier.
localityThe place of the device.
valueThe last value, as text.
dtvalueThe time of the last value.
format, decimalsHow the value is shown.
isonlinetrue when the sensor is online.
statsThe statistics the sensor keeps.

view_device

One row for each device with name, sn, locality, lat, lng, reference, driver_name, isdisabled and isonline.

History tables

The statistics are in one table for each interval: tbl_data_minutely, tbl_data_hourly, tbl_data_daily, tbl_data_monthly and tbl_data_yearly. Each row is one interval of one sensor:

ColumnContent
deviceid, sensoridThe device and the sensor.
tsThe start of the interval.
min, maxThe lowest and the highest value in the interval.
countThe number of values in the interval.

Sensors with the timeline on also keep every value in tbl_data_timeline with ts, deviceid, sensorid and value.

Join the history with view_sensor to get readable names:

SELECT b.device, b.sensor, a.ts, a.min, a.max, a.count
FROM tbl_data_hourly a
INNER JOIN view_sensor b ON b.deviceid = a.deviceid AND b.sensorid = a.sensorid
ORDER BY a.ts DESC

Driver storage

Drivers can keep their own tables in the storage schema. See Storage.

Hergestellt in Europa