[Q] Dewpoint

Search This thread

robgross

Member
May 2, 2014
8
0
New Mexico
I am trying to figure out how to calculate dewpoint from temperature and humidity. The formula is ridiculously long, but there is a simple formula that gives an approximation, which is good enough for my purposes.

Td = T - ((100 - RH)/5).

Td = Dewpoint in degrees Celcius
T = Temperature in degrees Celcius
RH = Humidity

Since my phone is in degrees F. I had to convert to degrees C. This is what I did, but it doesn't work, I think because of the % symbol attached to the humidity variable: $int((#WCTEMP#-32)*5/9))-(100-#WCHUM#)/5)$. The problem is, it just displays exactly what I typed, it doesn't do the math. Can anyone point a noob in the right direction? It is probably obvious, but I am still trying to figure out zooper.

I have seen other requests for a dewpoint variable on the forums, so there is a demand out there. Any help would be appreciated, thanks!
 
Christmas in May!

Dave Handler shares a file with you, please click the link to download: http://dl.dropboxusercontent.com/1/view/qqiv1skjchq7ifu/Tasker Projects/Yahoo_Weather.prj.xml

In it are two tasks Input Zip code which uses a scene to well, get the zip!

The other task is Get Yahoo Weather. That uses a variable that gets set when you set the zip code.

Set your zip and the run the weather task and then check the variables tabs. You'll see every thing that is supplied including the five day forecast.

You'll have to figure what you want and pass it on to Zooper. Every variable for weather is global!

Enjoy!

p.s. everything is in standard units. Fahrenheit, mph and inches. This only thing I didn't do is give you an indicator if the barometric pressure is falling, stable or rising. If you need it I can put it in there!

Sent from my Nexus 5 using Tapatalk
 
  • Like
Reactions: robgross

g.andi

Senior Member
Sep 18, 2014
525
211
I know its an old thread and i was seaching in this thread too; and now i solved by myself. I post here the solution for tasker if someone needs it:
You need to set up or read out from web 2 variables (%temp = temperature and %hum = humidity), once you have set the 2 variables you need to add a code java scriplet to the task to calculate dewpoint and absolute humidity:

function taupunkt() {
if ( (temp == null || temp == 0) ||
(hum == null || hum == 0) ) {
return;
}
var a1=7.45;
var b1=235;
tp=temp;
fw=hum;
tp=tp*1;
fw=fw*1;
x1=(a1*tp)/(b1+tp);
e1=6.1*Math.exp(x1*2.3025851);
e2=e1*fw/100;
x2=e2/6.1;
x3=0.434292289*Math.log(x2);
taux=(235*x3)/(7.45-x3)*100;
taux=Math.floor(taux)/100;
feux=(216.7*e2)/(273.15+tp)*100;
feux=Math.round(feux)/100;
var TAUX = taux;
setGlobal("TAUX", TAUX );
var FEUX = feux;
setGlobal("FEUX", FEUX );
exit ();
}
taupunkt()

The java scriplet calculate the dewpoint and the absolute humdity and stores it in the variable %TAUX (dewpoint) and %FEUX (absolute humidity). Now you can make a popup alert or whatever you want and display the dewpoint calling %TAUX and the absolute humidity %FEUX
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Do you own Tasker?

    You could do an https get on yahoo weather api and get all the info from there.

    Its not to terribly difficult. Probably on the intermediate level.

    Sent from my Nexus 5 using Tapatalk
    1
    Its a great app!

    Sent from my Nexus 5 using Tapatalk
    1
    Christmas in May!

    Dave Handler shares a file with you, please click the link to download: http://dl.dropboxusercontent.com/1/view/qqiv1skjchq7ifu/Tasker Projects/Yahoo_Weather.prj.xml

    In it are two tasks Input Zip code which uses a scene to well, get the zip!

    The other task is Get Yahoo Weather. That uses a variable that gets set when you set the zip code.

    Set your zip and the run the weather task and then check the variables tabs. You'll see every thing that is supplied including the five day forecast.

    You'll have to figure what you want and pass it on to Zooper. Every variable for weather is global!

    Enjoy!

    p.s. everything is in standard units. Fahrenheit, mph and inches. This only thing I didn't do is give you an indicator if the barometric pressure is falling, stable or rising. If you need it I can put it in there!

    Sent from my Nexus 5 using Tapatalk