UV Sensor Battery Indicator

129 views
Skip to first unread message

Neil S

unread,
Jun 29, 2019, 7:12:22 AM6/29/19
to weewx-user
So I have just upgraded to 3.9.1 (on Raspberry Pi).  Using the nice new skin but cannot work out how to get the UV Sensor battery to show on the web page. UV levels etc show OK but cant get battery status to show (despite some config file fiddling)

(WRM88 weather station) 

Is it possible?

Neil

gjr80

unread,
Jun 29, 2019, 2:51:25 PM6/29/19
to weewx-user
Hi,

Station specific hardware fields like battery levels/hardware states are very much station and driver dependent. You may find some info in the comments at the start of the your stations driver file. You could also try running WeeWX directly (http://weewx.com/docs/usersguide.htm#Running_directly), this will cause loop packets and archive records to be displayed on the console (loop packets start with LOOP:, archive records start with REC:). It’s quite possible the field you are after is appearing in the loop packets and archive records but is not displayed in the default reports. If the field is there you can display it’s current data in a report using the tag $current.field_name (substituting field_name with the actual field name of course).

If you want aggregates or other historical data for the field of interest you will need to customise your database to add the field you want to your archive (http://weewx.com/docs/customizing.htm#archive_database) or repurpose an existing archive field. You will then have access to various aggregates (max, min, average etc) over various timeframes (day, week, month etc) in your reports.

Gary

mwall

unread,
Jul 4, 2019, 12:00:13 AM7/4/19
to weewx-user
On Saturday, June 29, 2019 at 7:12:22 AM UTC-4, Neil S wrote:
So I have just upgraded to 3.9.1 (on Raspberry Pi).  Using the nice new skin but cannot work out how to get the UV Sensor battery to show on the web page. UV levels etc show OK but cant get battery status to show (despite some config file fiddling)

when you run weewx directly, do you see 'uvBatteryStatus' as one of the fields?

if so, then you can use the value directly in reports, but you'll have to extend the database to see historical values (as gary pointed out).

if not, then you should check your sensor_map - the field 'battery_status_uv' should be mapped to 'uvBatteryStatus' in the default sensor map.

m

Neil S

unread,
Jul 4, 2019, 4:44:19 AM7/4/19
to weewx-user
Yes I see it in the LOOP packets 

LOOP:   2019-07-04 09:27:47 BST (1562228867) dateTime: 1562228867, maxSolarRad: 596.436033087, rainRate: 0, usUnits: 1, UV: 3.0, uvBatteryStatus: 0

I now have a battery map of 
        txBatteryStatus = batterytx
        windBatteryStatus = batteryWind
        rainBatteryStatus = batteryRain
        outTempBatteryStatus = battery1
        # WARNING: the following are not in the default schema
        extraBatteryStatus1 = battery2
        extraBatteryStatus2 = battery3
        extraBatteryStatus3 = battery4
        extraBatteryStatus4 = battery5
uvBatteryStatus = batteryuv

weewx.conf
I have no requirement for historical or tracked battery data so assume I dont need to extend the database.

Just need to work out how to now display it in the Battery Status section.

I have added the following to sensors.inc in the Seasons skin folder

#if $day.uvBatteryStatus.has_data
    <tr>
      <td class="label">$obs.label.uvBatteryStatus</td>
      <td class="data">$get_battery_status($current.uvBatteryStatus.raw)</td>
    </tr>
#end if

But still no joy.

Neil

mwall

unread,
Jul 4, 2019, 7:03:59 AM7/4/19
to weewx-user
On Thursday, July 4, 2019 at 4:44:19 AM UTC-4, Neil S wrote:

I now have a battery map of 
        txBatteryStatus = batterytx
        windBatteryStatus = batteryWind
        rainBatteryStatus = batteryRain
        outTempBatteryStatus = battery1
        # WARNING: the following are not in the default schema
        extraBatteryStatus1 = battery2
        extraBatteryStatus2 = battery3
        extraBatteryStatus3 = battery4
        extraBatteryStatus4 = battery5
uvBatteryStatus = batteryuv

weewx.conf

that is an odd sensor_map - it appears to use older observation names.

is there some reason that you defined your own mapping?

please post the actual [WMR100] section from your weewx configuration file.


 
I have no requirement for historical or tracked battery data so assume I dont need to extend the database.

Just need to work out how to now display it in the Battery Status section.

I have added the following to sensors.inc in the Seasons skin folder

#if $day.uvBatteryStatus.has_data
    <tr>
      <td class="label">$obs.label.uvBatteryStatus</td>
      <td class="data">$get_battery_status($current.uvBatteryStatus.raw)</td>
    </tr>
#end if

since you have not extended your schema, the directive $day.uvBatteryStatus.has_data will always be false. 

remove the two lines `#if #day.uvBatteryStatus.has_data` and `#end if`

m

Neil S

unread,
Jul 4, 2019, 5:28:21 PM7/4/19
to weewx-user
OK ignore that sensor map I posted - my bad

weewx.conf section is

[WMR100]
    # This section is for the Oregon Scientific WMR100
    
    # The station model, e.g., WMR100, WMR100N, WMRS200
    model = WMR100
    
    # How long a wind record can be used to calculate wind chill (in seconds)
    stale_wind = 30
    
    # The driver to use:
    driver = weewx.drivers.wmr100


(there is no sensor map in the WMR100 section - note it does show Battery status of wind, rain, inside & outside sensors)

(also if there are # at the start doesnt it ignore that line??) 

Neil

On Saturday, 29 June 2019 12:12:22 UTC+1, Neil S wrote:

Neil S

unread,
Jul 15, 2019, 11:07:14 AM7/15/19
to weewx-user
So as mwall suggested I removed the two lines `#if #day.uvBatteryStatus.has_data` and `#end if`

I now have:-

UV Battery  OK

Displayed on the web page.

Thanks mwall. 

N.


On Saturday, 29 June 2019 12:12:22 UTC+1, Neil S wrote:
Reply all
Reply to author
Forward
0 new messages