I need to report the temperature in Celsius, that can be bellow zero, to the HC2.
I tried to define getter as word, int, signed int, but only positive values were shown in HC2. The values bellow zero were not transferred at all.
Also, I found this older thread on the similar topic, but I was not able to understand what's the solution: https://forum.z-wave.me/viewtopic.php?f ... =10#p65177
.....
UPDATE:
Ahhh, just got it. It looks like to define getter as a signed long helped:
Code: Select all
...
ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_TEMPERATURE, SENSOR_MULTILEVEL_SCALE_CELSIUS, SENSOR_MULTILEVEL_SIZE_FOUR_BYTES, SENSOR_MULTILEVEL_PRECISION_ONE_DECIMAL, getter8)
...
signed long getter8(){
signed long getter_out;
getter_out = atoi(CoolantTemperature); //converts char array to integer
Serial.print("CoolantTemperature is: "); //debug
Serial.print(getter_out);
Serial.println;
return getter_out;
}
Thanks,
Ondrej