How to setup a parameter to show bar graph in app

djorr5
Posts: 16
Joined: Fri Nov 17, 2023 4:12 am

How to setup a parameter to show bar graph in app

Postby djorr5 » Wed Oct 23, 2024 3:07 am

Hi all,

In the Rainmaker vanilla app when you have a temperature parameter setup you can click on it in the app and you have the option for it to show the past values as a bar graph. I would like to be able to do this for a parameter I create. Is there something I need to do when I create the parameter?

Code: Select all

    fence_sensor_device = esp_rmaker_device_create("Fence", NULL, NULL);
    esp_rmaker_param_t *voltage = esp_rmaker_param_create("V", NULL, esp_rmaker_int(0), PROP_FLAG_READ);
    esp_rmaker_device_add_param(fence_sensor_device, voltage);
    esp_rmaker_device_assign_primary_param(fence_sensor_device, voltage);
    esp_rmaker_node_add_device(node, fence_sensor_device);

ESP_Piyush
Posts: 309
Joined: Wed Feb 20, 2019 7:02 am

Re: How to setup a parameter to show bar graph in app

Postby ESP_Piyush » Thu Oct 24, 2024 2:07 pm

Check out the docs here to understand time series data. You will need to use the full featured time series data to see graphs on the phone app. In your code, just change the param creation line to include PROP_FLAG_TIME_SERIES

Code: Select all

esp_rmaker_param_t *voltage = esp_rmaker_param_create("V", NULL, esp_rmaker_int(0), PROP_FLAG_READ | PROP_FLAG_TIME_SERIES);

Who is online

Users browsing this forum: No registered users and 79 guests