Skip to main content

Time-Series Usage Guide

about

Time-Series is a feature in ESP RainMaker that has the ability to log and store data points over time, each tagged with a timestamp. This allows users to track changes in parameters like temperature, humidity, or energy usage, enabling historical analysis and trend monitoring.

To learn more about Time-Series and its variants, click here.


Usage Guide

Enabling Time-Series

To use Time-Series data, just include PROP_FLAG_TIME_SERIES (full featured Time-Series) or PROP_FLAG_SIMPLE_TIME_SERIES (simple Time-Series) flag in the properties while creating a RainMaker parameter.

For example
esp_rmaker_param_t *param = esp_rmaker_param_create("Temperature", ESP_RMAKER_PARAM_TEMPERATURE,
esp_rmaker_float(15.5), PROP_FLAG_READ | PROP_FLAG_TIME_SERIES);
esp_rmaker_param_t *param = esp_rmaker_param_create("Mode", ESP_RMAKER_PARAM_MODE,
esp_rmaker_int(1), PROP_FLAG_READ | PROP_FLAG_SIMPLE_TIME_SERIES);

After adding these parameters to devices, the corresponding node configuration will show them as below (note the properties):

[
{
"name": "Temperature",
"type": "esp.param.temperature",
"data_type": "float",
"properties": [
"read",
"time_series"
]
},
{
"name": "Mode",
"type": "esp.param.mode",
"data_type": "int",
"properties": [
"read",
"simple_ts"
]
}
]
important note

Please use esp_rmaker_param_update_and_report() to update both parameters, the instantaneous value as well as the Time-Series value of the parameter.


Specifications

To view the specifications of these MQTT topics for Time-Series variants, please refer here.

On this page