ExtraTemp1 as Outside Temperature

82 views
Skip to first unread message

Søren Helskov

unread,
Jan 29, 2022, 4:27:56 AM1/29/22
to weewx-user
Hi 

I have this TE923 weatherstation that has been running with Weewx for almost 
7 years now.
My problem is that on Channel 1 on my weather station, i have some strange sensor reporting in, with wrong value and overwriting my local sensor. I think it could be my neighbours weather station of same brand. 
I have now changed my outdoor sensor to channel 2. 
But in weewx it results in i now have Outside Temperature with wrong value and a new measurement called Temperature 1. 

I dont want to rename Temperature 1 to Outside as i have 7 years of log data on the Outside Temperature. So i would like to switch, so the Channel 1 is Temperature 1 and Channel 2 is outside Temperature. 
I have tried to look in weewx.conf but its only labels. 

Hope someone can help my. 

Søren Helskov

unread,
Jan 29, 2022, 5:06:52 AM1/29/22
to weewx-user
From the driver:
I Would like to Map t_2 to Outside Temperature
Where are all these mapped?

Using configuration file /etc/weewx/weewx.conf
Using TE923 driver version 0.41.1 (weewx.drivers.te923)
Querying the station for current weather data...
        dateTime: 1643449936
        forecast: 5
             h_1: 48
       h_1_state: ok
             h_2: 91
       h_2_state: ok
             h_3: 56
       h_3_state: ok
             h_4: None
       h_4_state: no_link
             h_5: None
       h_5_state: no_link
            h_in: 51
      h_in_state: ok
            rain: 520
      rain_state: ok
             slp: 1004.0625
       slp_state: ok
           storm: 0
             t_1: 24.6
       t_1_state: ok
             t_2: 8.2
       t_2_state: ok
             t_3: 15.9
       t_3_state: ok
             t_4: None
       t_4_state: no_link
             t_5: None
       t_5_state: no_link
            t_in: 25.95
      t_in_state: ok
              uv: None
        uv_state: no_link
       windchill: 7.4
 windchill_state: ok
         winddir: 8
   winddir_state: ok
        windgust: 4.5
  windgust_state: ok
       windspeed: 2.6
 windspeed_state: ok

Michael

unread,
Jan 29, 2022, 5:37:42 AM1/29/22
to weewx-user
In the directory /usr/share/weewx/weewx/drivers you should find the file te923.py. From line 473 you will find the mappings starting with DEFAULT_MAP = {
...
    'outTemp': 't_1',
    'outHumidity': 'h_1',
    'extraTemp1': 't_2',
    'extraHumidity1': 'h_2',


by:
    'outTemp': 't_2',
    'outHumidity': 'h_2',
# 'extraTemp1': 't_2',
# 'extraHumid1': 'h_2',

replace.

Please make a copy of te923.py before editing.


Michael

Søren Helskov

unread,
Jan 29, 2022, 5:47:52 AM1/29/22
to weewx-user
Hi Thanks Michael

Was really helpful and solved my problem.

I was really looking in the documentation here
https://www.weewx.com/ 
but found nothing. :(

Best Regards.

matthew wall

unread,
Jan 29, 2022, 10:13:54 AM1/29/22
to weewx-user
you can do this in the weewx configuration file using the 'sensor_map' in the TE923 section.

the default sensor map looks like this (you should see this in your weewx configuration file, but it is probably commented, since it is the default behavior):

[TE923]
    ...
    [[sensor_map]]
        windLinkStatus = link_wind
        windBatteryStatus = bat_wind
        rainLinkStatus = link_rain
        rainBatteryStatus = bat_rain
        uvLinkStatus = link_uv
        uvBatteryStatus = bat_uv
        inTemp = t_in
        inHumidity = h_in
        outTemp = t_1
        outHumidity = h_1
        outTempBatteryStatus = bat_1
        outLinkStatus = link_1
        extraTemp1 = t_2
        extraHumid1 = h_2
        extraBatteryStatus1 = bat_2
        extraLinkStatus1 = link_2
        extraTemp2 = t_3
        extraHumid2 = h_3
        extraBatteryStatus2 = bat_3
        extraLinkStatus2 = link_3
        extraTemp3 = t_4
        extraHumid3 = h_4
        extraBatteryStatus3 = bat_4
        extraLinkStatus3 = link_4
        extraTemp4 = t_5
        extraHumid4 = h_5
        extraBatteryStatus4 = bat_5
        extraLinkStatus4 = link_5

to change the sensor mapping, uncomment the entire sensor map, or, if it is not yet in your weewx configuration, paste it into the TE923 section.  you must specify the entire sensor map, not just a single item.

then, to swap channel 1 and channel 2, change this:

        outTemp = t_1
        outHumidity = h_1
        outTempBatteryStatus = bat_1
        outLinkStatus = link_1
        extraTemp1 = t_2
        extraHumid1 = h_2
        extraBatteryStatus1 = bat_2
        extraLinkStatus1 = link_2

to this:

        outTemp = t_2
        outHumidity = h_2
        outTempBatteryStatus = bat_2
        outLinkStatus = link_2
        extraTemp1 = t_1
        extraHumid1 = h_1
        extraBatteryStatus1 = bat_1
        extraLinkStatus1 = link_1

by changing the configuration file, your changes will persist even when you update/upgrade weewx.

and be sure that your neighbor does not also use channel 2!

m
Reply all
Reply to author
Forward
0 new messages