Good afternoon, I'm trying to create a fuel level sensor.
The calibration table cannot be inserted to the sensor.
returns an error parse error - ParseException (... < ComputedAttributesHandler:103 < AttributeResource:63 < ...)
code:
fuel1
fuel1 ? fuel1:null
if (fuel1 < 1) {
fuel1 = null;
} else if ((fuel1 >= 1) && (fuel1 < 156)) {
fuel1 = (0.316129032258 * fuel1) + 0.683870967742;
} else if ((fuel1 >= 156) && (fuel1 < 438)) {
fuel1 = (0.177304964539 * fuel1) + 22.3404255319;
} else if ((fuel1 >= 438) && (fuel1 < 706)) {
fuel1 = (0.186567164179 * fuel1) + 18.2835820896;
} else if ((fuel1 >= 706) && (fuel1 < 971)) {
fuel1 = (0.188679245283 * fuel1) + 0.188679245283;
} else if ((fuel1 >= 971) && (fuel1 < 1241)) {
fuel1 = (0.185185185185 * fuel1) + 20.1851851852;
} else if ((fuel1 >= 1241) && (fuel1 < 1497)) {
fuel1 = ((0.1953125 * fuel1) + 7.6171875;
} else if ((fuel1 >= 1497) && (fuel1 < 1757)) {
fuel1 = (0.192307692308 * fuel1) + 12.1153846154;
} else if ((fuel1 >= 1757) && (fuel1 < 2013)) {
fuel1 = (0.1953125 * fuel1) + 6.8359375;
} else if ((fuel1 >= 2013) && (fuel1 < 2273)) {
fuel1 = (0.192307692308 * fuel1) + 12.8846153846;
} else if ((fuel1 >= 2273) && (fuel1 < 2524)) {
fuel1 = (0.199203187251 * fuel1) + -2.78884462151;
} else if ((fuel1 >= 2524) && (fuel1 < 2777)) {
fuel1 = (0.197628458498 * fuel1) + 1.18577075099;
} else if ((fuel1 >= 2777) && (fuel1 < 3035)) {
fuel1 = (0.193798449612 * fuel1) + 11.8217054264;
} else if ((fuel1 >= 3035) && (fuel1 < 3287)) {
fuel1 = (0.198412698413 * fuel1) + -2.18253968254;
} else if ((fuel1 >= 3287) && (fuel1 < 3547)) {
fuel1 = (0.192307692308 * fuel1) + 17.8846153846;
} else if ((fuel1 >= 3547) && (fuel1 < 3806)) {
fuel1 = (0.19305019305 * fuel1) + 15.250965251;
} else if ((fuel1 >= 3806) && (fuel1 < 4094)) {
fuel1 = (0.177304964539 * fuel1) + 75.1773049645;
} else if ((fuel1 >= 4094 ) && (fuel1 < 4095)) {
fuel1 = 800.00;
}
https://docs.google.com/drawings/d/1B6Yg-kcWF_xTgeiL2NIRbM7lc09Sz9I1B88298SLdlg/edit
Doesn't look like a valid expression to me. Can you actually store the value in a variable? Where do you return the value? Why do you have multiple expressions instead of one?
Good afternoon, I'm trying to create a fuel level sensor.
The calibration table cannot be inserted to the sensor.
returns an error
parse error - ParseException (... < ComputedAttributesHandler:103 < AttributeResource:63 < ...)
code:
https://docs.google.com/drawings/d/1B6Yg-kcWF_xTgeiL2NIRbM7lc09Sz9I1B88298SLdlg/edit