Open GlennGoddard opened 1 year ago
oh, we could do vapor pressure and humidity index as their own sensors also. I did see that you had vapor pressure in your original UDP repository but I don't see it here, is there a reason or just forgot?
Updated, still testing. Waiting for an 80F day.
// Apparent Temperature: The perceived temperature in degrees Fahrenheit derived from either a combination of temperature and wind (Wind Chill) or temperature and humidity (Heat Index) for the indicated hour. When the temperature at a particular grid point falls to 50 F or less, wind chill will be used for that point for the Apparent Temperature. When the temperature at a grid point rises above 80 F, the heat index will be used for Apparent Temperature. Between 51 and 80 F, the Apparent Temperature will be the ambient air temperature
// https://meteor.geol.iastate.edu/~ckarsten/bufkit/apparent_temperature.html
T = msg.temperature
rh = msg.humidity
v = msg.wind_speed
sr = msg.sr // Solar Radiation
wind_chill = msg.wind_chill
c1 = -42.38
c2 = 2.049
c3 = 10.14
c4 = -0.2248
c5 = -0.006838
c6 = -0.05482
c7 = 0.001228
c8 = 0.0008528
c9 = -0.00000199
HI = c1 + c2*T + c3*rh + c4*T*rh + c5*T*T + c6*rh*rh + c7*T*T*rh + c8*T*rh*rh + c9*T*T*rh*rh
if (T <= 50) {
AT = wind_chill;
} else if (T <= 80){
AT = T;
} else{
AT = HI;
}
AT = Math.round(AT*100)/100
//AT = (Math.round(((AT * 1.8) + 32)*100))/100
msg.payload = AT
return msg;
New Feature
I always wanted a better 'feels like temperature' that incorporates sun light, I finally found it. I just didn't know it was call apparent temperature.
Additional context
I won't overload you with PRs at this time. I will wait until 'Current Conditions' is done. This is just the bulk of the calculation, making it pretty comes later.