Calculated weather data

Calculation of wind chill temperature (WCT)

Wind-chill is the lowering of body temperature due to the passing-flow of lower-temperature air.

Wind chill numbers are always lower than the air temperature for values where the formula is valid. When the apparent temperature is higher than the air temperature, the heat index is used instead.

var temperature = global.get("gv_home_outdoor_weather_temperature");
var windspeed = global.get("gv_home_outdoor_weather_windspeed");

var WCT = 13.12 + 0.6215 * temperature - 11.37 * Math.pow(windspeed, 0.16) + 0.3965 * temperature * Math.pow(windspeed, 0.16);
msg.payload = (Number(WCT)).toFixed(1);

return msg;

Calculation of dewpoint

The dew point is the temperature to which air must be cooled to become saturated with water vapor. When cooled further, the airborne water vapor will condense to form liquid water (dew). When air cools to its dew point through contact with a surface that is colder than the air, water will condense on the surface. When the temperature is below the freezing point of water, the dew point is called the frost point, as frost is formed rather than dew.[3] The measurement of the dew point is related to humidity. A higher dew point means there is more moisture in the air.

var temperature = global.get("gv_home_outdoor_weather_temperature");
var humidity = global.get("gv_home_outdoor_weather_humidity");

if(temperature > 0) {
	} else {
// Calculate dew point
// Round dew point
msg.payload = Math.round(dewpoint*100)/100;

return msg;