I am using a Seeed S2105 soil moist/temp sensor on a VP2 with weewx 4.10.2. 
I'm attempting to change the units from "cb" to "VWC" as the sensor data 
displays a percentage VWC.

My additions to extensions.py are as follows:

# Specify what group our observation type belongs to
weewx.units.obs_group_dict['signal1'] = 'group_cpm'
weewx.units.obs_group_dict['signal2'] = 'group_sievert'
*weewx.units.obs_group_dict['soilMoist1'] = 'group_moisture'*

# Specify what unit is used to measure cpm & microsievert in the three 
standard unit systems used by weewx.
weewx.units.USUnits['group_cpm'] = 'cpm'
weewx.units.MetricUnits['group_cpm'] = 'cpm'
weewx.units.MetricWXUnits['group_cpm'] = 'cpm'
weewx.units.USUnits['group_sievert'] = 'uSv'
*weewx.units.USUnits['group_moisture'] =  'VWC'*

# Specify what formats and labels to use for cpm & microsievert
weewx.units.default_unit_format_dict[' cpm'] = '%.0f'
weewx.units.default_unit_label_dict[' cpm']  = ' cpm'
weewx.units.default_unit_format_dict['microsievert'] = '%.2f'
weewx.units.default_unit_label_dict['microsievert']  = 'uSv'
weewx.units.default_unit_format_dict['VWC'] = '%.1f'
*weewx.units.default_unit_label_dict['VWC'] = ' VWC'*

The error I get when running "wee_reports" is:

sudo ./wee_reports
Generating as of last timestamp in the database.
Using configuration file /home/weewx/weewx.conf
Traceback (most recent call last):
  File "/home/weewx/bin/weewx/reportengine.py", line 197, in run
    obj.start()
  File "/home/weewx/bin/weewx/reportengine.py", line 385, in start
    self.run()
  File "/home/weewx/bin/weewx/imagegenerator.py", line 42, in run
    self.gen_images(self.gen_ts)
  File "/home/weewx/bin/weewx/imagegenerator.py", line 107, in gen_images
    plot = self.gen_plot(plotgen_ts,
  File "/home/weewx/bin/weewx/imagegenerator.py", line 279, in gen_plot
    new_data_vec_t = self.converter.convert(data_vec_t)
  File "/home/weewx/bin/weewx/units.py", line 919, in convert
    new_val_t = convert(val_t, new_unit_type)
  File "/home/weewx/bin/weewx/units.py", line 1454, in convert
    conversion_func = conversionDict[val_t[1]][target_unit]
KeyError: 'VWC'

I know I'm missing a step somewhere but can't seem to find it. I'm still 
showing on the Standard skin:

Soil Moisture (VWC)  26 cb at 16:00 
Soil Temperature 62.4°F at 16:00 
Soil Conductivity (dSm) 0.010000 at 16:00

Thanks in advance of any suggestions.
Cheers,
Bob
http://grattans.org/wx

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/weewx-user/6ad8b5fb-5cc7-4643-876a-6e78151da225n%40googlegroups.com.

Reply via email to