Calculating dew point for demisting car window

Does anyone have any advice for a beginner to rules (and meteorology)?

Background: I live in the UK, it’s cold and wet here between about October and March, and this means the inside of our car windows tend to mist up over night, when the outside air is cold, particularly if the car is not parked in a garage (as mine isn’t). The simple solution to this is to start the engine a few minutes before leaving, with the fan and A/C on maximum, blowing on the inside of the windscreen. Newer cars have better solutions to this, but my car is old.

From inside my house, I can’t see my car windscreen, when it’s parked on my driveway.

So, what I want is a rule which uses Yahoo weather (or equivalent), to give me a guide as to whether or not my car windscreen is likely to be misted up, and, if so, to set all my downstairs lights (Phillips Hue) to blue a few minutes before my usual departure time, to tell me I need to go outside and start my engine, before finishing the rest of my morning routine. Even better, if I can determine how bad the misting is likely to be, I can have the lights go blue a little earlier or later, so that the windscreen is demisted at just the right time for me to leave.

Now, I’m no meteorology expert, but I believe the key to this will be the dew point - the temperature at which the moisture in the air condenses; if my windscreen is below that value, it will get misted up, and if it’s a long way below that value, it will be heavily misted. Bear in mind the windscreen is colder than the air (I think…), so the temperature of the glass will be below the air temperature.

I found somewhere online an easy way to estimate the dew point from just the temperature and humidity, which, conveniently, Yahoo Weather gives me, which is:

dewPoint = temperature - ((100 - humidity) / 5)

So, my plan is to have a rule which runs every minute for the half-hour before I normally leave for work, which calculates the most up-to-date dew point, as above, and compares it to the air temperature, then applies some kind of fudge factor to come up with a number of minutes before my usual leaving time that I should head out and start my engine.

Does that sound moderately sane?

1 Like

I’m not so in that meterology stuff, but why not try ist. Bute your dew point foprmula looks a little bit to simple. i created a lambda (it is like a function for OH) to calculate the dew pint from temperature and humidity.

//------------------------------------------------------------------------------------------------------------------------
//
//	Lambda: getDewPoint
//
// Berechnung des Taupunktes für eine gegebene Temperatur und Luftfeuchtigkeit
// 
// Beschreibung:
// Die Luft ist ein Gemisch verschiedener Gase. Eines dieser Gase ist der Wasserdampf. Die Menge an 
// Wasserdampf, die in der Luft enthalten sein kann, ist allerdings begrenzt. Je wärmer die Luft ist, 
// desto mehr Wasserdampf kann in ihr enthalten sein.
// 
// Die relative Luftfeuchtigkeit gibt an, wie viel Prozent des maximalen Wasserdampfgehaltes die Luft 
// im Augenblick enthält. Da der maximale Wasserdampfgehalt mit steigender Temperatur ansteigt, 
// fällt die relative Luftfeuchtigkeit mit steigender Temperatur (und umgekehrt).
// 
// Die Taupunkttemperatur ist definiert als die Temperatur, bei der der aktuelle Wasserdampfgehalt in 
// der Luft der maximale (100% relative Luftfeuchtigkeit) ist. Die Taupunkttemperatur ist damit eine von 
// der aktuellen Temperatur unabhängige Größe. Eine Möglichkeit die Taupunkttemperatur zu messen 
// ist das Abkühlen von Metall bis sich die Oberfläche mit Wasserdampf beschlägt. Dann ist die 
// Temperatur des Metalls die Taupunkttemperatur.
// 
// Es gibt keine exakte Formel zur Umrechnung der Taupunkttemperatur in die relative Luftfeuchtigkeit. 
// Zur Erstellung des Taupunktrechners habe ich eine einfache Näherungsformel benutzt. Eine exakte 
// Umrechnung ist nur mit experimentell ermittelten Tabellen möglich.
// 
// Aus Temperatur und relativer Luftfeuchte bzw. Temperatur und Taupunkt lässt sich auch der 
// absolute Feuchtegehalt der Luft in Gramm Wasserdampf pro Kubikmeter ausrechnen.
// 
// Formeln:
// Die Grundlage der Berechnungen ist die Näherungsformel für den Sättigungsdampfdruck ( Gleichung 1 ), 
// die sogenannte Magnusformel. Die relative Luftfeuchtigkeit ist definiert als das Verhältnis vom 
// augenblicklichen Dampfdruck zum Sättigungsdampfdruck (umgeformte Gleichung 2). Bei der 
// Taupunkttemperatur ist definitionsgemäß der Sättigungsdampfdruck gleich dem aktuellen Dampfdruck. 
// Aus diesen beiden Definitionen folgt unmittelbar Gleichung 3, die Formel zur Berechnung der 
// relativen Luftfeuchtigkeit aus der Taupunkttemperatur. Die 4. Gleichung beschreibt umgekehrt die 
// Berechnung der Taupunkttemperatur aus der relativen Luftfeuchtigkeit und der aktuellen Temperatur. 
// Diese 4. Gleichung ist im Grunde nichts anderes als die nach T aufgelöste 1. Gleichung , wobei für 
// den Sättigungsdampfdruck der aktuelle Dampfdruck (und nicht der aktuelle Sättigungsdampfdruck) 
// eingesetzt wird, so dass die Taupunkttemperatur und nicht die normale Temperatur als Ergebnis 
// herauskommt. Aus der allgemeinen Gasgleichung ergibt sich die 5. Gleichung .
// 
// Bezeichnungen:
// r = relative Luftfeuchte
// T = Temperatur in °C
// TK = Temperatur in Kelvin (TK = T + 273.15)
// TD = Taupunkttemperatur in °C
// DD = Dampfdruck in hPa
// SDD = Sättigungsdampfdruck in hPa
// 
// Parameter:
// a = 7.5, b = 237.3 für T >= 0
// a = 7.6, b = 240.7 für T < 0 über Wasser (Taupunkt)
// a = 9.5, b = 265.5 für T < 0 über Eis (Frostpunkt)
// 
// R* = 8314.3 J/(kmol*K) (universelle Gaskonstante)
// mw = 18.016 kg/kmol (Molekulargewicht des Wasserdampfes)
// AF = absolute Feuchte in g Wasserdampf pro m3 Luft
// 
// Formeln:
// SDD(T) = 6.1078 * 10^((a*T)/(b+T))
// DD(r,T) = r/100 * SDD(T)
// r(T,TD) = 100 * SDD(TD) / SDD(T)
// TD(r,T) = b*v/(a-v) mit v(r,T) = log10(DD(r,T)/6.1078)
// AF(r,TK) = 10^5 * mw/R* * DD(r,T)/TK; AF(TD,TK) = 10^5 * mw/R* * SDD(TD)/TK
// 
// Quelle: http://www.wetterochs.de/wetter/feuchte.html
// 
// Danke an Stefan Ochs von www.wetterochs.de
//
//------------------------------------------------------------------------------------------------------------------------
val org.eclipse.xtext.xbase.lib.Functions$Function2<Double, Double, Double> getDewPoint = [
	
	Double Temperature, 
	Double Humidity 
	
	|

	var Double a
	var Double b
	var Double SDD
	var Double DD
	var Double v
	var Double t = Temperature
	var Double h = Humidity
	
	if (t >= 0.0){ // T >= 0 °C
		a = 7.5
		b = 237.3
	} else { // T < 0 °C über Wasser
		a = 7.6
		b = 240.7
	}
	SDD=(6.1078 * Math::pow(10.0, ((a*t)/(b+t))))
	DD = (h/100.0*SDD)
	v = Math::log10((DD/6.107))
	return ((b*v)/(a-v))

]

Sorry that the description is in german, but for the start google will be your fried in translating it. The usage is simple. Find below my rule to calculate som values to display the in the sitemap.

rule "Update Outside Thermometer Data"
when

	Item OutsideThermometerTemperature received update or
	Item OutsideThermometerHumidity received update or
	System started

then

	if ((OutsideThermometerTemperature.state != NULL) && (OutsideThermometerHumidity.state != NULL))
	{

		var t = (OutsideThermometerTemperature.state as DecimalType).doubleValue
		var h = (OutsideThermometerHumidity.state as DecimalType).doubleValue
		
		OutsideThermometerCombined.sendCommand(String::format("%.1f°C / %.0f%%", t, h))
	
		OutsideThermometerDewPoint.postUpdate(getDewPoint.apply(t, h))
	
		logInfo("rule.climate.UpdateOutsideThermometerData", "Outside thermometer data updated")
		
	}

end

Thomas

2 Likes

Amazing, thank you! Exactly the sort of tip I was hoping for :slight_smile:

My high school Deutsch isn’t quite good enough to translate the description, so I’ll have to let Google do it for me, but it looks excellent. I’ll let you know how I get on.

Doesn’t any of the weather providers that are supported by the weather binding give an actual dewpoint? I’m using Open Weather, I can see a channel for dewpoint, but it is always .

I think the biggest problem is, that a information like that is a average value for a bigger area. But you need the exact value for the place in front of your house. There are many more factors that are influencing if your windscreen is misty or not. Even the bend of the windscreen has influences on that.

I didn’t see any, but I didn’t look overly carefully, it would be nice if there is one though. I shall dig a little deeper when I get time.

Thanks for this - it was a definite concern, I’m thinking that there must also be a huge range of factors in how quickly my car’s fan demists the windscreen, not to mention the variation in time it will take me to react to seeing the lights changing colour, especially if I happen to be half dressed at that moment!

Fundamentally, I guess it’s always going to be a rough estimate, so I wonder if maybe the more pragmatic approach would be to just come up with some very simple multiplier to say demisting time = ? x humidity / temperature, and just tweak the value of ? until I get something that mostly works.

Or alternatively rig up a constant light source outside the car with a detector inside, to calculate the exact amount of mistiness, but that’s probably a step too far :slight_smile:

Yeah, after a few days of experimentation, it’s clear that you’re right, and I need much more information, more local values would help, but even then, yesterday morning it was -2 deg C (according to my car’s thermometer) and felt humid (although obviously that’s pretty hard to judge), but neither my car nor any others in my street had misty or frosty windows :frowning:

Ah well, a fun experiment and good reason to play with the rules; I’ll just come up with a fixed time before my usual leave time if it’s a bit cold, to look at my car and decide whether I need to start the engine early or not.

I have read a few essays and articles on this subject. Most of them in German, so it wouldn’t help if I tell you the original sources. :slight_smile: Fortunately, my first statement was too pessimistic.

I keep myself briefly. If the temperature of the car windows drops below the dew point, the thin ice layer forms on them. For example, we have -0.5 ° C, the dew point is -4.4 ° C. Therefore there is currently no danger. But the temperature on my car is already below -0.5 ° C. This is due to the wind and the heat exchange with the universe (yes, no joke). I think if you keep the values temperature, dew point, windchill or felt temperature times over a few days in the eye, you should be able to derive a simple formell. Maybe you can temporarily install a temperature sensor on the front panel of your car and add this value along with the other values into a chart.

1 Like

Somewhere in the internet you will find some formulas to calculate the windchill

Thomas

1 Like

This community is awesome! I love that you did this - hopefully you were interested as well! I think you’re absolutely right, thank you for condensing it into such a concise format. The problem with all this is that my aim is to streamline my morning routine - there’s no room in there to be recording meteorological data! :smiley:

I will definitely come back to this (perhaps in time for next winter!), but for now, I have other bits of OpenHAB I want to play with, which are more exciting. :slight_smile:

Also - I think there’s an additional factor which you maybe haven’t considered - whether or not the temperature is above 0°C. If it’s below (and has been for most of the night, I suppose), we have ice to melt, if it’s above, we only have condensation to clear from the inside (the windscreen wipers can take care of the outside). I’m not sure how this varies by location (probably a lot), but our famously wonderful British weather means it tends to be about 0°C most winter mornings, so any day could be either case…