insertion uvbatterystatus uv sensor 800

124 views
Skip to first unread message

Paola Giannusa

unread,
Jan 26, 2020, 11:56:40 AM1/26/20
to weewx-user
good evening everyone
I would like to know please how can I correctly insert uvbatterystatus (uv800 sensor) on the weewx main page
I have already inserted in the sensor map of weewx.conf this line: 'uvbatterystatus = battery.1: 63.OSUV800Packet
The uv sensor works great and i have uv data
but not the 'low' or 'ok' data of the battery status
thanks to everyone who will help me

Paola Giannusa

unread,
Jan 27, 2020, 10:12:21 AM1/27/20
to weewx-user
Sorry, I have not posted part of the weewx.conf, I am attaching it immediately

[SDR]
    # This section is for the software-defined radio driver.
    
    # The driver to use
    driver = user.sdr
    cmd = rtl_433 -M utc -F json -R 42 -R 12
    [[sensor_map]]
       outTempBatteryStatus = battery.1:5.HidekiTS04Packet
       outHumidity = humidity.1:5.HidekiTS04Packet
       outTemp = temperature.1:5.HidekiTS04Packet
       inTempBatteryStatus = battery.5:1.HidekiTS04Packet
       inHumidity = humidity.5:1.HidekiTS04Packet
       inTemp = temperature.5:1.HidekiTS04Packet
       windDir = wind_dir.4:3.HidekiWindPacket
       windSpeed = wind_speed.4:3.HidekiWindPacket
       windGust = wind_gust.4:3.HidekiWindPacket
       windBatteryStatus = battery.4:3.HidekiWindPacket
       rainBatteryStatus = battery.4:0.HidekiRainPacket   
       rain_total = rain_total.4:0.HidekiRainPacket
       extraTemp1 = temperature.4:3.HidekiWindPacket
       UV = uv_index.1:63.OSUV800Packet
       uvBatteryStatus = battery.1:63.OSUV800Packet  

Paola Giannusa

unread,
Jan 29, 2020, 10:14:22 AM1/29/20
to weewx-user
can nobody help me please?


Il giorno domenica 26 gennaio 2020 17:56:40 UTC+1, Paola Giannusa ha scritto:

Paola Giannusa

unread,
Jan 31, 2020, 12:19:49 PM1/31/20
to weewx-user


Il giorno domenica 26 gennaio 2020 17:56:40 UTC+1, Paola Giannusa ha scritto:

Paola Giannusa

unread,
Jan 31, 2020, 12:20:16 PM1/31/20
to weewx-user
Can at least someone tell me if I need to edit the sensors.inc file?


Il giorno domenica 26 gennaio 2020 17:56:40 UTC+1, Paola Giannusa ha scritto:

Paul McGeorge

unread,
Jan 31, 2020, 9:57:40 PM1/31/20
to weewx-user
If you are only trying to display the current you would add something like the below to sensors.inc or whatever template you want it on.  I have not tested this...

$current.uvBatteryStatus.raw


If you are trying to store the status over time and use the data for graphs or to track it you will need to extend the Database to have the uvBatteryStatus field.

You need to read the Weewx Customization Guide http://www.weewx.com/docs/customizing.htm#archive_database and understand how the database is used and how tags work in order to get this done.

You may also want to read through some of the discussions others have had concerning adding to the Database or useing the $current record.  Like this thread https://groups.google.com/forum/#!searchin/weewx-user/tag$20not$20in$20database%7Csort:date/weewx-user/laTEGPTirH8/rkj6CdQ9BQAJ








Paola Giannusa

unread,
Feb 1, 2020, 10:06:23 AM2/1/20
to weewx-user
first of all thank you very much for your help
I'm only interested in the current battery situation of the uv800 sensor from Oregon
I am not interested in inserting tables, graphs or historians
I attach the sensors.in file
can you please teach me where to put $ current.uvBatteryStatus.raw
I would just like to see the current status of the uv battery ok or o low

Paola Giannusa

unread,
Feb 1, 2020, 10:08:04 AM2/1/20
to weewx-user
## sensors module for weewx skins
## Copyright Tom Keffer, Matthew Wall
## See LICENSE.txt for your rights
#errorCatcher Echo
## this is a conditional display of sensor data, including connectivity,
## battery status, and various voltages. if there are no data available,
## then this degenerates to nothing displayed.
#def get_battery_status($x)
#if $x == 0
<span class="status_ok">OK</span>
#else
<span class="status_low">LOW</span>
#end if
#end def
## first see what sensor data are available
#set $have_conn = 0
#for $x in [$day.rxCheckPercent]
#if $x.has_data
#set $have_conn = 1
#end if
#end for
#set $have_battery_status = 0
#for $x in [$day.txBatteryStatus, $day.windBatteryStatus, $day.rainBatteryStatus, $day.outTempBatteryStatus, $day.inTempBatteryStatus]
#if $x.has_data
#set $have_battery_status = 1
#end if
#end for
#set $have_voltage = 0
#for $x in [$day.consBatteryVoltage, $day.heatingVoltage, $day.supplyVoltage, $day.referenceVoltage]
#if $x.has_data
#set $have_voltage = 1
#end if
#end for
## now display the available data only
#if $have_conn or $have_battery_status or $have_voltage
<div id='sensors_widget' class="widget">
<div class="widget_title">
<a href="telemetry.html">Sensor Status</a>
<a class="widget_control"
onclick="toggle_widget('sensors')">&diams;</a>
</div>
<div class="widget_contents">
<table>
#if $have_conn
<tr><th>Connectivity</th><th></th></tr>
#if $day.rxCheckPercent.has_data
<tr>
<td class="label">$obs.label.rxCheckPercent</td>
<td class="data">$current.rxCheckPercent</td>
</tr>
#end if
#end if
#if $have_battery_status
<tr><th>Battery Status</th><th></th></tr>
#if $day.txBatteryStatus.has_data
<tr>
<td class="label">$obs.label.txBatteryStatus</td>
<td class="data">$get_battery_status($current.txBatteryStatus.raw)</td>
</tr>
#end if
#if $day.windBatteryStatus.has_data
<tr>
<td class="label">$obs.label.windBatteryStatus</td>
<td class="data">$get_battery_status($current.windBatteryStatus.raw)</td>
</tr>
#end if
#if $day.rainBatteryStatus.has_data
<tr>
<td class="label">$obs.label.rainBatteryStatus</td>
<td class="data">$get_battery_status($current.rainBatteryStatus.raw)</td>
</tr>
#end if
#if $day.outTempBatteryStatus.has_data
<tr>
<td class="label">$obs.label.outTempBatteryStatus</td>
<td class="data">$get_battery_status($current.outTempBatteryStatus.raw)</td>
</tr>
#end if
#if $day.inTempBatteryStatus.has_data
<tr>
<td class="label">$obs.label.inTempBatteryStatus</td>
<td class="data">$get_battery_status($current.inTempBatteryStatus.raw)</td>
</tr>
#end if
#end if
#if $have_voltage
<tr><th>Voltage</th><th></th></tr>
#if $day.consBatteryVoltage.has_data
<tr>
<td class="label">$obs.label.consBatteryVoltage</td>
<td class="data">$current.consBatteryVoltage</td>
</tr>
#end if
#if $day.heatingVoltage.has_data
<tr>
<td class="label">$obs.label.heatingVoltage</td>
<td class="data">$current.heatingVoltage</td>
</tr>
#end if
#if $day.supplyVoltage.has_data
<tr>
<td class="label">$obs.label.supplyVoltage</td>
<td class="data">$current.supplyVoltage</td>
</tr>
#end if
#if $day.referenceVoltage.has_data
<tr>
<td class="label">$obs.label.referenceVoltage</td>
<td class="data">$current.referenceVoltage</td>
</tr>
#end if
#end if
</table>
</div>
</div>
#end if


Paul McGeorge

unread,
Feb 1, 2020, 1:26:11 PM2/1/20
to weewx-user

My station doesn't have anything that shows on sensors.inc  but looking at the code above if you already have something that shows battery status you could try adding it after the #if $have_battery_status section





#if $have_battery_status
    <tr><th>Battery Status</th><th></th></tr>

#if $current.uvBatteryStatus.has_data
   
<tr>
     
<td class="label">UV battery Status</td>
      <td class="data">$
current.uvBatteryStatus.raw</td>
   
</tr>
#end if

It really will depend what is already showing in sensors.inc  The documentation covers all of this so please read the guides.



Paola Giannusa

unread,
Feb 1, 2020, 2:34:58 PM2/1/20
to weewx-user
Yes ... You did it .... you did it
thank you very much, I hope your solution will serve someone else in need like me

Il giorno domenica 26 gennaio 2020 17:56:40 UTC+1, Paola Giannusa ha scritto:
Reply all
Reply to author
Forward
0 new messages