Hi,

If I read your post correctly the problem you have is that you can't 
display wifi status, various sensor rf status and various sensors battery 
status on your Seasons page? Your netatmo driver is picking up the data and 
passing it to WeeWX, there's just a few things you need to do to make the 
data available to the Seasons skin. First up you need to get WeeWX to save 
the sensor status data to database. Then you need to modify the Seasons 
skin to display the sensor status fields concerned.

According to the log extract everything is running without error and we can 
see the fields the netatmo driver is emitting in loop packets from this 
line:

Jan 12 11:37:57 Raspi /weewxd: netatmo: MainThread: packet: {'dateTime': 
1610447878 , 'usUnits': 16, 'pressure': 994.5, 'inTemp': 23.1, 
'inHumidity': 40, 'co2': 672, ' noise': 44, 'wifi_status': 57, 'outTemp': 
3, 'outHumidity': 75, 'out_rf_status': 60 , 'out_battery_vp': 5874, 
'outTempBatteryStatus': 
93, 'windSpeed': 2, 'windDir': 23 7, 'windGust': 5, 'windGustDir': 237, 
'wind_rf_status': 
86, 'wind_battery_vp': 5907 , 'windBatteryStatus': 95, 'rain': 0.0, 
'rain_total': 0.06, 'rain_rf_status': 63, ' rain_battery_vp': 6046, 
'rainBatteryStatus': 
100} 

WeeWX will accumulate the data in these loop packets and every archive 
period WeeWX will emit an archive record consisting of the accumulated loop 
packet fields. Try running WeeWX directly, 
<http://weewx.com/docs/usersguide.htm#Running_directly> you will see the 
loop packets (lines starting with LOOP:) and archive records (lines 
starting with REC:) on your console. The reason the archive records are 
important is that it is those fields and their data that are saved to 
database. If a field in an archive record exists in your database schema 
then the data from that field is saved to database, if the field does not 
exist in the database schema then the data is not saved to database. The 
legacy wview schema does not have very many sensor status fields, the 
wview_extended schema has significantly more fields which covers a few of 
your netatmo fields (outTempBatteryStatus, windBatteryStatus and 
rainBatterystatus) but a number are not included (wifi_status, out_rf_status, 
out_battery_vp, wind_rf_status, wind_battery_vp, rain_rf_status and 
rain_battery_vp). We have a couple of choices here, we can modify your 
database schema and add the extra fields or we can repurpose some of the 
unused fields in your database. If you use the wview_extended schema it 
comes with a number of generic battery and signal level fields so I would 
suggest we use those rather than modify your schema.

To repurpose the fields:

1. You need to be using the wview_extended schema, you indicated you have 
tried that. If you are still using that schema then that is fine, if not 
change back to it.

2. We need to get the data from the xxx_status and xxx_battery_vp fields 
into the fields were are going to use in the wview_extended schema, there 
are a number of ways we can do this, I suggest we use the netatmo driver 
sensor map to do this in the driver. We do this using a [[sensor_map]] 
stanza in the netatmo driver config stanza in weewx.conf. Edit 
/etc/weewx/weewx.conf, locate the [netatmo] stanza and add the 
[[sensor_map]] stanza as follows:

[netatmo]
    ....
    [[sensor_map]]
        wifi_status = ''
        # map wifi status to field signal1
        signal1 = *.NAMain.wifi_status
        out_rf_status = 
        # map out rf status status to field signal2
        signal2 = *.NAModule1.rf_status
        wind_rf_status = 
        # map wind rf status to field signal3
        signal3 = *.NAModule2.rf_status
        rain_rf_status = 
        # map rain rf status to field signal4
        signal4 = *.NAModule4.rf_status
        out_battery_vp = 
        # map out battery vp to field batteryStatus1
        batteryStatus1 = *.NAModule1.battery_vp
        wind_battery_vp = 
        # map wind battery vp to field batteryStatus2
        batteryStatus2 = *.NAModule2.battery_vp
        rain_battery_vp = 
        # map rain battery vp to field batteryStatus3
        batteryStatus3 = *.NAModule3.battery_vp

3. Save weewx.conf and run WeeWX directly again. You should now see loop 
packets and archive records that contain fields signal1, signal2, signal3. 
signal4, batteryStatus1, batteryStatus2 and batteryStatus3. These fields 
should have the wifi status, rf status and battery vp status data you saw 
previously. If not or nothing happens check the WeeWX log for errors and 
post a log extract back here.

You now have all of the status fields being saved to database, now we need 
to configure the Seasons skin to display them. There are a couple of things 
to do here; first we need to make some changes to the file 
/etc/weewx/skins/Seasons/sensors.inc to include the new fields we are 
using. Secondly, we need to add a few entries to the Seasons skin config 
file  /etc/weewx/skins/Seasons/skin.conf. The changes to sensors.inc are 
quite substantial so I have attached a modified sensors.inc (actually named 
sensors.txt due to Google Groups limitations). To install rename your 
existing sensors.inc to say sensors_orig.inc and download the attached 
sensors.txt in its place and rename to sensors.inc. To make the changes to 
skin.conf edit /etc/weewx/skins/Seasons/skin.conf and locate the [Labels] 
stanza, make the necessary changes/additions so that it looks like the 
following (changes/additions highlighted in yellow):

[Labels]

    # Override some labels. No need to identify these as a "Battery"
    # or "Voltage", because that is included in the template.
    [[Generic]]
        txBatteryStatus      = Transmitter
        windBatteryStatus    = Anemometer Battery
        rainBatteryStatus    = Rain Gauge Battery
        outTempBatteryStatus = Outdoor Module Battery
        inTempBatteryStatus  = Inside Temperature
        consBatteryVoltage   = Console
        heatingVoltage       = Heating
        supplyVoltage        = Supply
        referenceVoltage     = Reference
        signal1              = WiFi
        signal2              = Outdoor Module Signal
        signal3              = Anemometer Signal
        signal4              = Rain Gauge Signal

        # Some specialized labels
        rain_today           = Rain Today
        wind                 = Wind

Save skin.conf and on the next report cycle check your Seasons page, 
hopefully it will have WiFi status, rf status and battery level data in the 
Sensor Status panel. If not, check the WeeWX log for any errors and if 
there are any post them here. I expect there will be a little fine tuning 
needed, but let's see how the above goes first. If your Seasons page is 
publicly accessible a link would be handy.

If you need to revert to the old sensors.inc, just delete sensors.inc and 
rename sensors_orig.inc to sensors.inc.

Gary

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/e03c7e3d-8c50-4f8a-9af7-e93e3fb17fd9n%40googlegroups.com.
## sensors module for weewx skins
## Copyright Tom Keffer, Matthew Wall
## See LICENSE.txt for your rights
#errorCatcher Echo
#encoding UTF-8

## 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

#def get_netatmo_wind_batt_status($x)
#if $x >= 6000
  #return "max"
#elif $x >= 5590
  #return "full"
#elif $x >= 5180
  #return "high"
#elif $x >= 4770
  #return "medium"
#elif $x >= 4360
  #return "low"
#elif $x < 4360
  #return "very low"
#end if
#return "unknown"
#end def

#def get_netatmo_out_rain_batt_status($x)
#if $x >= 6000
  #return "max"
#elif $x >= 5500
  #return "full"
#elif $x >= 5000
  #return "high"
#elif $x >= 4500
  #return "medium"
#elif $x >= 4000
  #return "low"
#elif $x < 4000
  #return "very low"
#end if
#return "unknown"
#end def

#def get_netatmo_wifi_status($x)
#if $x <= 56
  #return "good"
#elif $x <= 71
  #return "average"
#elif $x <= 86
  #return "bad"
#end if
#return "unknown"
#end def

#def get_netatmo_rf_status($x)
#if $x <= 60
  #return "full"
#elif $x <= 70
  #return "high"
#elif $x <= 80
  #return "medium"
#elif $x <= 90
  #return "low"
#end if
#return "unknown"
#end def

## first see what sensor data are available

#set $have_conn = 0
#for $x in [$day.rxCheckPercent, $day.signal1, $day.signal2, $day.signal3, 
$day.signal4]
  #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, 
$day.batteryStatus1, $day.batteryStatus2, $day.batteryStatus3]
  #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
#if $day.signal1.has_data
    <tr>
      <td class="label">$obs.label.signal1</td>
      <td 
class="data">$get_netatmo_wifi_status($current.signal1.raw)($current.signal1)</td>
    </tr>
#end if
#if $day.signal2.has_data
    <tr>
      <td class="label">$obs.label.signal2</td>
      <td 
class="data">$get_netatmo_rf_status($current.signal2.raw)($current.signal2)</td>
    </tr>
#end if
#if $day.signal3.has_data
    <tr>
      <td class="label">$obs.label.signal3</td>
      <td 
class="data">$get_netatmo_rf_status($current.signal3.raw)($current.signal3)</td>
    </tr>
#end if
#if $day.signal4.has_data
    <tr>
      <td class="label">$obs.label.signal4</td>
      <td 
class="data">$get_netatmo_rf_status($current.signal4.raw)($current.signal4)</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 and $current.batteryStatus2.raw
    <tr>
      <td class="label">$obs.label.windBatteryStatus</td>
      <td 
class="data">$get_netatmo_wind_batt_status($current.batteryStatus2.raw)($current.windBatteryStatus)</td>
    </tr>
#elif $day.windBatteryStatus.has_data
    <tr>
      <td class="label">$obs.label.windBatteryStatus</td>
      <td class="data">$current.windBatteryStatus</td>
    </tr>
#elif $current.batteryStatus2.raw
    <tr>
      <td class="label">$obs.label.windBatteryStatus</td>
      <td 
class="data">$get_netatmo_wind_batt_status($current.batteryStatus2.raw)</td>
    </tr>
#end if
#if $day.rainBatteryStatus.has_data and $current.batteryStatus3.raw
    <tr>
      <td class="label">$obs.label.rainBatteryStatus</td>
      <td 
class="data">$get_netatmo_out_rain_batt_status($current.batteryStatus3.raw)($current.rainBatteryStatus)</td>
    </tr>
#elif $day.rainBatteryStatus.has_data
    <tr>
      <td class="label">$obs.label.rainBatteryStatus</td>
      <td class="data">$current.rainBatteryStatus</td>
    </tr>
#elif $current.batteryStatus3.raw
    <tr>
      <td class="label">$obs.label.rainBatteryStatus</td>
      <td 
class="data">$get_netatmo_out_rain_batt_status($current.batteryStatus3.raw)</td>
    </tr>
#end if
#if $day.outTempBatteryStatus.has_data and $current.batteryStatus1.raw
    <tr>
      <td class="label">$obs.label.outTempBatteryStatus</td>
      <td 
class="data">$get_netatmo_out_rain_batt_status($current.batteryStatus1.raw)($current.outTempBatteryStatus)</td>
    </tr>
#elif $day.rainBatteryStatus.has_data
    <tr>
      <td class="label">$obs.label.outTempBatteryStatus</td>
      <td class="data">$current.outTempBatteryStatus</td>
    </tr>
#elif $current.batteryStatus1.raw
    <tr>
      <td class="label">$obs.label.outTempBatteryStatus</td>
      <td 
class="data">$get_netatmo_out_rain_batt_status($current.batteryStatus1.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

Reply via email to