On Saturday, 16 January 2021 at 14:28:48 UTC+10 [email protected] 
wrote:

> Thank for answer and your will to help me! 
>
Im new on Netatmo and its more advanced to code haha. 
> Sorry for late answere i think the county time differens between us. Clock 
> is early in the morning now in sweden 05:40 AM
>

No problems, you have more netatmo experience than I! We do have a time 
difference, I am nine hours ahead of you I believe, mid-afternoon here now 
as I write this.
 

> I know battery_vp is from old firmware and battery_percent is the newer 
> firmware.
> The work with formatting its something i havent learn yet and its take 
> time because my dyslexia and concentration because adhd. 
> But thanks to you because you describe in the way i understand very well.
>

You are welcome.

I have thinking on what i want in the reading and i wanted to have just the 
> percentage. 
> So as example from your tex above i want the readings to  "Anemometer 
> Battery 95%" 
>

OK, that makes it easy, just a couple more things to do. We need to modify 
sensors.inc again and then we need to tell WeeWX how to interpret the 
xxxBatteryStatus  and xxx_rf_status fields. I have attached a new copy of 
sensors.inc, again it is actually sensors.txt due to Google Groups 
limitations, just download it, rename it to sensors.inc and use it to 
replace your existing /etc/weewx/skins/Seasons/sensors.inc. That will now 
give you just the percentages for battery status and just the numbers for 
rf status, something like:

    Anemometer Battery 95.000000
    Anemometer Signal 86.000000

Still not formatted correctly and with no % symbol.

Reading a bit more about the netatmo system it seems the rf signal level 
values are RSSI (received signal strength indicator) values in decibels 
(dB). Again your choice how you want to present them, you can present them 
as just a number, eg:

    Anemometer Signal 86

or as a dB value eg:

    Anemometer Signal 86dB

Once you have decided hold on to that thought as we will use it shortly.

To get the numbers formatted correctly we need to tell WeeWX how to 
interpret the xxxBatteryStatus  and xxx_rf_status fields and we do that by 
adding a few lines of code to /usr/share/weewx/user/extensions.py. To make 
the changes to /usr/share/weewx/user/extensions.py:

1. open /usr/share/weewx/user/extensions.py in a text editor

2. add the following lines to the bottom of the file:

import weewx.units
weewx.units.obs_group_dict['windBatteryStatus'] = 'group_percent'
weewx.units.obs_group_dict['rainBatteryStatus'] = 'group_percent'
weewx.units.obs_group_dict['outTempBatteryStatus'] = 'group_percent'

3. if you want to display the rf signal status as just plain numbers add 
the following lines:

weewx.units.obs_group_dict['signal1'] = 'group_count'
weewx.units.obs_group_dict['signal2'] = 'group_count'
weewx.units.obs_group_dict['signal3'] = 'group_count'
weewx.units.obs_group_dict['signal4'] = 'group_count'

4. if you want to display the rf signal status as decibels (with a dB unit 
label) add the following lines:

weewx.units.obs_group_dict['signal1'] = 'group_db'
weewx.units.obs_group_dict['signal2'] = 'group_db'
weewx.units.obs_group_dict['signal3'] = 'group_db'
weewx.units.obs_group_dict['signal4'] = 'group_db'

Make sure you do just one or the other of 3. and 4., don't add both.

5. save extensions.py

That is all though this time you will need to restart WeeWX for the changes 
in extensions.py to take effect. After you have restarted WeeWX once the 
next report cycle completes you should see the sensor panel on the Seasons 
home page updated accordingly. If the display is not as you expect or 
something goes wrong post back here with details.

About the Belchertown i will try fix that on my own. 
> I have learn a little about sensor readings thanks to you! Its just the 
> formatting now :) 
>

The Belchertown skin is quite popular and lots of folks here are familiar 
with it and have customised it (unfortunately I am not one them). If you 
get stuck with Belchertown open a new thread with your questions and I am 
sure someone will help you.

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/cdc28b03-9b17-435d-9f2a-8a6314225a73n%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


## 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]
  #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">$current.signal1</td>
    </tr>
#end if
#if $day.signal2.has_data
    <tr>
      <td class="label">$obs.label.signal2</td>
      <td class="data">$current.signal2</td>
    </tr>
#end if
#if $day.signal3.has_data
    <tr>
      <td class="label">$obs.label.signal3</td>
      <td class="data">$current.signal3</td>
    </tr>
#end if
#if $day.signal4.has_data
    <tr>
      <td class="label">$obs.label.signal4</td>
      <td class="data">$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
    <tr>
      <td class="label">$obs.label.windBatteryStatus</td>
      <td class="data">$current.windBatteryStatus</td>
    </tr>
#end if
#if $day.rainBatteryStatus.has_data
    <tr>
      <td class="label">$obs.label.rainBatteryStatus</td>
      <td class="data">$current.rainBatteryStatus</td>
    </tr>
#if $day.rainBatteryStatus.has_data
    <tr>
      <td class="label">$obs.label.outTempBatteryStatus</td>
      <td class="data">$current.outTempBatteryStatus</td>
    </tr>
#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