Battery Status Incorrect

225 views
Skip to first unread message

G Hammer

unread,
Feb 15, 2020, 9:05:21 PM2/15/20
to weewx-user
I have gotten two of the three battery statuses to be reported in the Seasons skin.
The one, an Ecowitt WH40 rain gauge, reports it's actual voltage instead of a one or zero.
The battery status for this sensor always shows low as the voltage is reported so greater than 0.

How can I get the correct status of this sensor shown?

raw data: PASSKEY=XXXX&stationtype=GW1000B_V1.5.6&dateutc=2020-02-12+10:11:35&tempinf=72.3&humidityin=29&baromrelin=30.020&baromabsin=29.551&tempf=34.7&humidity=60&winddir=352&windspeedmph=2.46&windgustmph=6.93&maxdailygust=15.88&solarradiation=0.00&uv=0&rainratein=0.000&eventrainin=0.091&hourlyrainin=0.000&dailyrainin=0.000&weeklyrainin=0.177&monthlyrainin=0.189&yearlyrainin=2.110&totalrainin=2.110&wh65batt=0&wh40batt=1.6&wh26batt=0&freq=915M&model=GW1000_Pro
raw packet: {'wind_speed': 2.46, 'humidity_in': 29.0, 'temperature_in': 72.3, 'rain_total': 2.11, 'solar_radiation': 0.0, 'wind_gust': 6.93, 'wh65_battery': 0.0, 'humidity_out': 60.0, 'uv': 0.0, 'rain': 0.0, 'wh26_battery': 0.0, 'pressure': 29.551, 'temperature_out': 34.7, 'wind_dir': 352.0, 'dateTime': 1581502295, 'rain_rate': 0.0, 'usUnits': 1}
mapped packet: {'pressure': 29.551, 'outHumidity': 60.0, 'UV': 0.0, 'radiation': 0.0, 'rain': 0.0, 'dateTime': 1581502295, 'windDir': 352.0, 'outTemp': 34.7, 'windSpeed': 2.46, 'inHumidity': 29.0, 'inTemp': 72.3, 'windGust': 6.93, 'rainRate': 0.0, 'usUnits': 1}


Vetti52

unread,
Feb 16, 2020, 8:52:45 AM2/16/20
to weewx-user
Don't know, how the battery status is processed, but Raffaello Di Martino solved these battery problems in php (extracted from https://github.com/iz0qwm/ecowitt_http_gateway/blob/master/index.php):

# Batteries
   
if ( $weather_data['wh80batt'] < 2.5 )
   
{    
   
@$weather_data['windBatteryStatus'] = 1.0 ;
   
}
   
if ( $weather_data['wh80batt'] > 2.5 )
   
{    
   
@$weather_data['windBatteryStatus'] = 0.0 ;
   
}
   
@$weather_data['consBatteryVoltage'] = $weather_data['wh80batt'] ;

   
if ( $weather_data['wh40batt'] < 1.0 )
   
{
       
@$weather_data['rainBatteryStatus'] = 1.0 ;
   
}
   
if ( $weather_data['wh40batt'] > 1.0 )
   
{
       
@$weather_data['rainBatteryStatus'] = 0.0 ;
   
}
   
@$weather_data['supplyVoltage'] = $weather_data['wh40batt'] ;

   
if ( $weather_data['soilbatt1'] < 1.0 )
   
{
       
@$weather_data['txBatteryStatus'] = 1.0 ;
   
}
   
if ( $weather_data['soilbatt1'] > 1.0 )
   
{
       
@$weather_data['txBatteryStatus'] = 0.0 ;
   
}
   
@$weather_data['heatingVoltage'] = $weather_data['soilbatt1'] ;

   
@$weather_data['outTempBatteryStatus'] = $weather_data['batt1'] ;


This could be adopted, according to the Weewx customizing guide.

vince

unread,
Feb 16, 2020, 12:19:39 PM2/16/20
to weewx-user
On Saturday, February 15, 2020 at 6:05:21 PM UTC-8, G Hammer wrote:
I have gotten two of the three battery statuses to be reported in the Seasons skin.
The one, an Ecowitt WH40 rain gauge, reports it's actual voltage instead of a one or zero.
The battery status for this sensor always shows low as the voltage is reported so greater than 0.

How can I get the correct status of this sensor shown?


You'd have to edit the skin template to change what you want to display.  Look at the very top few lines of seasons.inc to see where it sets OK or LOW and right below there it sets have_voltage based on just a few specific items.  If you mapped your voltages to different things, you'd need to edit that file to include your tag as one of the things that sets have_voltage = 1
 

G Hammer

unread,
Feb 16, 2020, 8:29:03 PM2/16/20
to weewx-user
Thanks to both of you. Each solution has its point, but I do like just having the status 'OK' or 'LOW' so will look into how to get Raffaello's if statements to work with the skin or from weewx.conf

Reply all
Reply to author
Forward
0 new messages