Author Topic: (Resolved) Why cant weewx calcualte the difference between inTemp and outTemp?  (Read 2117 times)

0 Members and 1 Guest are viewing this topic.

Offline BaseLine

  • Senior Contributor
  • ****
  • Posts: 184
I use C so and all the plots are in C.
For some reason, calcualting the difference between inTemp and outTemp, gives an incorrect result.

Code: [Select]
          [[[daydiff]]]
             [[[[diff]]]]
         
                 data_type = inTemp - outTemp
                 label = Inside - Outside
Inside temperature: +22 C
Outside temperature: -7 C

Graph plots 47?
« Last Edit: March 06, 2023, 06:23:29 AM by BaseLine »
Sun cooked nothingburger of climate change hysteria with a side order of peak-oil nonsense fries.

Offline BaseLine

  • Senior Contributor
  • ****
  • Posts: 184
Re: Why cant weewx calcualte the difference between inTemp and outTemp?
« Reply #1 on: February 26, 2023, 04:39:52 AM »
Added another censor readouts for finding the diff and it's also off.

The difference between -1.9C and +3.4C is 12.

 ](*,)
Sun cooked nothingburger of climate change hysteria with a side order of peak-oil nonsense fries.

Offline zoomx

  • Senior Contributor
  • ****
  • Posts: 184
Re: Why cant weewx calcualte the difference between inTemp and outTemp?
« Reply #2 on: March 04, 2023, 11:13:06 AM »
I wander if weewx record temperature in F instead of C and the conversion is done during display.

So the difference is calculated in F

Offline SnowHiker

  • Forecaster
  • *****
  • Posts: 352
Re: Why cant weewx calcualte the difference between inTemp and outTemp?
« Reply #3 on: March 04, 2023, 12:06:04 PM »
I wander if weewx record temperature in F instead of C and the conversion is done during display.

So the difference is calculated in F

Not likely.  The difference between -1.9C and 3.4C is 9.54F, not 12. And from his first post the difference isn't even consistent, not 9/5 off as you would expect if it was calculating in F.

Vince has shown that WeeWX can calculate the difference between in and out Temp, so I suspect that there is some kind of user error, a typo in a config file or somewhere, or some other adjustment he's made somewhere.  You can't tell anything from the example he's provided, he should show the inTemp, outTemp, and the difference on the same chart to show what he's seeing.
« Last Edit: March 04, 2023, 01:00:09 PM by SnowHiker »

Offline SnowHiker

  • Forecaster
  • *****
  • Posts: 352
Re: Why cant weewx calcualte the difference between inTemp and outTemp?
« Reply #4 on: March 04, 2023, 05:37:34 PM »
I wander if weewx record temperature in F instead of C and the conversion is done during display.

Also whether the temperature is stored in F or C could easily be determined by looking at the database.

Offline vinceskahan

  • Senior Contributor
  • ****
  • Posts: 178
    • home site
Re: Why cant weewx calcualte the difference between inTemp and outTemp?
« Reply #5 on: March 05, 2023, 01:52:44 PM »
Try the following command, all on one line.  I've attached my output...

$ echo "select usUnits,datetime(dateTime,'unixepoch','localtime'),dateTime,inTemp,outTemp,inTemp-outTemp
from archive order by rowid desc limit 5;" | sqlite3 /home/weewx/archive/weewx.sdb

1|2023-03-05 10:45:00|1678041900|73.0|43.3|29.7
1|2023-03-05 10:40:00|1678041600|73.0|44.3|28.7
1|2023-03-05 10:35:00|1678041300|73.1|44.5|28.6
1|2023-03-05 10:30:00|1678041000|73.3|44.2|29.1
1|2023-03-05 10:25:00|1678040700|73.5|43.9|29.6


If you see a '1' in the first column, you are using US units.  A 16 or 17 there is metric with the only difference being which units wind speed is in.
WeeWX sites:
  Davis VP2+DFARS to a pi4
  EcoWitt GW1000, WH32 outdoor T+H, multiple WH31 indoor T+H, WH51 soilMoisture (docker)
  Davis AirLink (inside)
  PurpleAir (outside)
Home site:        https://www.skahan.net/
Wunderground: KWAFEDER15
PWS:                KWFEDER15
CWOP:              CW6881

Offline BaseLine

  • Senior Contributor
  • ****
  • Posts: 184
Re: Why cant weewx calcualte the difference between inTemp and outTemp?
« Reply #6 on: March 06, 2023, 06:22:41 AM »
It seems that data is written in F's. 

Fix was simple: divide the result by 1.8

BTW, is F WS90's default? Can this be changed somehow on WS90 side?

(Silly US units in a product sold internationally... LOL)

Sun cooked nothingburger of climate change hysteria with a side order of peak-oil nonsense fries.

Offline zoomx

  • Senior Contributor
  • ****
  • Posts: 184
Among my weather stations I have some Ecowitt gateway.
Data are trasmitted from sensors in SI units or derived.
If you pull data using GW1000 API they are in SI.
But Wunderground protocol and Ecowitt protocol for uploading use USA units.

Offline BaseLine

  • Senior Contributor
  • ****
  • Posts: 184
I use GW2000 and units are set to C etc.
I guess it's weewex that converts it to 3 grains of barley, frogs farts and slaty water units. Strange, because when I did the first install, I set it to metric.
Sun cooked nothingburger of climate change hysteria with a side order of peak-oil nonsense fries.

Offline zoomx

  • Senior Contributor
  • ****
  • Posts: 184
If you use the plugin that fetch data from the GW2000 (like the app do), they are in SI but if you use the Ecowitt protocol data are transmitted in USA units also if your GW2000 is set in SI. Unfortunately the protocol use only USA units.