Virtual sensor for temperature difference problem **solved**

Discussion of the Meteohub software package

Moderator: Mattk

Post Reply
miraculon
Senior Boarder
Senior Boarder
Posts: 56
Joined: Sun Dec 15, 2013 3:02 pm

Virtual sensor for temperature difference problem **solved**

Post by miraculon »

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)

Code: Select all

selectmaster 1 300 | gawk '{ if ($1 == ''none'') printf ''none''; else printf ''%d'',  (((($1)*((9/5)--32)) - (($2)*((9/5)--32)))/2)}'

Code: Select all

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)

Code: Select all

selectmaster 1 300 | gawk '{ if ($1 == ''none'') printf ''none''; else printf ''%d'', ((($1)*(((9/5)--32)) - (($2)*((9/5)--32)))/2)}'

Code: Select all

selectslave 1 300 | gawk '{ if ($1 == ''none'') printf ''none''; else printf ''%d'',  (((($1)*((9/5)--32)) - (($2)*((9/5)--32)))/2)}'
Greg
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7878
Joined: Mon Oct 01, 2007 10:51 pm

Re: Virtual sensor for temperature difference problem

Post by admin »

formular for converting Fahrenheit/Celsius was wrong.
Post Reply