Values not showing more than 3 significant figures !?

hasan_
Posts: 20
Joined: Wed Apr 05, 2023 9:03 am

Values not showing more than 3 significant figures !?

Postby hasan_ » Wed Apr 05, 2023 10:05 am

Hi, I am using a custom device and an INT READ parameter to read CO2 (ppm) sensor values from ESP32 Dev Board, it works fine but in the Android app, the primary value (main UI) shows only the first three digits. E.g. a value of 1428 would appear as 142, despite having the full value when I click the device. (see screenshots).

If it helps, I even tried float, and interestingly it showed also a 'decimal' point and nothing after it (for example: 843.) as if the app has a limited character or width space of text field? (that's just my guess).

I really need it to get it working soon for a client. Relevant code snippets below. Please help!

Thanks,
Hasan

Code: Select all

static Device CO2("CO2 (ppm)", "custom.device.co2");
my_node.addDevice(CO2);

void setup() {
 Param co2_param("CO2 (ppm)", "custom.param.value", value((int)DEFAULT_CO2), PROP_FLAG_READ);
 CO2.addParam(co2_param);
 CO2.assignPrimaryParam(CO2.getParamByName("CO2 (ppm)")); }

//To update:
int h = int(mySensor.getCO2());
CO2.updateAndReportParam("CO2 (ppm)", h); 
Attachments
screenshot2.jpeg
screenshot2.jpeg (90.26 KiB) Viewed 2475 times
screenshot1.jpeg
screenshot1.jpeg (31.71 KiB) Viewed 2475 times

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

Re: Values not showing more than 3 significant figures !?

Postby ESP_Piyush » Sat Apr 08, 2023 8:45 am

We have fixed the issue and updated the app on the Play Store. Please check if it meets your requirement.

hasan_
Posts: 20
Joined: Wed Apr 05, 2023 9:03 am

Re: Values not showing more than 3 significant figures !?

Postby hasan_ » Mon Apr 10, 2023 12:56 am

Awesome! Just checked, yes! Now I can see full primary data.

Thank you so much for resolving this so swiftly!

Who is online

Users browsing this forum: No registered users and 24 guests