Calculate Absolute Humidity
Calculates absolute humidity (g/m³) from relative humidity and temperature using the Magnus formula — for condensation, archival storage, and comparing rooms.
Who it’s for
For IoT integrators and facility operators who need moisture content in absolute terms (g/m³) rather than relative percentage — for example, technicians monitoring archival storage, server rooms, or industrial climate control, where condensation risk and actual water vapor content matter more than relative humidity alone. Relative humidity readings are temperature-dependent and can’t be directly compared across rooms or seasons; this calculated field derives a temperature-independent value so operators can assess dew point risk, compare moisture levels across different environments, and trigger alerts based on real mass of water vapor rather than a relative percentage that shifts with ambient temperature.
What it does
The calculated field reads two time series telemetry values from the device: temperature (°C) and humidity (relative, %). It applies the Magnus formula (Bolton 1980 coefficients) to compute the saturation vapor pressure and derive the actual mass of water vapor per cubic meter of air. The result is written back to the same entity as a new time series key: absoluteHumidity (g/m³), rounded to two decimal places.
How to set up
- No relations or related entities are required — this CF operates on telemetry from a single entity.
- Both
temperatureandhumiditytime series keys must already be published by the device before the CF can evaluate. - Install the calculated field on the device profile (recommended, so it applies automatically to every device of that type) or on a single device entity if only one sensor needs it.
- Make sure the script/output key
absoluteHumiditydoesn’t collide with an existing telemetry key on the target entity, unless overwriting is intended.
How to customize
- To point the inputs at your own keys — change the Time series key on the
temperatureandhumidityarguments to match what your devices publish. - To rename the stored result — change the output name from
absoluteHumidityto whatever your dashboards expect. - To tune or override the coefficients — the magnusA, magnusB and svpBase arguments default to the Bolton (1980) set. Change the defaults to use another set (e.g. Alduchov–Eskridge, 17.625 / 243.04) for every device, or set the matching server attribute on an individual device to override just that one — the field uses the attribute when present and the default otherwise.
- To filter, transform, or forward the result to external systems — switch Strategy to Process via Rule Chains. Rule nodes then receive the value and can drop it, change it, save it conditionally, push it to an external system, or anything else the chain defines.
Share Your Calculated Field with the Community
Built a useful data transformation? Export it as a JSON from ThingsBoard and publish it to the IoT Hub. Share it with thousands of ThingsBoard developers worldwide.