Wrong calculation of humidity

  • Hi,
    Just found this little issue when playing around with a DS2438 sensor:

    'humidity': (((float(self.value[1]) / (float(self.value[0]) - 0.16)) / 0.0062) / (1.0546 - 0.00216 * float(self.value[2]))),

    should be:

    'humidity': ((((float(self.value[1]) / float(self.value[0])) - 0.16) / 0.0062) / (1.0546 - 0.00216 * float(self.value[2]))),

    Hope this helps!

  • administrators

    Thanks! We got the calculation from a datasheet of some sort, so we didn't think there would be an error in operator precedence. It's fairly obvious in hindsight! We'll put it in the next update soon.


Log in to reply

Looks like your connection to UniPi.technology Forum was lost, please wait while we try to reconnect.