Values not showing more than 3 significant figures !?
Posted: 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
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);