Author Topic: Odd unit/decimal values with Ecowitt soil moisture sensors  (Read 343 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

  • Senior Contributor
  • ****
  • Posts: 287
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 »
Froggit WH4000SE (=EW 2320E) 1.5.6 / Froggit DP1500 1.6.3 (+ 2 x EW GW1000 1.6.3 test/backup) / HP1000SE Pro (HP2551) 1.5.6/1.6.9, WH2650 WiFi (2)
Ecowitt WS80, WH40,WH65, WH31 [T/H] (6), WH31-EP [T&H] (1), WH32 (1), WH32B [T/H/P] (1), WH57 [Lightning] (1), WH41 [PM2.5] (2), WH51 [SoilMoisture] (5), WH45
Meteobridge Pro (2) [test,prod] 5.1 Jan 14 2021, build 14236/271  FW 1.4 - Barani MeteoshieldPro - Blake-Larsen Sun Recorder-RPi4/weewx/CumulusMX/MB
Ecowitt 5763,34418;WU ISAARB3(WH4000SE), ISAARB22(HP2553);Weathercloud 3011399141, http://meshka.eu/meteo/template  -  http://meshka.eu/Weather34

Offline Gyvate

  • Senior Contributor
  • ****
  • Posts: 287
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 »
Froggit WH4000SE (=EW 2320E) 1.5.6 / Froggit DP1500 1.6.3 (+ 2 x EW GW1000 1.6.3 test/backup) / HP1000SE Pro (HP2551) 1.5.6/1.6.9, WH2650 WiFi (2)
Ecowitt WS80, WH40,WH65, WH31 [T/H] (6), WH31-EP [T&H] (1), WH32 (1), WH32B [T/H/P] (1), WH57 [Lightning] (1), WH41 [PM2.5] (2), WH51 [SoilMoisture] (5), WH45
Meteobridge Pro (2) [test,prod] 5.1 Jan 14 2021, build 14236/271  FW 1.4 - Barani MeteoshieldPro - Blake-Larsen Sun Recorder-RPi4/weewx/CumulusMX/MB
Ecowitt 5763,34418;WU ISAARB3(WH4000SE), ISAARB22(HP2553);Weathercloud 3011399141, http://meshka.eu/meteo/template  -  http://meshka.eu/Weather34

 

anything