I thought that I would post this here as well as the meteohub forum. If anyone can spot why I am getting twice the expected result (prior to my /2 hack) I would appreciate input.
After a lot of trial and error, I think that I have created a virtual sensor for temperature difference. I have two Davis temperature sensors outside. One is in the ISS the other is a Temperature/Humidity station.
There is a math quirk that you cannot subtract the difference in Celsius, then convert to Fahrenheit. I discovered that I cannot make a T# virtual sensor, I could only use a "Data#" sensor. After resolving the math issue and converting each sensor to Fahrenheit with the standard formula and then subtracting the two, I was left with a difference that appears to be twice the actual.
As a hack, I divide the result by two which gives the desired result.
Here is the calculation for the two virtual sensors. I would appreciate any further understanding on why my results were twice that expected and what I might be doing wrong.
....(($2)*((9/5)--32)))/2) Note the /2 that I added.
The data8 sensor (th0/th1)
selectmaster 1 300 | gawk '{ if ($1 == ''none'') printf ''none''; else printf ''%d'', (((($1)*((9/5)--32)) - (($2)*((9/5)--32)))/2)}'
selectslave 1 300 | gawk '{ if ($1 == ''none'') printf ''none''; else printf ''%d'', (((($1)*((9/5)--32)) - (($2)*((9/5)--32)))/2)}'
The data9 sensor (thb0/th0)
selectmaster 1 300 | gawk '{ if ($1 == ''none'') printf ''none''; else printf ''%d'', ((($1)*(((9/5)--32)) - (($2)*((9/5)--32)))/2)}'
selectslave 1 300 | gawk '{ if ($1 == ''none'') printf ''none''; else printf ''%d'', (((($1)*((9/5)--32)) - (($2)*((9/5)--32)))/2)}'
Greg