Author Topic: Odd unit/decimal values with Ecowitt soil moisture sensors  (Read 749 times)

0 Members and 1 Guest are viewing this topic.

Offline esandman24

  • Member
  • *
  • Posts: 1
Odd unit/decimal values with Ecowitt soil moisture sensors
« on: November 07, 2020, 11:08:01 PM »
So, I got things set up and mostly working, but there is some kind of odd data conversion error happening.

Here's the copy/paste of my moisture sensors using the test driver (all looks normal here):
soilMoist1: 51, soilMoist2: 29, soilMoist3: 21, soilMoist4: 43, soilMoist5: 26, soilMoist6: 41, soilMoist7: 44, soilMoist8: 35

What I get in the front end, though, is this (notice the cb vaues vs the 6 decimal point values):
Peas   51 cb
Azalea   29 cb
Locust   21 cb
Clematis   42 cb
Fuscia   26.000000
Dogwood   41.000000
Hilltop   44.000000
Blueberries   35.000000

Any help would be appreciated, thanks!!

Edit: Further looking, it seems like the default group_moisture lists members soilMoist1-4 (per http://weewx.com/docs/customizing.htm#units), I'm wondering if I somehow need to modify that group to include the extra 4 sensors?
« Last Edit: November 08, 2020, 12:03:07 AM by esandman24 »

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3324
Re: Odd unit/decimal values with Ecowitt soil moisture sensors
« Reply #1 on: January 05, 2021, 09:20:50 AM »
So, I got things set up and mostly working, but there is some kind of odd data conversion error happening.

Here's the copy/paste of my moisture sensors using the test driver (all looks normal here):
soilMoist1: 51, soilMoist2: 29, soilMoist3: 21, soilMoist4: 43, soilMoist5: 26, soilMoist6: 41, soilMoist7: 44, soilMoist8: 35

What I get in the front end, though, is this (notice the cb vaues vs the 6 decimal point values):
Peas   51 cb
Azalea   29 cb
Locust   21 cb
Clematis   42 cb
Fuscia   26.000000
Dogwood   41.000000
Hilltop   44.000000
Blueberries   35.000000

Any help would be appreciated, thanks!!

Edit: Further looking, it seems like the default group_moisture lists members soilMoist1-4 (per http://weewx.com/docs/customizing.htm#units), I'm wondering if I somehow need to modify that group to include the extra 4 sensors?
First of all, it would be helpful to know what's your hardware/OS setup ? (Raspberry Pi, other Linux distributions, Windows, ...)
The below reply assumes, that you use a linux (clone) system like a Debian-based Raspberry Pi/Raspbian.

Weewx natively only supports SoilMoisture sensors 1 - 4 in its database schema.
For more SM sensors you have to either repurpose unused sensors from the extended database scheme, create a field map or extend the database schema yourself.
Whichever option you choose, you have to make sure that the fields (table columns) chosen belong to the proper unit group. Otherwise some default will be taken which gives you the (for your eyes) strange looking real numbers.

You would probably have to add a few entries to the file /usr/share/weewx/user/extensions.py  (path depending on installation method and Operation System, could also be /home/weewx/...)
For each of your fields beyond SM4, you should have an entry in your extensions.py file like shown below
replace "SMx-SensorName" by the real name of your sensor field e.g. SoilMoist5 etc. - this will depend on your implementation of the fields for the Sensors 5-8
So four lines will be needed (5 with the import line if it doesn't exist yet).

import weewx.units
weewx.units.obs_group_dict['SM5-SensorName'] = 'group_moisture'
weewx.units.obs_group_dict['SM6-SensorName'] = 'group_moisture'
weewx.units.obs_group_dict['SM7-SensorName'] = 'group_moisture'
weewx.units.obs_group_dict['SM8-SensorName'] = 'group_moisture'

And a restart of course after having made the changes to extensions.py  ;) 8-)
sudo /etc/init.d/weewx restart (in a Linux (clone) setup)
« Last Edit: January 05, 2021, 09:24:30 AM by Gyvate »
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3324
Re: Odd unit/decimal values with Ecowitt soil moisture sensors
« Reply #2 on: January 05, 2021, 02:58:13 PM »
So, I got things set up and mostly working, but there is some kind of odd data conversion error happening.

Here's the copy/paste of my moisture sensors using the test driver (all looks normal here):
soilMoist1: 51, soilMoist2: 29, soilMoist3: 21, soilMoist4: 43, soilMoist5: 26, soilMoist6: 41, soilMoist7: 44, soilMoist8: 35

What I get in the front end, though, is this (notice the cb vaues vs the 6 decimal point values):
Peas   51 cb
Azalea   29 cb
Locust   21 cb
Clematis   42 cb
Fuscia   26.000000
Dogwood   41.000000
Hilltop   44.000000
Blueberries   35.000000

Any help would be appreciated, thanks!!

Edit: Further looking, it seems like the default group_moisture lists members soilMoist1-4 (per http://weewx.com/docs/customizing.htm#units), I'm wondering if I somehow need to modify that group to include the extra 4 sensors?

you are already on the right path ...

As already said in the before post ...
You must have used already 4 more fields which were not by default meant to be used for SoilMoisture (no harm, just a statement).
Otherwise your values wouldn't be displayed. What is missing now is only the proper units - and the number of decimal places behind the decimal point (SM 1-4 has here zero).

But these 4 fields used by you to display SoilMoisture sensors 5-8 belong to a different unit group (or to no unit group).
Therefore you have to assign them to the proper unit group (respectively vice versa - doesn't matter, the result will be the same).
What you have to do I have described in the post before.
Not modify the group, but add your sensors to that group.

Just try that - and come back with the result(s).  :-)
« Last Edit: January 05, 2021, 02:59:44 PM by Gyvate »
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu