Interceptor + gw1000 + remote temp/soil sensors

68 views
Skip to first unread message

John Hill

unread,
May 13, 2020, 7:29:28 PM5/13/20
to weewx-user
Hi,
Finally got around to adding more temp/soil sensors to my setup (3.9.2, gw1000, interceptor).  Everything went fine, except for some reason the unit is missing from the last temp sensor i added (extraTemp8) and the last soil sensor I added (soilMoist5):

Untitled.png



Those sensors are being read and mapped by interceptor correctly (temperature_8 and soil_moisture_5):

raw data: PASSKEY=XXXX&stationtype=GW1000B_V1.5.8&dateutc=2020-05-13+19:58:30&tempinf=77.9&humidityin=51&baromrelin=30.070&baromabsin=30.070&tempf=86.7&humidity=41&winddir=96&windspeedmph=14.76&windgustmph=22.82&maxdailygust=26.17&solarradiation=228.73&uv=2&rainratein=0.000&eventrainin=0.000&hourlyrainin=0.000&dailyrainin=0.000&weeklyrainin=0.531&monthlyrainin=1.220&yearlyrainin=10.929&totalrainin=10.929&temp1f=77.54&humidity1=51&temp2f=78.44&humidity2=50&temp3f=77.54&humidity3=51&temp4f=88.34&humidity4=38&temp5f=76.10&humidity5=58&temp6f=77.54&humidity6=50&temp7f=76.46&humidity7=52&temp8f=77.72&humidity8=50&soilmoisture1=26&soilmoisture2=42&soilmoisture3=38&soilmoisture4=43&soilmoisture5=38&wh68batt=1.52&wh40batt=1.6&wh26batt=0&batt1=0&batt2=0&batt3=0&batt4=0&batt5=0&batt6=0&batt7=0&batt8=0&soilbatt1=1.7&soilbatt2=1.7&soilbatt3=1.5&soilbatt4=1.6&soilbatt5=1.8&freq=915M&model=GW1000_Pro

raw packet: {'temperature_2': 78.44, 'temperature_3': 77.54, 'temperature_1': 77.54, 'temperature_6': 77.54, 'temperature_7': 76.46, 'temperature_4': 88.34, 'temperature_5': 76.1, 'temperature_8': 77.72, 'soil_battery_2': 1.7, 'humidity_7': 52.0, 'soil_battery_4': 1.6, 'dateTime': 1589399910, 'humidity_1': 51.0, 'battery_8': 0.0, 'battery_7': 0.0, 'battery_6': 0.0, 'battery_5': 0.0, 'battery_4': 0.0, 'battery_3': 0.0, 'battery_2': 0.0, 'battery_1': 0.0, 'temperature_out': 86.7, 'wind_dir': 96.0, 'rain_total': 10.929, 'humidity_in': 51.0, 'humidity_4': 38.0, 'soil_battery_1': 1.7, 'humidity_6': 50.0, 'soil_battery_3': 1.5, 'solar_radiation': 228.73, 'soil_battery_5': 1.8, 'humidity_2': 50.0, 'humidity_3': 51.0, 'rain_rate': 0.0, 'humidity_8': 50.0, 'rain': 0.0, 'pressure': 30.07, 'usUnits': 1, 'wind_speed': 14.76, 'temperature_in': 77.9, 'wind_gust': 22.82, 'humidity_5': 58.0, 'humidity_out': 41.0, 'uv': 2.0, 'wh26_battery': 0.0, 'soil_moisture_1': 26.0, 'soil_moisture_2': 42.0, 'soil_moisture_3': 38.0, 'soil_moisture_4': 43.0, 'soil_moisture_5': 38.0}

mapped packet: {'outHumidity': 41.0, 'extraHumid8': 50.0, 'soilMoist3': 38.0, 'soilMoist2': 42.0, 'rainRate': 0.0, 'radiation': 228.73, 'soilMoist1': 26.0, 'inTemp': 77.9, 'soilMoist4': 43.0, 'rain': 0.0, 'extraHumid6': 50.0, 'pressure': 30.07, 'extraHumid4': 38.0, 'extraHumid5': 58.0, 'extraHumid2': 50.0, 'extraHumid3': 51.0, 'extraTemp8': 77.72, 'extraHumid1': 51.0, 'extraTemp6': 77.54, 'extraTemp7': 76.46, 'extraTemp4': 88.34, 'extraTemp5': 76.1, 'extraTemp2': 78.44, 'extraTemp3': 77.54, 'usUnits': 1, 'extraTemp1': 77.54, 'extraHumid7': 52.0, 'UV': 2.0, 'dateTime': 1589399910, 'windDir': 96.0, 'outTemp': 86.7, 'windSpeed': 14.76, 'inHumidity': 51.0, 'windGust': 22.82}


My current.inc shows extraTemp8 isn't referenced any differently than the other extraTemps:
#if $day.extraTemp7.has_data
      <tr>
        <td class="label">$obs.label.extraTemp7</td>
        <td class="data">$current.extraTemp7</td>
      </tr>
#end if
#if $day.extraTemp8.has_data
      <tr>
        <td class="label">$obs.label.extraTemp8</td>
        <td class="data">$current.extraTemp8</td>
      </tr>
#end if

Also tried rebuilding my DB, just in case, but values are still not formatted correctly with units.

Any ideas?
Message has been deleted

John Hill

unread,
May 13, 2020, 7:32:44 PM5/13/20
to weewx-user
oops, image looks small inline in 1st post.  Attaching it here:
Untitled.png

gjr80

unread,
May 13, 2020, 9:22:14 PM5/13/20
to weewx-user
Hi,

The problem is that whilst the database schema you are using may know about extraTemp8 and soilMoist5 the WeeWX unit system only knows about extraTemp1-extraTemp7 and soilMoist1-soilMosit4, you need a little python code to have extraTemp8 and solMoist5 recognised by the unit system. Try adding the following code to extensions.py (you will find extensions.py in /home/weewx/bin/user or /usr/share/weewx/user depending on your WeeWX install):

import weewx.units
weewx
.units.obs_group_dict['extraTemp8'] = 'group_temperature'
weewx
.units.obs_group_dict['soilMoist5'] = 'group_moisture'

Save extensions.py and restart WeeWX. You should now have units and formatting on extraTemp8 and soilMoist5. If you are interested the section Customizing units and unit groups in the Customization Guide covers this.

Gary

John Hill

unread,
May 13, 2020, 9:34:37 PM5/13/20
to weewx-user
Bingo.

I never would have figured that out on my own.  Thanks Gary,

Just out of curiosity, where are all the other group associations stored (from import weewx.units)?  I'm curious why/how extraTemp8 wasn't set to be the same as extraTemp1-7.

gjr80

unread,
May 13, 2020, 9:52:44 PM5/13/20
to weewx-user
You will find them here in units.py. WeeWX takes care of those fields that are in the default schema, anything else needs the user to take care of it. WeeWX allows you to access fields in the current archive record (accessed through the $current tag) that have not been saved to your database. If you want to access aggregates (eg $day.xxxx.max) then the obs concerned (xxxx) must be in your database schema and xxxx saved to your database. I was likely wrong in my previous post, extraTemp8 and soilMoist5 are likely not in your schema/archive, the interceptor driver will have added extraTemp8 and soilMoist5 to loop packets and this will have caused WeeWX to include them in the archive record but they will were likely not saved to your archive. So $current.extraTemp8 will work but I expect $day.extraTemp8.max will not.

If you want to add extraTemp8 and soilMoist5 to your database so that you can view the aggregates you will need to refer to the section Adding a new type to the database in the Customization Guide.

Gary

John Hill

unread,
May 14, 2020, 7:25:14 AM5/14/20
to weewx-user
ahhh... that's it. for some reason extraTemp only goes up to 7 in units.py

I had already added the fields I needed to the DB so should be good to go.  thx again!
Reply all
Reply to author
Forward
0 new messages