atmospi icon indicating copy to clipboard operation
atmospi copied to clipboard

Calibration offset

Open mstenta opened this issue 10 years ago • 2 comments

Provide a way to specify the delta-T for each sensor compared to a calibrated sensor.

mstenta avatar Jan 14 '15 16:01 mstenta

I have written a temporary fix [because it's hard coded and not derived from a configuration file] by modifying measure-ds18b20.py:

        # Apply device calibration values in mK
        if device == '28-000005e4d76b':
            temp_c = temp_c - 275
        elif device == '28-000005e4f2fd':
            temp_c = temp_c - 225
        elif device == '28-000005e5f606':
            temp_c = temp_c - 175
        elif device == '28-000005e65e0c':
            temp_c = temp_c - 875
        elif device == '28-000005e77695':
            temp_c = temp_c - 187
        elif device == '28-000005fab05d':
            temp_c = temp_c + 640
        elif device == '28-000005fab2e0':
            temp_c = temp_c + 515
        elif device == '28-000005fab89c':
            temp_c = temp_c - 72
        elif device == '28-000005fb03d6':
            temp_c = temp_c + 453

        temp_c = round(temp_c / 1000.0,1)

        # Add the measurement to the temps array.
        temps[device] = {'C': temp_c}

I would have preferred to keep the calibration out of the database and do it client-side but couldn't get that to work.

ultima-originem avatar Feb 09 '15 12:02 ultima-originem

Now that #10 is done, we have a new Devices database table for storing device-specific settings. This might be a good place for the calibration offset data to go.

The tricky thing here (and likewise in #20 ) is that some devices (ie: DHT22, DHT11, and AM2302) provide TWO readings (temperature and humidity) - but only have one "device" in the Devices database... so that would make adding color and calibration config more difficult... hmm...

mstenta avatar Feb 09 '15 17:02 mstenta