Netatmo station - help needed for read some observation

198 views
Skip to first unread message

Rebecka Johansson

unread,
Jan 12, 2021, 8:43:45 AM1/12/21
to weewx-user

I have Netamo station indoor modul and outdoor module with Wind Anemometer and Rain Gauge.
I installed it with the Netatmo extension from Matthewwall via an forked updated extension from Bricebou.
I also use Belchertown skin and public site via MQTT broker and so far all works and the loop info reads all the observation in command line on my Raspberry pi 4.

But i dont know how to do to publish the wifi, Rf and battery sensors readings.

Here is a copy/paste from my loop and as you can see it reads all information for weewx but in the main season skin it only says low battery everywhere and i cant get it on Belchertown either.

Jan 12 11:37:57 Raspi /weewxd: netatmo: netatmo-client: next update in 300 seconds Jan 12 11:37:57 Raspi /weewxd: netatmo: MainThread: data: {'70:ee:50:65:3d:c0.NAMai n.time_utc': 1610447313, '70:ee:50:65:3d:c0.NAMain.wifi_status': 57, '70:ee:50:65:3 d:c0.NAMain.co2_calibrating': True, '70:ee:50:65:3d:c0.NAMain._id': '70:ee:50:65:3d :c0', '70:ee:50:65:3d:c0.NAMain.module_name': 'MyNetatmo', '70:ee:50:65:3d:c0.NAMai n.last_status_store': 1610447319, '70:ee:50:65:3d:c0.NAMain.firmware': 179, '70:ee: 50:65:3d:c0.NAMain.last_setup': 1605898056, '70:ee:50:65:3d:c0.NAMain.date_setup': 1605898056, '70:ee:50:65:3d:c0.NAMain.Temperature': 23.1, '70:ee:50:65:3d:c0.NAMain .Humidity': 40, '70:ee:50:65:3d:c0.NAMain.AbsolutePressure': 994.5, '70:ee:50:65:3d :c0.NAMain.Pressure': 995.5, '70:ee:50:65:3d:c0.NAMain.CO2': 672, '70:ee:50:65:3d:c 0.NAMain.Noise': 44, '02:00:00:65:02:32.NAModule1.time_utc': 1610447288, '02:00:00: 65:02:32.NAModule1.rf_status': 60, '02:00:00:65:02:32.NAModule1.battery_vp': 5874, '02:00:00:65:02:32.NAModule1._id': '02:00:00:65:02:32', '02:00:00:65:02:32.NAModule 1.module_name': 'Outdoor', '02:00:00:65:02:32.NAModule1.last_seen': 1610447288, '02 :00:00:65:02:32.NAModule1.battery_percent': 93, '02:00:00:65:02:32.NAModule1.firmwa re': 50, '02:00:00:65:02:32.NAModule1.last_setup': 1605898013, '02:00:00:65:02:32.N AModule1.Temperature': 3, '02:00:00:65:02:32.NAModule1.Humidity': 75, '05:00:00:07: f3:1e.NAModule3.time_utc': 1610447308, '05:00:00:07:f3:1e.NAModule3.rf_status': 63, '05:00:00:07:f3:1e.NAModule3.battery_vp': 6046, '05:00:00:07:f3:1e.NAModule3._id': '05:00:00:07:f3:1e', '05:00:00:07:f3:1e.NAModule3.module_name': 'Outdoor Rain', '0 5:00:00:07:f3:1e.NAModule3.last_seen': 1610447308, '05:00:00:07:f3:1e.NAModule3.bat tery_percent': 100, '05:00:00:07:f3:1e.NAModule3.firmware': 12, '05:00:00:07:f3:1e. NAModule3.last_setup': 1605982034, '05:00:00:07:f3:1e.NAModule3.Rain': 0.0, '05:00: 00:07:f3:1e.NAModule3.sum_rain_24': 0.06, '05:00:00:07:f3:1e.NAModule3.sum_rain_1': 0.0, '06:00:00:04:d3:ec.NAModule2.time_utc': 1610447289, '06:00:00:04:d3:ec.NAModu le2.rf_status': 86, '06:00:00:04:d3:ec.NAModule2.battery_vp': 5907, '06:00:00:04:d3 :ec.NAModule2._id': '06:00:00:04:d3:ec', '06:00:00:04:d3:ec.NAModule2.module_name': 'Outdoor Wind', '06:00:00:04:d3:ec.NAModule2.last_seen': 1610447314, '06:00:00:04: d3:ec.NAModule2.battery_percent': 95, '06:00:00:04:d3:ec.NAModule2.firmware': 25, ' 06:00:00:04:d3:ec.NAModule2.last_setup': 1605982333, '06:00:00:04:d3:ec.NAModule2.W indStrength': 2, '06:00:00:04:d3:ec.NAModule2.WindAngle': 237, '06:00:00:04:d3:ec.N AModule2.GustStrength': 5, '06:00:00:04:d3:ec.NAModule2.GustAngle': 237} 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} Jan 12 11:37:57 Raspi weewx[25741] INFO weewx.restx: MQTT: Published record 2021-01 -12 11:37:58 CET (1610447878) Jan 12 11:37:57 Raspi weewx[25741] INFO weewx.manager: Added record 2021-01-12 11:3 5:00 CET (1610447700) to database 'weewx.sdb' Jan 12 11:37:58 Raspi weewx[25741] INFO weewx.manager: Added record 2021-01-12 11:3 5:00 CET (1610447700) to daily summary in 'weewx.sdb' Jan 12 11:37:58 Raspi weewx[25741] DEBUG weewx.reportengine: Running reports for la test time in the database. Jan 12 11:37:58 Raspi weewx[25741] DEBUG weewx.reportengine: Running report 'Season sReport' Jan 12 11:37:58 Raspi weewx[25741] DEBUG weewx.restx: StationRegistry: wait interva l (1800 < 604800) has not passed for record 2021-01-12 11:35:00 CET (1610447700) Jan 12 11:37:58 Raspi weewx[25741] DEBUG weewx.reportengine: Found configuration fi le /etc/weewx/skins/Seasons/skin.conf for report 'SeasonsReport' Jan 12 11:37:58 Raspi weewx[25741] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetah generator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInf o', 'weewx.cheetahgenerator.Extras'] Jan 12 11:37:58 Raspi weewx[25741] INFO weewx.restx: MQTT: Published record 2021-01 -12 11:35:00 CET (1610447700) Jan 12 11:37:58 Raspi weewx[25741] DEBUG weewx.manager: Daily summary version is 3. 0 Jan 12 11:37:58 Raspi weewx[25741] INFO weewx.restx: PWSWeather: Published record 2 021-01-12 11:35:00 CET (1610447700) Jan 12 11:37:59 Raspi weewx[25741] INFO weewx.restx: Wunderground-PWS: Published re cord 2021-01-12 11:35:00 CET (1610447700) Jan 12 11:37:59 Raspi weewx[25741] INFO weewx.cheetahgenerator: Generated 8 files f or report SeasonsReport in 0.84 seconds Jan 12 11:37:59 Raspi weewx[25741] DEBUG weewx.manager: Daily summary version is 3. 0 Jan 12 11:37:59 Raspi weewx[25741] INFO weewx.imagegenerator: Generated 15 images f or report SeasonsReport in 0.57 seconds Jan 12 11:37:59 Raspi weewx[25741] INFO weewx.reportengine: Copied 0 files to /var/ www/html/weewx Jan 12 11:37:59 Raspi weewx[25741] DEBUG weewx.reportengine: Report 'SmartphoneRepo rt' not enabled. Skipping. Jan 12 11:37:59 Raspi weewx[25741] DEBUG weewx.reportengine: Report 'MobileReport' not enabled. Skipping. Jan 12 11:37:59 Raspi weewx[25741] DEBUG weewx.reportengine: Report 'StandardReport ' not enabled. Skipping. Jan 12 11:37:59 Raspi weewx[25741] DEBUG weewx.reportengine: Running report 'Belche rtown' Jan 12 11:37:59 Raspi weewx[25741] DEBUG weewx.reportengine: Found configuration fi le /etc/weewx/skins/Belchertown/skin.conf for report 'Belchertown' Jan 12 11:38:00 Raspi weewx[25741] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetah generator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInf o', 'weewx.cheetahgenerator.Extras', 'user.belchertown.getData'] Jan 12 11:38:00 Raspi weewx[25741] DEBUG weewx.manager: Daily summary version is 3. 0 Jan 12 11:38:00 Raspi weewx[25741] INFO weewx.cheetahgenerator: Generated 11 files for report Belchertown in 0.97 seconds Jan 12 11:38:00 Raspi weewx[25741] INFO weewx.reportengine: Copied 2 files to /var/ www/html Jan 12 11:38:01 Raspi weewx[25741] DEBUG weewx.manager: Daily summary version is 3. 0 Jan 12 11:38:02 Raspi weewx[25741] DEBUG weewx.reportengine: Report 'FTP' not enabl ed. Skipping. Jan 12 11:38:02 Raspi weewx[25741] DEBUG weewx.reportengine: Report 'RSYNC' not ena bled. Skipping.

The info about readings for signals and battery its via extensions info

`class CloudClient(Collector): """Poll the netatmo servers for data. Put the result on the queue. noise is measured in dB co2 is measured in ppm rain is measured in mm temperatures are measured in C or F the user object indicates the units of the download unit: 0: metric, 1: imperial windunit: 0: kph, 1: mph, 2: m/s, 3: beafort, 4: knot pressureunit: 0: mbar, 1: inHg, 2: mmHg lang: user locale reg_locale: regional preferences for date feel_like_algo: 0: humidex, 1: heat-index rf_status is a mapping to rssi (+dB) 0: 90, 1: 80, 2: 70, 3: 60 wifi_status is a mapping to rssi (+dB) 0: 86, 1: 71, 2: 56 battery_vp measures battery capacity indoor: 6000-4200; 0: 5640, 1: 5280, 2: 4920, 3: 4560 rain/outdoor: 6000-3600; 0: 5500, 1: 5000, 2: 4500, 3: 4000 wind: 6000-3950; 0: 5590, 1: 5180, 2: 4770, 3: 4360`

I have tryed to figuring out how to do to get the correct reading for this information but i cant get it.
I even tryed to change the extended schema but with out respons so i change it back there to basic again.
Tryed now for 3 weeks and now i ask for your help.

I have write this as issue in netatmo extension to Matthewwall to but didnt get respons so i ask for help here.

I hope someone can help me to how i can configuring this in essy way or if someone mabey have a working configfile to share with me that works 👍


All other readings works fine

gjr80

unread,
Jan 14, 2021, 8:54:01 AM1/14/21
to weewx-user
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, 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

sensors.txt

Rebecka Johansson

unread,
Jan 15, 2021, 7:18:12 AM1/15/21
to weewx-user

Thanks
I did as you writed.
Seasons skin does the reading like this now but with many extra numbers of 0.

Like i writed in first post i orginally use Belchertown skins and use seasons to fix whats reading and how to code!




Connectivity

WiFi Signal
good(56,000000)

Outdoor Module Signal
high(66,000000)

Anemometer Signal
high(61,000000)

Rain Gauge Signal
high(61,000000)

Battery Status
Anemometer Battery
full(95,000000)

Rain Gauge Battery
max(100,000000)

Outdoor Module Battery
full(93,000000)



What i read in netatmo.py file i saw that battery_vp is for old firmware and used for the older Wveiw.py
In the Netatmo.py file it is writed like this now.


class NetatmoDriver(weewx.drivers.AbstractDevice):
    DEFAULT_PORT = 80
    DEFAULT_HOST = ""
    # map from netatmo names to database schema names
    # apparently battery_vp is in older firmware, whereas battery_percent is
    # in newer firmware.
    DEFAULT_SENSOR_MAP = {
        'pressure':                               '*.NAMain.AbsolutePressure',
        'inTemp':                                 '*.NAMain.Temperature',
        'inHumidity':                           '*.NAMain.Humidity',
        'co2':                                       '*.NAMain.CO2',
        'noise':                                    '*.NAMain.Noise',
        'wifi_status':                          '*.NAMain.wifi_status',
        'outTemp':                             '*.NAModule1.Temperature',
        'outHumidity':                       '*.NAModule1.Humidity',
        'out_rf_status':                      '*.NAModule1.rf_status',
        'out_battery_vp':                   '*.NAModule1.battery_vp', (Older firmware)
        'outTempBatteryStatus':     '*.NAModule1.battery_percent',
        'windSpeed':                         '*.NAModule2.WindStrength',
        'windDir':                               '*.NAModule2.WindAngle',
        'windGust':                            '*.NAModule2.GustStrength',
        'windGustDir':                       '*.NAModule2.GustAngle',
        'wind_rf_status':                  '*.NAModule2.rf_status',
        'wind_battery_vp':                '*.NAModule2.battery_vp', (Older firmware)
        'windBatteryStatus':            '*.NAModule2.battery_percent', 
        'rain':                                       '*.NAModule3.Rain',
        'rain_total':                              '*.NAModule3.sum_rain_24',
        'rain_rf_status':                      '*.NAModule3.rf_status',
        'rain_battery_vp':                    '*.NAModule3.battery_vp', (Older firmware)
        'rainBatteryStatus':                '*.NAModule3.battery_percent'}


I also send my REC / LOOP
REC:    2021-01-15 12:50:00 CET (1610711400) altimeter: 1024.4038696830132, appTemp: -7.884807942435174, barometer: 1024.4032036270912, batteryStatus1: 5872.0, batteryStatus2: 5898.0, batteryStatus3: 6036.0, cloudbase: 551.6903180909593, co2: 700.0, dateTime: 1610711400, dewpoint: -9.143009058869266, ET: None, heatindex: -4.7, humidex: -4.7, inDewpoint: 9.238783201935856, inHumidity: 38.0, inTemp: 24.5, interval: 5.0, maxSolarRad: None, noise: 43.0, outHumidity: 71.0, outTemp: -4.7, outTempBatteryStatus: 93.0, pressure: 1023.1, rain: 0.0, rainBatteryStatus: 100.0, rainRate: 0.0, rain_total: 0.0, signal1: 57.0, signal2: 67.0, signal3: 62.0, signal4: 62.0, usUnits: 16, windBatteryStatus: 95.0, windchill: -4.7, windDir: 210.0, windGust: 2, windGustDir: 210, windrun: 0.08333333333333333, windSpeed: 1.0
LOOP:   2021-01-15 12:59:12 CET (1610711952) altimeter: 1024.4038696830132, appTemp: -7.777147909039572, barometer: 1024.4027180441597, batteryStatus1: 5872, batteryStatus2: 5900, batteryStatus3: 6036, cloudbase: 552.1509511394135, co2: 703, dateTime: 1610711952, dewpoint: -9.046787226465668, heatindex: -4.6000000000000005, humidex: -4.6, inDewpoint: 9.238783201935856, inHumidity: 38, inTemp: 24.5, maxSolarRad: None, noise: 43, outHumidity: 71, outTemp: -4.6, outTempBatteryStatus: 93, pressure: 1023.1, rain: 0.0, rainBatteryStatus: 100, rainRate: 0.0, rain_total: 0.0, signal1: 56, signal2: 66, signal3: 61, signal4: 61, usUnits: 16, windBatteryStatus: 95, windchill: -4.6000000000000005, windDir: 211, windGust: 3, windGustDir: 220, windSpeed: 1

I see i have two kind of battery status 
batteryStatus1: 5872.0
batteryStatus2: 5898.0
batteryStatus3: 6036.0

outTempBatteryStatus: 93.0
windBatteryStatus: 95.0
rainBatteryStatus: 100.0


Here is my debug log (I deleted personal id and passwords)


System info
  Platform:       Linux-5.4.83-v7l+-armv7l-with-debian-10.7
  Python Version: 3.7.3

Load Information
  1 minute load average:  0.30
  5 minute load average:  0.60
  15 minute load average: 0.77

General Weewx info
  Weewx version 4.3.0 detected.

Station info
  Station type: netatmo
  Driver:       user.netatmo

Driver info
[netatmo]
    
    # This section is for the netatmo station.
    
    # The mode specifies how driver should obtain data.  The 'cloud' mode will
    # retrieve data from the netatmo.com servers.  The 'sniff' mode will parse
    # packets from the netatmo station on the local network.
    mode = cloud
    
    # The cloud mode requires credentials:
    username = johansso...@outlook.com
    password = password
    client_id = id
    client_secret = secret
    
    # The driver itself
    driver = user.netatmo
    
    
    [[sensor_map]]
        
        pressure = *.NAMain.AbsolutePressure
        inTemp = *.NAMain.Temperature
        inHumidity = *.NAMain.Humidity
        co2 = *.NAMain.CO2
        noise = *.NAMain.Noise
        
        outTemp = *.NAModule1.Temperature
        outHumidity = *.NAModule1.Humidity
        
        windSpeed = *.NAModule2.WindStrength
        windDir = *.NAModule2.WindAngle
        windGust = *.NAModule2.GustStrength
        windGustDir = *.NAModule2.GustAngle
        
        rain = *.NAModule3.Rain
        rain_total = *.NAModule3.sum_rain_24
        
        
        
        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 = *.NAModule3.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

Currently installed extensions
Extension Name    Version   Description
Belchertown       1.2       A clean modern skin with real time streaming updates and interactive charts. Modeled after BelchertownWeather.com
netatmo           0.14      Driver for netatmo weather stations.
mqtt              0.23      Upload weather data to MQTT server.

Archive info
  Database name:        weewx.sdb
  Table name:           archive
  Version               3.0
  Unit system:          16 (METRIC)
  First good timestamp: 2021-01-10 09:55:00 CET (1610268900)
  Last good timestamp:  2021-01-15 13:05:00 CET (1610712300)
  Number of records:    1357
  weewx (weewx.conf) is set to use an archive interval of 300 seconds.
  The station hardware was not interrogated in determining archive interval.

Databases configured in weewx.conf
  Database name:        weewx.sdb
  Database driver:      weedb.sqlite

  Database name:        weewx
  Database driver:      weedb.mysql
  Database host:        localhost


Parsed and obfuscated weewx.conf
# WEEWX CONFIGURATION FILE
#
# Copyright (c) 2009-2021 Tom Keffer <>
# See the file LICENSE.txt for your rights.

##############################################################################

# This section is for general configuration information.

# Set to 1 for extra debug info, otherwise comment it out or set to zero
debug = 1

# Root directory of the weewx data file hierarchy for this station
WEEWX_ROOT = /

# Whether to log successful operations
log_success = True

# Whether to log unsuccessful operations
log_failure = True

# How long to wait before timing out a socket (FTP, HTTP) connection
socket_timeout = 20

# Do not modify this. It is used when installing and updating weewx.
version = 4.3.0

##############################################################################

#   This section is for information about the station.

[Station]
    
    # Description of the station location
    location = Kristianstad - Sweden
    
    # Latitude in decimal degrees. Negative for southern hemisphere
    latitude = 56.033
    # Longitude in decimal degrees. Negative for western hemisphere.
    longitude = 14.1547
    
    # Altitude of the station, with unit it is in. This is downloaded from
    # from the station if the hardware supports it.
    altitude = 10, meter
    
    # Set to type of station hardware. There must be a corresponding stanza
    # in this file with a 'driver' parameter indicating the driver to be used.
    station_type = netatmo
    
    # If you have a website, you may specify an URL
    station_url = XXX obfuscated by wee_debug XXX
    
    # The start of the rain year (1=January; 10=October, etc.). This is
    # downloaded from the station if the hardware supports it.
    rain_year_start = 1
    
    # Start of week (0=Monday, 6=Sunday)
    week_start = 0

##############################################################################

[netatmo]
    
    # This section is for the netatmo station.
    
    # The mode specifies how driver should obtain data.  The 'cloud' mode will
    # retrieve data from the netatmo.com servers.  The 'sniff' mode will parse
    # packets from the netatmo station on the local network.
    mode = cloud
    
    # The cloud mode requires credentials:
    username = XXX obfuscated by wee_debug XXX
    password = XXX obfuscated by wee_debug XXX
    client_id = id
    client_secret = secret
    
    # The driver itself
    driver = user.netatmo
    
    
    [[sensor_map]]
        
        pressure = *.NAMain.AbsolutePressure
        inTemp = *.NAMain.Temperature
        inHumidity = *.NAMain.Humidity
        co2 = *.NAMain.CO2
        noise = *.NAMain.Noise
        
        outTemp = *.NAModule1.Temperature
        outHumidity = *.NAModule1.Humidity
        
        windSpeed = *.NAModule2.WindStrength
        windDir = *.NAModule2.WindAngle
        windGust = *.NAModule2.GustStrength
        windGustDir = *.NAModule2.GustAngle
        
        rain = *.NAModule3.Rain
        rain_total = *.NAModule3.sum_rain_24
        
        
        
        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 = *.NAModule3.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



# Smart anemometer battery status
# Description

#  6000 = max
#  5590 = full
#  5180 = high
#  4770 = medium
#  4360 = low
# <4360 = very low


# Outdoor Module and RainGauge battery status
# Description

#  6000 = max
#  5500 = full
#  5000 = high
#  4500 = medium
#  4000 = low
# <4000 = very low


# Wifi status
# Signal quality

# 86 = Bad
# 71 = Average
# 56 = Good


##############################################################################

[Simulator]
    # This section is for the weewx weather station simulator
    
    # The time (in seconds) between LOOP packets.
    loop_interval = 2.5
    
    # The simulator mode can be either 'simulator' or 'generator'.
    # Real-time simulator. Sleep between each LOOP packet.
    mode = simulator
    # Generator.  Emit LOOP packets as fast as possible (useful for testing).
    #mode = generator
    
    # The start time. Format is YYYY-mm-ddTHH:MM. If not specified, the default 
    # is to use the present time.
    #start = 2011-01-01T00:00
    
    # The driver to use:
    driver = weewx.drivers.simulator

##############################################################################

#   This section is for uploading data to Internet sites

[StdRESTful]
    
    [[StationRegistry]]
        # To register this weather station with weewx, set this to true
        register_this_station = true
    
    [[AWEKAS]]
        # This section is for configuring posts to AWEKAS.
        
        # If you wish to do this, set the option 'enable' to true,
        # and specify a username and password.
        # To guard against parsing errors, put the password in quotes.
        enable = false
        username = XXX obfuscated by wee_debug XXX
        password = XXX obfuscated by wee_debug XXX
    
    [[CWOP]]
        # This section is for configuring posts to CWOP.
        
        # If you wish to do this, set the option 'enable' to true,
        # and specify the station ID (e.g., CW1234).
        enable = false
        station = XXX obfuscated by wee_debug XXX
    
    # If this is an APRS (radio amateur) station, uncomment
    # the following and replace with a passcode (e.g., 12345).
    #passcode = replace_me (APRS stations only)
    
    [[PWSweather]]
        # This section is for configuring posts to PWSweather.com.
        
        # If you wish to do this, set the option 'enable' to true,
        # and specify a station and password.
        # To guard against parsing errors, put the password in quotes.
        enable = true
        station = XXX obfuscated by wee_debug XXX
        password = XXX obfuscated by wee_debug XXX
    
    [[WOW]]
        # This section is for configuring posts to WOW.
        
        # If you wish to do this, set the option 'enable' to true,
        # and specify a station and password.
        # To guard against parsing errors, put the password in quotes.
        enable = false
        station = XXX obfuscated by wee_debug XXX
        password = XXX obfuscated by wee_debug XXX
    
    [[Wunderground]]
        # This section is for configuring posts to the Weather Underground.
        
        # If you wish to do this, set the option 'enable' to true,
        # and specify a station (e.g., 'KORHOODR3') and password.
        # To guard against parsing errors, put the password in quotes.
        enable = true
        station = XXX obfuscated by wee_debug XXX
        password = XXX obfuscated by wee_debug XXX
        
        # If you plan on using wunderfixer, set the following
        # to your API key:
        api_key = XXX obfuscated by wee_debug XXX
        
        # Set the following to True to have weewx use the WU "Rapidfire"
        # protocol. Not all hardware can support it. See the User's Guide.
        rapidfire = False
    
    [[MQTT]]
        server_url = XXX obfuscated by wee_debug XXX
        topic = weather
        unit_system = METRIC
        binding = archive, loop
        aggregation = aggregate


##############################################################################

#   This section specifies what reports, using which skins, to generate.

[StdReport]
    
    # Where the skins reside, relative to WEEWX_ROOT
    SKIN_ROOT = /etc/weewx/skins
    
    # Where the generated reports should go, relative to WEEWX_ROOT
    HTML_ROOT = /var/www/html/weewx
    
    # The database binding indicates which data should be used in reports.
    data_binding = wx_binding
    
    # Whether to log a successful operation
    log_success = True
    
    # Whether to log an unsuccessful operation
    log_failure = True
    
    # Each of the following subsections defines a report that will be run.
    # See the customizing guide to change the units, plot types and line
    # colors, modify the fonts, display additional sensor data, and other
    # customizations. Many of those changes can be made here by overriding
    # parameters, or by modifying templates within the skin itself.
    
    [[SeasonsReport]]
        # The SeasonsReport uses the 'Seasons' skin, which contains the
        # images, templates and plots for the report.
        skin = Seasons
        enable = true
    
    [[SmartphoneReport]]
        # The SmartphoneReport uses the 'Smartphone' skin, and the images and
        # files are placed in a dedicated subdirectory.
        skin = Smartphone
        enable = false
        HTML_ROOT = /var/www/html/weewx/smartphone
    
    [[MobileReport]]
        # The MobileReport uses the 'Mobile' skin, and the images and files
        # are placed in a dedicated subdirectory.
        skin = Mobile
        enable = false
        HTML_ROOT = /var/www/html/weewx/mobile
    
    [[StandardReport]]
        # This is the old "Standard" skin. By default, it is not enabled.
        skin = Standard
        enable = false
    
    
    [[Belchertown]]
        skin = Belchertown
        HTML_ROOT = /var/www/html
    
    [[FTP]]
        # FTP'ing the results to a webserver is treated as just another report,
        # albeit one with an unusual report generator!
        skin = Ftp
        
        # If you wish to use FTP, set "enable" to "true", then
        # fill out the next four lines.
        # Use quotes around passwords to guard against parsing errors.
        enable = false
        user = XXX obfuscated by wee_debug XXX
        password = XXX obfuscated by wee_debug XXX
        server = replace_me    # The ftp server name, e.g, www.myserver.org
        path = replace_me    # The destination directory, e.g., /weather
        
        # Set to True for an FTP over TLS (FTPS) connection. Not all servers
        # support this.
        secure_ftp = False
        
        # To upload files from something other than what HTML_ROOT is set
        # to above, specify a different HTML_ROOT here.
        #HTML_ROOT = /var/www/html/weewx
        
        # Most FTP servers use port 21
        port = 21
        
        # Set to 1 to use passive mode, zero for active mode
        passive = 1
    
    [[RSYNC]]
        # rsync'ing to a webserver is treated as just another report
        skin = Rsync
        
        # If you wish to use rsync, you must configure passwordless ssh using
        # public/private key authentication from the user account that weewx
        # runs to the user account on the remote machine where the files
        # will be copied.
        #
        # If you wish to use rsync, set "enable" to "true", then
        # fill out server, user, and path.
        # The server should appear in your .ssh/config file.
        # The user is the username used in the identity file.
        # The path is the destination directory, such as /var/www/html/weather.
        # Be sure that the user has write permissions on the destination!
        enable = false
        server = replace_me
        user = XXX obfuscated by wee_debug XXX
        path = replace_me
        
        # To upload files from something other than what HTML_ROOT is set
        # to above, specify a different HTML_ROOT here.
        #HTML_ROOT = /var/www/html/weewx
        
        # Rsync can be configured to remove files from the remote server if
        # they don't exist under HTML_ROOT locally. USE WITH CAUTION: if you
        # make a mistake in the remote path, you could could unintentionally
        # cause unrelated files to be deleted. Set to 1 to enable remote file
        # deletion, zero to allow files to accumulate remotely.
        delete = 0
    
    ####
    
    # Various options for customizing your reports.
    
    [[Defaults]]
        
        [[[Units]]]
            
            # The following section sets what unit to use for each unit group.
            # NB: The unit is always in the singular. I.e., 'mile_per_hour',
            # NOT 'miles_per_hour'
            [[[[Groups]]]]
                
                group_pressure = mbar
                group_altitude = meter
                group_degree_day = degree_C_day
                group_distance = km
                group_rain = mm
                group_rainrate = mm_per_hour
                group_speed = meter_per_second
                group_speed2 = meter_per_second2
                group_temperature = degree_C
                group_concentration = microgram_per_meter_cubed
                group_db = dB
                group_fraction = ppm
                group_interval = minute
                group_percent = percent
                group_radiation = watt_per_meter_squared
                group_time = unix_epoch
                group_volt = volt
            
            
            # The following section sets the formatting for each type of unit.
            [[[[StringFormats]]]]
                
                centibar = %.0f
                cm = %.2f
                cm_per_hour = %.2f
                degree_C = %.1f
                degree_F = %.1f
                degree_compass = %.0f
                foot = %.0f
                hPa = %.1f
                hour = %.1f
                inHg = %.3f
                inch = %.2f
                inch_per_hour = %.2f
                km = %.1f
                km_per_hour = %.0f
                km_per_hour2 = %.1f
                knot = %.0f
                knot2 = %.1f
                kPa = %.2f
                mbar = %.1f
                meter = %.0f
                meter_per_second = %.1f
                meter_per_second2 = %.1f
                mile = %.1f
                mile_per_hour = %.0f
                mile_per_hour2 = %.1f
                mm = %.1f
                mmHg = %.1f
                mm_per_hour = %.1f
                percent = %.0f
                second = %.0f
                uv_index = %.1f
                volt = %.1f
                watt_per_meter_squared = %.0f
                NONE = "   N/A"
            
            # The following section overrides the label used for each type of unit
            [[[[Labels]]]]
                
                meter = " meter", " meters"    # You may prefer "metre".
                day = " day", " days"
                hour = " hour", " hours"
                minute = " minute", " minutes"
                second = " second", " seconds"
                NONE = ""
            
            # The following section sets the format for each time scale.
            # The values below will work in every locale, but they may not look
            # particularly attractive.
            [[[[TimeFormats]]]]
                
                day = %H:%M
                week = %H:%M on %A
                month = %d-%b-%Y %H:%M
                year = %d-%b-%Y %H:%M
                rainyear = %d-%b-%Y %H:%M
                current = %d-%b-%Y %H:%M
                ephem_day = %H:%M
                ephem_year = %d-%b-%Y %H:%M
            
            [[[[Ordinates]]]]
                
                # Ordinal directions. The last one is for no wind direction
                directions = N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW, N/A
            
            # The following section sets the base temperatures used for the
            #  calculation of heating, cooling, and growing degree-days.
            [[[[DegreeDays]]]]
                
                # Base temperature for heating days, with unit:
                heating_base = 65, degree_F
                # Base temperature for cooling days, with unit:
                cooling_base = 65, degree_F
                # Base temperature for growing days, with unit:
                growing_base = 50, degree_F
            
            # A trend takes a difference across a time period. The following
            # section sets the time period, and how big an error is allowed to
            # still be counted as the start or end of a period.
            [[[[Trend]]]]
                
                time_delta = 10800    # 3 hours
                time_grace = 300    # 5 minutes
        
        # The labels to be used for each observation type
        [[[Labels]]]
            
            # Set to hemisphere abbreviations suitable for your location:
            hemispheres = N, S, E, W
            
            # Formats to be used for latitude whole degrees, longitude whole
            # degrees, and minutes:
            latlon_formats = %02d, %03d, %05.2f
            
            # Generic labels, keyed by an observation type.
            [[[[Generic]]]]
                pressure = Pressure
                barometer = Barometer
                dewpoint = Dew Point
                humidex = Humidex
                heatindex = Heat Index
                inHumidity = In Humidity
                inTemp = In Temp
                noise = dB
                co2 = CO2
                o3 = AIQ
                outHumidity = Humidity
                outTemp = Out Temperature
                maxSolarRad = Max Solar
                rain = Rain
                rainRate = Rain Rate
                windDir = Wind Direction
                windGust = Gust Speed
                windGustDir = Gust Direction
                windSpeed = Wind Speed
                windchill = Wind Chill
                windgustvec = Gust Vector
                windvec = Wind Vector
                
                
                # Sensor status indicators
                
                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 Signal
                signal2 = Outdoor Module Signal
                signal3 = Anemometer Signal
                signal4 = Rain Gauge Signal
        
        
        
        
        [[[Almanac]]]
            
            # The labels to be used for the phases of the moon:
            moon_phases = New, Waxing crescent, First quarter, Waxing gibbous, Full, Waning gibbous, Last quarter, Waning crescent

##############################################################################

#   This service acts as a filter, converting the unit system coming from
#   the hardware to a unit system in the database.

[StdConvert]
    
    # The target_unit affects only the unit system in the database. Once
    # chosen it cannot be changed without converting the entire database.
    # Modification of target_unit after starting weewx will result in
    # corrupt data - the database will contain a mix of US and METRIC data.
    #
    # The value of target_unit does not affect the unit system for
    # reporting - reports can display US, Metric, or any combination of units.
    #
    # In most cases, target_unit should be left as the default: US
    #
    # In particular, those migrating from a standard wview installation
    # should use US since that is what the wview database contains.
    
    # DO NOT MODIFY THIS VALUE UNLESS YOU KNOW WHAT YOU ARE DOING!
    target_unit = METRIC    # Options are 'US', 'METRICWX', or 'METRIC'

##############################################################################

#   This section can adjust data using calibration expressions.

[StdCalibrate]
    
    [[Corrections]]
        # For each type, an arbitrary calibration expression can be given.
        # It should be in the units defined in the StdConvert section.
        # Example:
        foo = foo - 1.5

##############################################################################

#   This section is for quality control checks. If units are not specified,
#   values must be in the units defined in the StdConvert section.

[StdQC]
    
    [[MinMax]]
        pressure = 260, 1160, mbar
        outTemp = -40, 65, degree_C
        inTemp = 0, 50, degree_C
        outHumidity = 0, 100
        inHumidity = 0, 100
        windSpeed = 0, 50, meter_per_second
        rain = 0, 150, mm
        co2 = 0, 5000, ppm
        noise = 35, 110, dB

##############################################################################

#   This section controls the origin of derived values.

[StdWXCalculate]
    
    [[Calculations]]
        # How to calculate derived quantities.  Possible values are:
        #  hardware        - use the value provided by hardware
        #  software        - use the value calculated by weewx
        #  prefer_hardware - use value provide by hardware if available,
        #                      otherwise use value calculated by weewx
        
        pressure = prefer_hardware
        altimeter = prefer_hardware
        appTemp = prefer_hardware
        barometer = prefer_hardware
        cloudbase = prefer_hardware
        dewpoint = prefer_hardware
        ET = prefer_hardware
        heatindex = prefer_hardware
        humidex = prefer_hardware
        inDewpoint = prefer_hardware
        maxSolarRad = prefer_hardware
        rainRate = prefer_hardware
        windchill = prefer_hardware
        windrun = prefer_hardware

##############################################################################

#   For hardware that supports it, this section controls how often the
#   onboard clock gets updated.

[StdTimeSynch]
    
    # How often to check the weather station clock for drift (in seconds)
    clock_check = 14400
    
    # How much it can drift before we will correct it (in seconds)
    max_drift = 5

##############################################################################

#   This section is for configuring the archive service.

[StdArchive]
    
    # If the station hardware supports data logging then the archive interval
    # will be downloaded from the station. Otherwise, specify it (in seconds).
    archive_interval = 300
    
    # If possible, new archive records are downloaded from the station
    # hardware. If the hardware does not support this, then new archive
    # records will be generated in software.
    # Set the following to "software" to force software record generation.
    record_generation = hardware
    
    # Whether to include LOOP data in hi/low statistics
    loop_hilo = True
    
    # The data binding used to save archive records
    data_binding = wx_binding

##############################################################################

#   This section binds a data store to a database.

[DataBindings]
    
    [[wx_binding]]
        # The database must match one of the sections in [Databases].
        # This is likely to be the only option you would want to change.
        database = archive_sqlite
        # The name of the table within the database
        table_name = archive
        # The manager handles aggregation of data for historical summaries
        manager = weewx.manager.DaySummaryManager
        # The schema defines the structure of the database.
        # It is *only* used when the database is created.
        schema = schemas.wview_extended.schema

##############################################################################

#   This section defines various databases.

[Databases]
    
    # A SQLite database is simply a single file
    [[archive_sqlite]]
        database_name = weewx.sdb
        database_type = SQLite
    
    # MySQL
    [[archive_mysql]]
        database_name = weewx
        database_type = MySQL

##############################################################################

#   This section defines defaults for the different types of databases.

[DatabaseTypes]
    
    # Defaults for SQLite databases
    [[SQLite]]
        driver = weedb.sqlite
        # Directory in which the database files are located
        SQLITE_ROOT = /var/lib/weewx
    
    # Defaults for MySQL databases
    [[MySQL]]
        driver = weedb.mysql
        # The host where the database is located
        host = localhost
        # The user name for logging in to the host
        user = XXX obfuscated by wee_debug XXX
        # The password for the user name (quotes guard against parsing errors)
        password = XXX obfuscated by wee_debug XXX

##############################################################################

#   This section configures the internal weewx engine.

[Engine]
    
    # The following section specifies which services should be run and in what order.
    [[Services]]
        prep_services = weewx.engine.StdTimeSynch
        data_services = ,
        process_services = weewx.engine.StdConvert, weewx.engine.StdCalibrate, weewx.engine.StdQC, weewx.wxservices.StdWXCalculate
        xtype_services = weewx.wxxtypes.StdWXXTypes, weewx.wxxtypes.StdPressureCooker, weewx.wxxtypes.StdRainRater, weewx.wxxtypes.StdDelta
        archive_services = weewx.engine.StdArchive
        restful_services = weewx.restx.StdStationRegistry, weewx.restx.StdWunderground, weewx.restx.StdPWSweather, weewx.restx.StdCWOP, weewx.restx.StdWOW, weewx.restx.StdAWEKAS, user.mqtt.MQTT
        report_services = weewx.engine.StdPrint, weewx.engine.StdReport

wee_debug report successfully generated

gjr80

unread,
Jan 15, 2021, 7:54:51 AM1/15/21
to weewx-user
You’ve done well, that is all of the hard work done! The rest is just formatting.

I am no netatmo expert but reading through the driver and from what info I could find on the internet, it does appear that there are two distinct battery state fields for each sensor; battery_vp which (according to netatmo) is a large number that appears to equate to a descriptive battery state (that is where the max/fulll/low is derived from) and battery_percent (which the netatmo driver maps to xxxxxBatteryStatus). One of those may well be from the old firmware but your station emits both field types for each sensor. When I put together the new sensors.inc I wanted to format the battery state entries as ‘descriptive word (battery %)’, eg:

Anemometer Battery       full(95%)

The 95.000000 is just a formatting/unit issue that is easily fixed. I guess the question for you is what do you want to display? Just the descriptive word, just the percentage or both?

Similar arrangement with the wifi/RF status, there is the actual signal level (ie the number) and descriptive text that netatmo lists for different RF signal levels. Do you want just the descriptive text or the number or both?

Let me know and we can adjust sensors.inc accordingly.

For info if you haven’t already found it the ranges of battery_vp and the corresponding descriptive text for each sensor is shown in a number of tables on this page (https://dev.netatmo.com/apidocumentation/weather) . Likewise for Wifi status, not sure where Infound the descriptive text for RF status though.

Afraid I can’t help with integrating the battery states and RF signal levels into Belchertown, you will need someone who is familiar with the Belchertown skin. Though you now have the relevant database in your database so I am sure that will get you part way there.

Gary

Rebecka Johansson

unread,
Jan 15, 2021, 11:28:48 PM1/15/21
to weewx-user
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

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.

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%" 



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 :) 

gjr80

unread,
Jan 16, 2021, 12:59:41 AM1/16/21
to weewx-user
On Saturday, 16 January 2021 at 14:28:48 UTC+10 johansso...@outlook.com 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
 
sensors.txt

Rebecka Johansson

unread,
Jan 16, 2021, 1:35:56 AM1/16/21
to weewx-user
I do as you described :)

But got errors after i replaced the new sensors.inc code

The log error shows this

"Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'Cheetah.Parser.ParseError'>'
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/Seasons/index.html.tmpl
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: **** Reason: #012#012Some #directives are missing their corresponding #end ___ tag: if, if#012Line 153, column 7 in file /etc/weewx/skins/Seasons/sensors.inc#012#012Line|Cheetah Code#012----|-------------------------------------------------------------#012150 |  </div>#012151 |#012152 |</div>#012153 |#end if#012           ^
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 323, in generate
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_Seasons_index_html_tmpl.py", line 225, in respond
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1685, in _handleCheetahInclude
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****      file=file)
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 775, in compile
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****      compiler.compile()
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Compiler.py", line 1799, in compile
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****      self._parser.parse()
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Parser.py", line 1554, in parse
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****      self.assertEmptyOpenDirectivesStack()
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Parser.py", line 2778, in assertEmptyOpenDirectivesStack
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****      raise ParseError(self, msg=errorMsg)
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  Cheetah.Parser.ParseError: 
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  Some #directives are missing their corresponding #end ___ tag: if, if
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  Line 153, column 7 in file /etc/weewx/skins/Seasons/sensors.inc
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  Line|Cheetah Code
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  ----|-------------------------------------------------------------
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  150 |  </div>
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  151 |
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  152 |</div>
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  153 |#end if
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****             ^
Jan 16 07:33:21 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'Cheetah.Parser.ParseError'>'
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/Seasons/telemetry.html.tmpl
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: **** Reason: #012#012Some #directives are missing their corresponding #end ___ tag: if, if#012Line 153, column 7 in file /etc/weewx/skins/Seasons/sensors.inc#012#012Line|Cheetah Code#012----|-------------------------------------------------------------#012150 |  </div>#012151 |#012152 |</div>#012153 |#end if#012           ^
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 323, in generate
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_Seasons_telemetry_html_tmpl.py", line 195, in respond
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1685, in _handleCheetahInclude
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****      file=file)
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 775, in compile
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****      compiler.compile()
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Compiler.py", line 1799, in compile
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****      self._parser.parse()
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Parser.py", line 1554, in parse
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****      self.assertEmptyOpenDirectivesStack()
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Parser.py", line 2778, in assertEmptyOpenDirectivesStack
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****      raise ParseError(self, msg=errorMsg)
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  Cheetah.Parser.ParseError: 
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  Some #directives are missing their corresponding #end ___ tag: if, if
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  Line 153, column 7 in file /etc/weewx/skins/Seasons/sensors.inc
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  Line|Cheetah Code
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  ----|-------------------------------------------------------------
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  150 |  </div>
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  151 |
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  152 |</div>
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  153 |#end if
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****             ^
Jan 16 07:33:22 Raspi wee_reports[12432] ERROR weewx.cheetahgenerator: ****  
"

Rebecka Johansson

unread,
Jan 16, 2021, 1:52:28 AM1/16/21
to weewx-user
i think it works now.
I dont know what i did but i use the early sensor.inc code you gave me and the readings is now this

Connectivity
WiFi Signal
(57 dB)

Outdoor Module Signal
(66 dB)

Anemometer Signal
(69 dB)

Rain Gauge Signal
(62 dB)

Battery Status
Anemometer Battery
(95%)

Rain Gauge Battery
(100%)

Outdoor Module Battery
(93%)


gjr80

unread,
Jan 16, 2021, 2:21:49 AM1/16/21
to weewx-user
Ah, that was my mistake, I deleted a few lines I should not have. Try this sensors.txt; same deal, download, rename and save as /etc/weewx/skins/Seasons/sensors.inc. No need to restart WeeWx this time, just wait for the report cycle to complete.

Gary
sensors.txt

Rebecka Johansson

unread,
Jan 16, 2021, 3:35:05 AM1/16/21
to weewx-user

Now it works :) Many MANY thanks for you help and time you give me to fix this!

Connectivity
WiFi Signal 58 dB
Outdoor Module Signal 65 dB
Anemometer Signal 67 dB
Rain Gauge Signal 63 dB

Battery Status
Anemometer Battery 94%
Rain Gauge Battery 100%
Outdoor Module Battery 93%

ve2se

unread,
Jan 16, 2021, 12:53:06 PM1/16/21
to weewx-user
Neowx  skin  works fine  with Netatmo
Reply all
Reply to author
Forward
0 new messages