Page 1 of 1

Absolute humidities

Posted: Thursday 16 April 2020 8:38
by rrozema
I have several 'TempHum'-devices in my home, devices that sense both temperature and (air) humidity. The humidity value in these sensors is the so-called Relative Humidity (RH): "the ratio of the partial pressure of water vapor to the equilibrium vapor pressure of water at a given temperature" as that wiki page states it. Or as I think of it: A percentage for how much water is in the air, where 0% is no water at all and 100% is where it "starts to rain". Not really, for actual rain you need more conditions apparently, but at least it is the maximum amount of water the air can hold.

I am controling my Heat Exchanger unit based on o.a. that relative humidity, and as many before me have noticed the 100% of the RH varies depending on the temperature, so it doesn't always work really well. To work around this I have a shifting setpoint for my system: depending on the outside air's RH the inside RH target value changes. By looking at the logged data I found that my system can make the inside air's RH at most roughly 20% lower than the outside air's RH, so if the difference is over 20% I simply shift the target value up, to avoid having the fans running all day long. Reading about the topic of RH I found formulas that would enable me to calculate the absolute humidity (AH) given a temperature plus a relative humidity. Out of curiosity I wrote this little script that calculates the absolute humidty (AH) in gram per cubic meter for each of my TempHum-devices. I have no application for it (yet?), it is just to show and log the AH-values for now. This is what I get:
absolute humidity sensors.JPG
absolute humidity sensors.JPG (71.73 KiB) Viewed 2685 times
The script is in my github: https://github.com/rrozema/Domoticz-scr ... dities.lua.

What I did to make this work:
  • each of my TempHum devices is named as "<Room name>: TempHum".
  • for each TempHum device that I wanted a AH value for I created a virtual sensor of type 'Custom Sensor':
    absolute humidity - virtual device.JPG
    absolute humidity - virtual device.JPG (22.76 KiB) Viewed 2685 times
    .
  • then I put the script in the scripts window in Domoticz and enabled it.
  • wait for the values to be updated by new incoming temperature or RH values.

Re: Absolute humidities

Posted: Thursday 16 April 2020 9:52
by Antori91
Interesting. Thank you for sharing.

Re: Absolute humidities

Posted: Sunday 25 September 2022 8:35
by Rofjekv
Hello rrozema,

Thank you for shearing, this is very usefull. I tried to activate it through the Events menu but it not working. I can't find the issue after 2 hours of troubleshooting and testing. Could you be more specific about the scripts window in Domoticz please?
Maybe it's only a version upgrade in domoditc or a trigger setting ?

Thanks a lot :)

Re: Absolute humidities

Posted: Sunday 25 September 2022 9:44
by rrozema
Just create a new script by clinking the +-sign in the tab bar. Pick any of the dzvents script types, doesn't matter which. Then paste my script contents over that what was generated for you. Then name and save the script.

Re: Absolute humidities

Posted: Sunday 25 September 2022 12:30
by Rofjekv
Yes I did that many times, and I just retried, but i found out that the domoticz don't start the script on sensors events (new data).
I had to specify wich sensor name to make it work, but this mean I have to duplicate the script for each sensor.

Re: Absolute humidities

Posted: Sunday 25 September 2022 14:41
by solarboy
"Dew Point" is a very good substitute for absolute humidity.

Re: Absolute humidities

Posted: Monday 26 September 2022 22:18
by Rofjekv
Well not for psychrometric calculs... I want to evaluate the airflow of the mechanical ventilation system and I need to convert the humidity to absolute