# Calibrating humidity on SNZB-02 sensors

I have multiple Sonoff SNZB-02 sensors and they seem to overestimate humidity. So, I’ve decided to investigate it and recalculate the humidity to a more realistic number.

Humidity/temperature data sources:

• one dehumidifier
• multiple SNZB-02 sensors in the same room

Absolute humidity calculation: Can be calculated by GitHub - dolezsa/thermal_comfort: Thermal Comfort sensor for HA (absolute humidity, heat index, dew point, thermal perception) , which uses formula from How to convert relative humidity to absolute humidity | carnotcycle . This formula can be also reversed for calculating relative humidity from (adjusted) absolute humidity.
Note that the formula doesn’t include pressure. IIRC, when atmospheric pressure is in usual range, it nearly doesn’t matter and the error introduced by ignoring pressure is likely much much smaller than errors in the sensor readings.

Assumptions:

• I usually don’t have a condensating humidity in my room. It I had, I’d have much more issues than bad humidity sensor readings.
• Temperature readings from those sensors are OK.
• Within the same room with closed windows, absolute humidity is about the same in long term. (This isn’t true when there is a short-term humidity source – warm water, wet clothes on clothesline.) Relative humidity might still vary, because it is affected by temperature.
• When I open windows for a long time, the absolute humidity will usually tend to be the same as outside absolute humidity. Note that this assumption might be temporarily broken when raining or after rain.

Observations:

• When dehumidifier is running and windows are open, it tends to show approximately the same absolute humidity values as outside. So, running dehumidifier seems to provide the correct absolute humidity values.
• At 20°C, most SNZB-02 sensors tend to report approximately the same value as running dehumidifier.
• Over 20°C, SNZB-02 sensors tend to report higher absolute humidity – something like 1 g/m³ for every 3°C over 20°C.
• Under 20°C, there seems to be a similar inaccuracy, as the absolute humidity calculations in fridge seems to fluctuate even if I am away for a week the humidity gets pretty low. I haven’t investigated it yet, as I have almost no data under 20 °C from room. I also don’t care about the inaccuracy in fridge, because my statistics and notifications aren’t much influenced by those inaccuracies.
• Few sensors seem to also overestimate the absolute humidity somewhat more by a constant. This is likely an issue with sensors that were accidentally exposed to a liquid water.

Recalculation:

1. Calculate absolute humidity from relative humidity and temperature
2. Substract 1 g/m³ for every 3°C over 20°C. (At 20°C, don’t substract anything. Under 20°C, I also don’t substract anything, but this might change in future.)
3. If the sensor still tends to report more than others, also substract the offset.
4. Calculate relative humidity from temperature and adjusted absolute humidity.

I currently have a module for Hagen, but it isn’t published yet.

Drawbacks:

• The recalculation adds a cap for extreme humidity. You will never get maximum humidity readings (i.e. 99.99% for SNZB-02) when it is over 20 %.
• Any change of temperature will change the adjusted humidity.
• When I open window and it is cold and humid outside, the relative humidity temporarily lowers and then goes higher. This is probably caused by different reaction time for humidity and temperature readings.