Lightning Data Stored in weewx.sdb

1,429 views
Skip to first unread message

Troy Roberts

unread,
Jul 21, 2020, 5:50:09 PM7/21/20
to weewx-user
I am relatively new to weewx and I'm starting to feel my way around. I am currently running version 4.1.1 with an Acurite5n1. I recently purchased an Acurite Lightning Detector (6045m) and I've been able to map the sensor to weewx successfully. However, there appears to be an issue with how it is storing strike counts in the weewx.sdb.

So to start, below is the just the lightning data portion of the sensor map in my weewx.conf:

[[sensor_map]]
       
        extraTemp5
= temperature.xxxx.AcuriteLightningPacket
        extraHumid5
= humidity.xxxx.AcuriteLightningPacket
        lightning_distance
= distance.xxxx.AcuriteLightningPacket
        strikes_total
= strikes_total.xxxx.AcuriteLightningPacket
        lightning_disturber_count
= rfi.xxxx.AcuriteLightningPacket
        lightning_noise_count
= active.xxxx.AcuriteLightningPacket
        lightning_energy
= exception.xxxx.AcuriteLightningPacket
   
[[deltas]]
        lightning_strike_count
= strikes_total


[[Corrections]]
        lightning_distance
= lightning_distance if lightning_strike_count > 0 else None



I chose the names "lightning_distance" and "lightning_strike_count" as those are the names defined in the "~/schemas/wview_extended.py" file.

When I looked through the weewx.sdb for recent lightning data that was collected (5 min intervals), the "lightning_strike_count" logged a value of 0.036697247706422 and "lightning_distance" logged 19 for the particular time period that lightning activity was present. Upon reviewing the syslog where loop data was being captured, the "lightning_distance" and "lightning_strike_count" was collecting correctly (see attached syslog_lightningData.txt). In the syslog_lightningData.txt for the 5 min time span there were 4 detected lightning strikes each occurring at 15, 22, 22, and 17 miles. During that 5 min span, the lightning data generated 109 packets of loop data. So upon reviewing the data being logged in the weewx.sdb, it looks like the average for "lightning_distance" and "lightning_strike_count" is being stored. So 4 strike counts divided by 109 collections (as the rest of the strike_counts were stored as 0) results in 0.036697247706422 for "lightning_strike_count" and 19 miles (15+22+22+17)/4  for lightning_distance. Is there a way to change how the lightning data is being stored in the weewx.sdb or should I create a separate schemas for the lightning data?

Thanks,
Troy

Syslog_lightningData.txt

gjr80

unread,
Jul 23, 2020, 9:57:54 AM7/23/20
to weewx-user
Hi,

A little background as to how WeeWX takes loop data and generates archive records to save to database. WeeWX accumulates the loop data seen during an archive interval and when using software record generation (as you are) WeeWX synthesises an archive record from the accumulated loop data at the end of the archive period. The value for each observation in the archive record is calculated from the accumulated values using an extractor function. The default extractor function is ‘average’. Average is fine for most observations (eg temperatures and pressures) but is unsuitable for something like rain. For rain we use ‘sum’ as the extractor function. WeeWX supports the following extractor functions; avg, count, last, max, min, noop, sum and wind. Each is pretty self explanatory except for noop and wind. Noop does nothing and wind is a special extractor that returns wind speed and direction as well as wind gust speed and wind gust direction.

So in your case you are seeing WeeWX apply the default average extractor to your lightning data. Clearly that is not what you want for lightning strike count, you want ‘sum’ just as for rain. Fortunately, you can tell WeeWX what extractor function to use for an observation. In weewx.conf look for an [Accumulator] stanza and add an entry as follows:

[Accumulator]
[[lightning_strike_count]]
extractor = sum

If you don’t have an [Accumulator] stanza just add it at the end of the file.

As for lightning_distance, it really depends what you want to extract. There would seem to be a few possibilities, avg and min seem the two most likely but you could also use last. I guess it comes down to what data you want to record/display. Once you’ve worked that out just add an appropriate extractor entry for lightning_distance.

Oh, and once you have finished your changes to weewx.conf you will need to restart WeeWX.

Gary

Troy Roberts

unread,
Jul 23, 2020, 10:55:55 AM7/23/20
to weewx-user
Thank you for the detailed explanation Gary! I have added the [Accumulator] section to my weewx.conf for lightning_strike_count -> extractor = sum and lightning_distance -> extractor = min. Now to wait for another storm.

-Troy 

Eric K

unread,
May 23, 2021, 4:19:26 PM5/23/21
to weewx-user
I am seeing a weird problem with the lightning distance value, where the distance gets stuck reporting 10!

I copied the [[Corrections]] scheme shown earlier in this thread.  
I'm pretty sure I got it right, because it works most of the time.

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

[SDR]
    # This section is for the software-defined radio driver.
    # collect data from Acurite Atlas sensor
    
    # The driver to use
    driver = user.sdr
    cmd = rtl_433 -R 40 -M utc -F json
    
    [[sensor_map]]
        outTemp = temperature.0011.AcuriteAtlasPacket
        outHumidity = humidity.0011.AcuriteAtlasPacket
        windSpeed = wind_speed.0011.AcuriteAtlasPacket
        windDir = wind_dir.0011.AcuriteAtlasPacket
        UV = uv.0011.AcuriteAtlasPacket
        luminosity = lux.0011.AcuriteAtlasPacket
        Atlas_rain_total = rain_total.0011.AcuriteAtlasPacket
        Atlas_strike_count = strike_count.0011.AcuriteAtlasPacket
        lightning_distance = strike_distance.0011.AcuriteAtlasPacket
        windBatteryStatus = battery.0011.AcuriteAtlasPacket
        
    [[deltas]]
        rain = Atlas_rain_total
        lightning_strike_count = Atlas_strike_count
    
    [[Corrections]]
        lightning_distance = lightning_distance if lightning_strike_count > 0 else None
                
##############################################################################

But, I've now seen several storms with lightning and and the lightinig_distance value gets stuck reporting 10 forever after!
I see the 10 repeating in the database, so I believe that weewx is generating that number and sending it into the database.

Here's a look in the database using DB Browser for SQLite.  
Note how a distance value of 5.64705882352941 from the Acurite Atlas appears and then it's 10 thereafter.
You can see the lightning_strike_count is zero.  
The "else None" part of the condition statement appears to stop working?

ksnip_20210523-111132.png

Eric K

unread,
May 23, 2021, 4:32:14 PM5/23/21
to weewx-user
Here's a relevant section of the log which shows the Acurite Atlas lightning sensor sending the last distance (10) reading over and over.  
This is expected Acurite Atlas behavior, and the reason we have to put the "if > 0 else None" statement in our [[Corrections]] section.

Referring back to the 5.64705882352941 value seen in my database:
I wonder if weewx isn't expecting a decimal reading to be in lightning_distance?
And that sends it into confusion?

May 23 10:56:24 Ubuntu20-WEEWX weewx[14069] DEBUG user.sdr: lines=['{"time" : "2021-05-23 15:56:20", "model" : "Acurite-Atlas", "id" : 17, "channel" : "A", "sequence_num" : 0, "battery_ok" : 1, "message_type" : 38, "wind_avg_mi_h" : 4.000, "wind_dir_deg" : 190.000, "rain_in" : 2.040, "strike_count" : 45, "strike_distance" : 10, "exception" : 0, "raw_msg" : "c011668205f9cc8baab8"}\n', '{"time" : "2021-05-23 15:56:20", "model" : "Acurite-Atlas", "id" : 17, "channel" : "A", "sequence_num" : 1, "battery_ok" : 1, "message_type" : 38, "wind_avg_mi_h" : 4.000, "wind_dir_deg" : 190.000, "rain_in" : 2.040, "strike_count" : 45, "strike_distance" : 10, "exception" : 0, "raw_msg" : "c411668205f9cc8baabc"}\n', '{"time" : "2021-05-23 15:56:20", "model" : "Acurite-Atlas", "id" : 17, "channel" : "A", "sequence_num" : 2, "battery_ok" : 1, "message_type" : 38, "wind_avg_mi_h" : 4.000, "wind_dir_deg" : 190.000, "rain_in" : 2.040, "strike_count" : 45, "strike_distance" : 10, "exception" : 0, "raw_msg" : "c811668205f9cc8baac0"}\n']
May 23 10:56:24 Ubuntu20-WEEWX weewx[14069] DEBUG user.sdr: packet={'windSpeed': 4.0, 'windDir': 190.0, 'Atlas_rain_total': 2.04, 'Atlas_strike_count': 45, 'lightning_distance': 10, 'windBatteryStatus': 0, 'dateTime': 1621785380, 'usUnits': 1}
May 23 10:56:24 Ubuntu20-WEEWX weewx[14069] DEBUG user.MQTTSubscribe: (Service) data-> final packet is 2021-05-23 10:56:20 CDT (1621785380): Atlas_rain_total: 2.04, Atlas_strike_count: 45, dateTime: 1621785380, lightning_distance: 10, lightning_strike_count: 0, rain: 0.0, usUnits: 1, windBatteryStatus: 0, windDir: 190.0, windSpeed: 4.0
May 23 10:56:24 Ubuntu20-WEEWX weewx[14069] DEBUG user.sdr: packet={'windSpeed': 4.0, 'windDir': 190.0, 'Atlas_rain_total': 2.04, 'Atlas_strike_count': 45, 'lightning_distance': 10, 'windBatteryStatus': 0, 'dateTime': 1621785380, 'usUnits': 1}
May 23 10:56:24 Ubuntu20-WEEWX weewx[14069] DEBUG user.MQTTSubscribe: (Service) data-> final packet is 2021-05-23 10:56:20 CDT (1621785380): Atlas_rain_total: 2.04, Atlas_strike_count: 45, dateTime: 1621785380, lightning_distance: 10, lightning_strike_count: 0, rain: 0.0, usUnits: 1, windBatteryStatus: 0, windDir: 190.0, windSpeed: 4.0
May 23 10:56:24 Ubuntu20-WEEWX weewx[14069] DEBUG user.sdr: packet={'windSpeed': 4.0, 'windDir': 190.0, 'Atlas_rain_total': 2.04, 'Atlas_strike_count': 45, 'lightning_distance': 10, 'windBatteryStatus': 0, 'dateTime': 1621785380, 'usUnits': 1}
May 23 10:56:24 Ubuntu20-WEEWX weewx[14069] DEBUG user.MQTTSubscribe: (Service) data-> final packet is 2021-05-23 10:56:20 CDT (1621785380): Atlas_rain_total: 2.04, Atlas_strike_count: 45, dateTime: 1621785380, lightning_distance: 10, lightning_strike_count: 0, rain: 0.0, usUnits: 1, windBatteryStatus: 0, windDir: 190.0, windSpeed: 4.0
May 23 10:56:27 Ubuntu20-WEEWX weewx[14069] DEBUG user.sdr: lines=[]
May 23 10:56:29 Ubuntu20-WEEWX weewx[14069] DEBUG user.MQTTSubscribe: (Service) MessageCallbackProvider data-> incoming topic: tele/BMP280/SENSOR, QOS: 0, retain: 0, payload: b'{"Time":"2021-05-23T10:56:30","BMP280":{"Temperature":20.2,"Pressure":985.1},"PressureUnit":"hPa","TempUnit":"C"}'
May 23 10:56:29 Ubuntu20-WEEWX weewx[14069] DEBUG user.MQTTSubscribe: (Service) TopicManager data-> incoming tele/BMP280/SENSOR: appTemp1: 20.2, barometer: 985.1


gjr80

unread,
May 23, 2021, 8:10:54 PM5/23/21
to weewx-user
I think you might find the [[Corrections]] stanza belongs under [StdCalibrate] rather than the SDR driver.

Gary

Eric K

unread,
May 23, 2021, 9:33:56 PM5/23/21
to weewx-user
Thanks for the pointer.  
I also had a [[Corrections]] sections under [StdCalibrate].

I just moved the lightning_distance correction to the [StdCalibrate] section.
We'll see if that helps.

Isn't it odd that it worked, when the lightning_distance was something other than 10?    


gjr80

unread,
May 24, 2021, 12:39:25 PM5/24/21
to weewx-user
I can't explain it, it would require some detailed knowledge of how the Acurite lightning sensor behaves. For example, the Ecowitt lightning sensor reports distance when strikes are detected and that distance value persists for some time before eventually reporting 0. If you had debug logging of the SDR output (as you have in the log extract above) going on for some time previous you could probably work through the log looking at the distance value being obtained by the SDR driver from the Acurite. One thing is certain though, the SDR driver was not applying the correction as the SDR driver contains no code to read those config settings. And if the correction was not under [StdCalibrate] [[Corrections]] then WeeWX wasn't applying the correction either.

Might just have to remain a mystery.

Gary

Eric K

unread,
May 25, 2021, 4:36:09 PM5/25/21
to weewx-user
It's working as desired now!
Thanks for noticing the incorrect location of the [[Corrections]]

lightning_distance working.JPG

Kevin Crivelli

unread,
Jun 11, 2023, 8:36:30 PM6/11/23
to weewx-user
Eric K, could you provide the chart.conf configuration for that chart and also what ended up being the correct way to add the correction in weewx.conf? Your chart is essentially what I am trying to accomplish

Eric K

unread,
Jun 11, 2023, 9:09:28 PM6/11/23
to weewx-user
Hi Kevin,

In the graphs.conf file (Belchertown skin) I have this:

    [[chart6]]
        title = Lightning
        [[[lightning_strike_count]]]
            yAxis = 0
            yAxis_min = 0
            yAxis_tickInterval = 1
            yAxis_label = "Number of Strikes"
            stacking = normal
            color = "orange"
            lineWidth = 0
            [[[[marker]]]]
                enabled = true
                radius = 4
            [[[[states]]]]
                [[[[[hover]]]]]
                        lineWidthPlus = 0                
        [[[lightning_distance]]]
            yAxis = 1
            yAxis_min = 0
            yAxis_label = "Distance (miles)"
            stacking = normal
            color = "blue"
            lineWidth = 0
            [[[[marker]]]]
                enabled = true
                radius = 3
            [[[[states]]]]
                [[[[[hover]]]]]
                        lineWidthPlus = 0     


For the distance correction (conversion to miles) I have an entry in the StdCalibrate section of weewx.conf:
##############################################################################

#   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 + 0.2
        outTemp = outTemp + 0.0
        barometer = barometer + 1.025
        radiation = luminosity * 0.00789 if luminosity > 0 else None
        lightning_distance = lightning_distance / 1.609 if lightning_strike_count > 0 else None    #convert distance to miles

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

Kevin Crivelli

unread,
Jun 13, 2023, 6:58:17 PM6/13/23
to weewx-user
I added the line
lightning_distance = lightning_distance / 1.609 if lightning_strike_count > 0 else None    #convert distance to miles

to the [StdCalibrate] [[Corrections]] section and I added your chart to my graphs.conf

I am still getting the persistant distance of 5 miles as per the last lightning distance that was recorded weeks ago. not sure where to go from here but thank you for providing all of that for me.

lightning5.JPG

Eric K

unread,
Jun 13, 2023, 7:11:30 PM6/13/23
to weewx-user
I forgot about the [SDR] section of the weewx.conf file.
weewx needs to convert the lightning strike count reported by the Acurite Atlas to a lightning strike delta number.
This is because the Atlas counts up lightning strikes and keeps incrementing the accumulated strike number (such as 5).
When the next strike ocurrs the Atlas will increment the number to 6, and so on.
You need weewx to watch for a change in that Atlas lightning strike number and report that difference (delta) between the last count and the current count.

from my weewx.conf file:
##############################################################################

[SDR]
    # This section is for the software-defined radio driver.
    # collect data from Acurite-Atlas sensor 0011

   
    # The driver to use
    driver = user.sdr
    cmd = rtl_433 -R 40 -M utc -F json
   
    [[sensor_map]]
        outTemp = temperature.0011.AcuriteAtlasPacket
        outHumidity = humidity.0011.AcuriteAtlasPacket
        windSpeed = wind_speed.0011.AcuriteAtlasPacket
        windDir = wind_dir.0011.AcuriteAtlasPacket
        UV = uv.0011.AcuriteAtlasPacket
        luminosity = lux.0011.AcuriteAtlasPacket
        Atlas_rain_total = rain_total.0011.AcuriteAtlasPacket
        Atlas_strike_count = strike_count.0011.AcuriteAtlasPacket
        lightning_distance = strike_distance.0011.AcuriteAtlasPacket
        windBatteryStatus = battery.0011.AcuriteAtlasPacket
        batteryStatus1 = battery.0011.AcuriteAtlasPacket

   
    [[deltas]]
        rain = Atlas_rain_total
        lightning_strike_count = Atlas_strike_count

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

Kevin Crivelli

unread,
Jun 13, 2023, 7:17:24 PM6/13/23
to weewx...@googlegroups.com
mines definitely a little different. This is what I already have. It seems to follow the logic you shared above in your configuration but my packets are named differently. where you have "Atlas_strike_count = strike_count.0011.AcuriteAtlasPacket" I have "strikes_total = strikes_total.1255.AcuriteLightningPacket". from looking at my deltas section, does it look as though I have this set up correctly or am I off a little bit?


[SDR]
    # This section is for the software-defined radio driver.
   
    # The driver to use
    driver = user.sdr

   
    [[sensor_map]]
        outTemp = temperature.030B.AcuriteAtlasPacket
        outHumidity = humidity.030B.AcuriteAtlasPacket
        windSpeed = wind_speed.030B.AcuriteAtlasPacket
        windDir = wind_dir.030B.AcuriteAtlasPacket
        UV = uv.030B.AcuriteAtlasPacket
        rain_total = rain_total.030B.AcuriteAtlasPacket
        radiation = lux.030B.AcuriteAtlasPacket
        lux = lux.030B.AcuriteAtlasPacket
        outTempBatteryStatus = battery.030B.AcuriteAtlasPacket
        lightning_distance = distance.1255.AcuriteLightningPacket
        strikes_total = strikes_total.1255.AcuriteLightningPacket
        inTemp = temperature.3071.AcuriteTowerPacketV2
        inHumidity = humidity.3071.AcuriteTowerPacketV2
pressure = pressure.171.FOWH32BPacket
   
   
    [[deltas]]
        rain = rain_total
        lightning_strike_count = strikes_total



--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/dd45feba-9359-43b8-976a-44e1573f3009n%40googlegroups.com.

Kevin Crivelli

unread,
Jun 13, 2023, 7:34:24 PM6/13/23
to weewx...@googlegroups.com
oh I forgot to mention that I use a separate acurite lightning detector than the atlas detector. I do not have the atlas detector even installed because there are too many electronics near the main station that I have false positive lightning strikes when using the atlas detector so I use the acurite lightning detector in a different location for those readings. can't imagine that would have anything to do with my situation however I thought I'd tell you so you wouldn't be confused as to why mine is different than yours even though we both use Atlas's

Eric K

unread,
Jun 13, 2023, 7:49:28 PM6/13/23
to weewx-user
Ahhh an external Acurite lightning detector.  That explains why your lightning data variable does not end in ".AcuriteAtlasPacket"

Of note, unlike the 2nd post in this thread, my [Accumulator] setion of weewx.conf file is blank, because the Atlas lightning number is already an accuulated value.

#####################################################
[Accumulator]

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

Message has been deleted

Kevin Crivelli

unread,
Jun 13, 2023, 9:20:00 PM6/13/23
to weewx-user
I don't have an [Accumulator] section in my .conf

Mark Fraser

unread,
Jun 14, 2023, 4:59:13 PM6/14/23
to weewx...@googlegroups.com
I think there is a bug in the sdr.py from
https://github.com/matthewwall/weewx-sdr/blob/master/bin/user/sdr.py
where the deltas are listed as:

DEFAULT_DELTAS = {
'rain': 'rain_total',
'strikes': 'strikes_total'}

Which I couldn't get to work, so I changed mine to:
DEFAULT_DELTAS = {
'rain': 'rain_total',
'lightning_strike_count': 'strikes_total'}
And it works without having to add a deltas section to weewx.conf.

Eric K

unread,
Jun 14, 2023, 6:12:37 PM6/14/23
to weewx-user
Oh, interesting.  I'm running weewx 4.5.1.  
What version are you running?

Eric K

unread,
Jun 14, 2023, 6:36:17 PM6/14/23
to weewx-user
Maybe the better question is, what version of weewx-sdr do you have?
I installed mine in May 2021.

Mark Fraser

unread,
Jun 14, 2023, 6:40:31 PM6/14/23
to weewx...@googlegroups.com
4.10.2

--
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 weewx-user+...@googlegroups.com.

Mark Fraser

unread,
Jun 14, 2023, 6:48:46 PM6/14/23
to weewx...@googlegroups.com
On 14/06/2023 19:36, Eric K wrote:
> Maybe the better question is, what version of weewx-sdr do you have?
> I installed mine in May 2021.
> On Wednesday, June 14, 2023 at 1:12:37 PM UTC-5 Eric K wrote:

Think mine is version 0.86 or 0.87.

William Reading

unread,
Jun 15, 2023, 4:03:12 AM6/15/23
to weewx-user
I was going to submit a pull request to fix this and realized that the Atlas driver uses "strike_count" and the rest of them use "strikes_total", so fixing the defaults would be a breaking change. I went ahead and just put the delta in my weewx.conf file to work around it.

[[sensor_map]]
...
atlas_lightning_strike_count = strike_count.XXXX.AcuriteAtlasPacket
...

[[deltas]]
lightning_strike_count = atlas_lightning_strike_count

Stefan Gliessmann

unread,
Aug 9, 2023, 2:49:45 PM8/9/23
to weewx-user
Hello everybody ;)

I have a smilier issue with last lightning distance been charted ...
I used the above information to generate my chart which looks like this:

Screenshot 2023-08-09 at 16.43.03.png

This is with 
    [[Corrections]]
        lightning_distance = lightning_distance if lightning_strike_count > 0 else None

I do not have an AcuRite, but an Ecowitt lightning detector ...

Any hint to have the distance been zero when there isn't and lightning would be appreciated.

TIA,
Stefan

michael.k...@gmx.at

unread,
Aug 9, 2023, 4:39:55 PM8/9/23
to weewx-user
I have an ecowitt WH57 and exactly the same correction term: lightning_distance = lightning_distance if lightning_strike_count > 0 else None
2023-08-09 18_35_16-The weather in AT, Salzburg, Hallein, Rif - Brave.png

And just a few mintues ago, there were lightnings detected:

The little yellow dot between 25 and 30km. 


I've queried the database:
select datetime, lightning_distance, lightning_strike_count from archive order by datetime desc;

2023-08-09 18_37_13-Window.png
Just as excpected.

I don't know how your chart handles this, the above chart is a scatter chart with the lightning distance on the y-axis and the size of the dot is equivalent to the lightning_strike_count. What does your database show with the above query?

Stefan Gliessmann

unread,
Aug 10, 2023, 3:48:08 PM8/10/23
to weewx...@googlegroups.com
Hmm - it looks different in my sdb ...

Screenshot 2023-08-10 at 17.43.28.png

I will double check if I added the correction lightning_distance = lightning_distance if lightning_strike_count > 0 else None correctly in weewx.conf ...


--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/xBihBm0jVls/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/1c0205a8-cb0f-4a34-8c2b-dd0d288da2fen%40googlegroups.com.

Stefan Gliessmann

unread,
Aug 10, 2023, 4:40:44 PM8/10/23
to weewx...@googlegroups.com
The correction was in weewx.conf (and I just restarted weewx another time), but it still shows the distance from earlier this week.
I also added the Accumulator from last to min for lighting_distance.

Still no change in the graph ...

This is in graph.conf for Belchertown skin:

    [[chart6]]
        title = Lightning
        [[[lightning_strike_count]]]
            yAxis = 0
            yAxis_min = 0
            yAxis_tickInterval = 1
            yAxis_label = "Number of Strikes"
            stacking = normal
            color = "orange"
            lineWidth = 0
            [[[[marker]]]]
                enabled = true
                radius = 4
            [[[[states]]]]
                [[[[[hover]]]]]
                        lineWidthPlus = 0
        [[[lightning_distance]]]
            yAxis = 1
            yAxis_min = 0
            yAxis_label = "Distance (km)"

            stacking = normal
            color = "blue"
            lineWidth = 0
            [[[[marker]]]]
                enabled = true
                radius = 3
            [[[[states]]]]
                [[[[[hover]]]]]
                        lineWidthPlus = 0

This is in weewx.conf:

    [[Corrections]]
        lightning_distance = lightning_distance if lightning_strike_count > 0 else None

and

[Accumulator]

    # Start Ecowitt Gateway driver extractors
    [[daymaxwind]]
        extractor = last
    [[lightning_distance]]
        extractor = min
    [[lightning_strike_count]]
        extractor = sum
    [[lightningcount]]
        extractor = last
    [[lightning_last_det_time]]
        extractor = last

and what it looks like:

Screenshot 2023-08-10 at 18.30.15.png

being in sync w/ the db ...

Screenshot 2023-08-10 at 18.32.26.png

I continue to be puzzled ...

Any additional ideas what I should check?

TIA,
Stefan

michael.k...@gmx.at

unread,
Aug 10, 2023, 6:43:22 PM8/10/23
to weewx-user
Is [[Corrections]] in the hierarchy below  [StdCalibrate]?
   
Like this:

[StdCalibrate]
    [[Corrections]]
        lightning_distance = lightning_distance if lightning_strike_count > 0 else None

If yes and you don't find a solution, post your whole weewx.conf as an attachment, but don't forget to obfuscate any sensitive data like logins, passwords etc. before uploading.
Message has been deleted

Stefan Gliessmann

unread,
Aug 11, 2023, 3:10:55 PM8/11/23
to weewx-user
OK ... here we go with the whole weewx.conf file:

# WEEWX CONFIGURATION FILE
#
# Copyright (c) 2009-2022 Tom Keffer <tke...@gmail.com>
# 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 = 5

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

# Whether to log successful operations. May get overridden below.
log_success = True

# Whether to log unsuccessful operations. May get overridden below.
log_failure = True

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

# Whether to try indefinitely to load the driver
loop_on_init = 0

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

#   This section is for information about the station.

[Station]
   
    # Description of the station location
    location = "Moritzberg, Hildesheim"
   
    # Latitude in decimal degrees. Negative for southern hemisphere
    latitude = 52.152
    # Longitude in decimal degrees. Negative for western hemisphere.
    longitude = 9.929
   
    # Altitude of the station, with the unit it is in. This is used only
    # if the hardware cannot supply a value.
    altitude = 98, foot
   
    # Set to type of station hardware. There must be a corresponding stanza
    # in this file, which includes a value for the 'driver' option.
    station_type = GW1000
   
    # If you have a website, you may specify an URL. This is required if you
    # intend to register your station.
    station_url = https://weewxhi.de
   
    # 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

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

[GW1000]
    # This section is for the Ecowitt Gateway driver.
   
    # How often to poll the API, default is every 20 seconds:
    poll_interval = 5

   
    # The driver to use:
    driver = user.gw1000
    ip_address = 192.168.178.192
    port = 45000
   
    show_all_batt = false

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

[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]
   
    # Uncomment and change to override logging for uploading services.
    # log_success = True
    # log_failure = True
   
    [[StationRegistry]]
        # To register this weather station with weewx, set this to true,
        # then fill out option 'station_url', located in the [Station] section above.
        register_this_station = true
   
    [[AWEKAS]]
        # This section is for configuring posts to AWEKAS.
       
        # If you wish to post to AWEKAS, set the option 'enable' to true, then specify a username
        # and password. To guard against parsing errors, put the password in quotes.
        enable = false
        username = replace_me
        password = replace_me
   
    [[CWOP]]
        # This section is for configuring posts to CWOP.
       
        # If you wish to post to CWOP, set the option 'enable' to true,
        # then specify the station ID (e.g., CW1234).
        enable = false
        station = replace_me
        # If this is an APRS (radio amateur) station, specify the
        # passcode (e.g., 12345). Otherwise, ignore.
        passcode = replace_me
   
   
    [[PWSweather]]
        # This section is for configuring posts to PWSweather.com.
       
        # If you wish to post to PWSweather.com, set the option 'enable' to true, then specify a
        # station and password. To guard against parsing errors, put the password in quotes.
        enable = true
        station = IHILDE23
        password = **********
   
    [[WOW]]
        # This section is for configuring posts to WOW.
       
        # If you wish to post to WOW, set the option 'enable' to true, then specify a station and
        # password. To guard against parsing errors, put the password in quotes.
        enable = false
        station = replace_me
        password = replace_me
   
    [[Wunderground]]
        # This section is for configuring posts to the Weather Underground.
       
        # If you wish to post to the Weather Underground, set the option 'enable' to true,  then
        # specify a station (e.g., 'KORHOODR3') and password. To guard against parsing errors, put
        # the password in quotes.
        enable = true
        station = IHILDE23
        password = **********
       
        # If you plan on using wunderfixer, set the following
        # to your API key:
        api_key = replace_me
       
        # 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 = mqtt://teffi:**********@192.168.178.190:1883/
        topic = weather
        unit_system = METRIC
        binding = loop, archive
        log_success = true
        [[[inputs]]]
            [[[[rainRate]]]]
                units = mm_per_hour
            [[[[rain]]]]
                units = mm
            [[[[hourRain]]]]
                units = mm
            [[[[rain24]]]]
                units = mm
            [[[[dayRain]]]]
                units = mm
            [[[[ET]]]]
                units = mm
            [[[[dayET]]]]
                units = mm
            [[[[ET24]]]]
                units = mm

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

#   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
   
    # Uncomment and change to override logging for reports
    log_success = True
    log_failure = True
   
    # The database binding indicates which data should be used in reports.
    data_binding = wx_binding
   
    # 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/weewx/belchertown
        enable = true
       
        [[[Extras]]]
           
            # For help refer to the docs at https://github.com/poblabs/weewx-belchertown
            # and consult skin.conf for the configurable elements and their hierarchy
           
            #--- General Options ---
            # belchertown_debug = 0
            belchertown_locale = auto
            theme = dark
            # theme_toggle_enabled = 1
            logo_image = http://teffi71.spdns.de:8181/weewx/belchertown/images/StefanBlackLoRes.png
            logo_image_dark = http://teffi71.spdns.de:8181/weewx/belchertown/images/StefanWhiteLoRes.png
            site_title = "Moritzberg, Hildesheim"
            station_observations = inTemp, inHumidity, barometer, dewpoint, radiation, outHumidity, rainWithRainRate, cloudbase, cloud_cover
            beaufort_category = 0
            manifest_name = "Moritzberg, Hildesheim"
            manifest_short_name = MoHi
            # aeris_map = 0
            # radar_html = ''   #  (default seems to center on your lat/lon)
            # radar_html_dark = None
            radar_zoom = 7
            radar_marker = 1
            almanac_extras = 1
            highcharts_enabled = 1
            # graph_page_show_all_button = 1
            # graph_page_default_graphgroup = "day"
            # highcharts_homepage_graphgroup = "day"
            # highcharts_decimal = "auto"
            # highcharts_thousands = "auto"
            # googleAnalyticsId = ""
            # pi_kiosk_bold = "false"
            # pi_theme = "auto"
            webpage_autorefresh = 300000
            # reload_hook_images = 0
            # reload_images_radar = 300
            # reload_images_hook_asi = -1
            # reload_images_hook_af = -1
            # reload_images_hook_as = -1
            # reload_images_hook_ac = -1
            # show_last_updated_alert = 0
            # last_updated_alert_threshold = 1800
           
            #--- MQTT Websockets (for Real Time Streaming) Options ---
            mqtt_websockets_enabled = 1
            mqtt_websockets_host = teffi71.spdns.de
#            mqtt_websockets_host = 192.168.178.190
            mqtt_websockets_port = 9001
            mqtt_websockets_ssl = 0
            mqtt_websockets_topic = weather/loop
            mqtt_websockets_username = teffi
            mqtt_websockets_password = **********
#            disconnect_live_website_visitor = 1800000
           
            #--- Forecast Options ---
            forecast_enabled = 1
            forecast_provider = aeris
            forecast_api_id = 5R5NlloB6lq0dsgnehmIg
            forecast_api_secret = **********
            forecast_units = ca
            forecast_lang = en
            forecast_stale = 86400
            forecast_aeris_use_metar = 1
            forecast_interval_hours = 1
            forecast_alert_enabled = 1
            forecast_alert_limit = 1
            # forecast_show_daily_forecast_link = 1
            # forecast_daily_forecast_link = ""
            aqi_enabled = 1
            aqi_location_enabled = 1
           
            #--- Earthquake Options ---
            earthquake_enabled = 1
            earthquake_maxradiuskm = 15000
            earthquake_stale = 10740
            earthquake_server = USGS
            geonet_mmi = 4
           
            #--- Social Options ---
            #facebook_enabled = 1
            #twitter_enabled = 0
            #twitter_hashtags = "weewx #weather #teffi71"
            #twitter_text = "Check out my personal weather sation webseite ;)"
            #twitter_owner = "@teffi71"
            #social_share_html = "https://weewxhi.de"
           
            #--- Kiosk Options ---
            # radar_html_kiosk = ""
            # radar_width_kiosk = 490
            # radar_height_kiosk = 362
            # mqtt_websockets_host_kiosk = ""
            # mqtt_websockets_port_kiosk = ""
            # mqtt_websockets_ssl_kiosk = ""
            # forecast_interval_hours_kiosk = 24
            # aqi_enabled_kiosk = 0
           
            #-------------------------------------------------------------
            #---
            #--- python's ConfigObj has a limitation in how it processes
            #--- comments, so we need to define an 'unused' variable below
            #--- to ensure that this whole stanza makes it into weewx.conf
            #---
            #--- please ignore the following 'unused' variable
            #---
            #-------------------------------------------------------------
            work_around_ConfigObj_limitations = true
       
        [[[Labels]]]
            [[[[Generic]]]]
                #home_page_header = "Moritzberg, Hildesheim, Germany Weather Conditions"
                #twitter_owner = teffi71
                #twitter_hashtags = "PWS #weewx #weather #wx @teffi71"
                footer_copyright_text = by Stefan Gliessmann
               
                # Default page headers
                home_page_header = Current Weather Conditions
                graphs_page_header = Weather Observation Graphs
                records_page_header = Weather Observation Records
                reports_page_header = Weather Observation Reports
                about_page_header = About This Weather Station
                powered_by = "Observations are powered by a PWS in Moritzberg, Hildesheim"
   
    [[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 = **********
        password = **********
        server = **********    # The ftp server name, e.g, www.myserver.org
        path = /weewx    # 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 = 22
       
        # Set to 1 to use passive mode, zero for active mode
        passive = 0
   
    [[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 = replace_me
        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
   
    # Options in the [[Defaults]] section below will apply to all reports.
    # What follows are a few of the more popular options you may want to
    # uncomment, then change.
    [[Defaults]]
       
        # Which language to use for all reports. Not all skins support all languages.
        # You can override this for individual reports.
        lang = en
       
        # Which unit system to use for all reports. Choices are 'us', 'metric', or 'metricwx'.
        # You can override this for individual reports.
        unit_system = metric
       
        [[[Units]]]
           
            # Option "unit_system" above sets the general unit system, but overriding specific unit
            # groups is possible. These are popular choices. Uncomment and set as appropriate.
            # NB: The unit is always in the singular. I.e., 'mile_per_hour',
            # NOT 'miles_per_hour'
            [[[[Groups]]]]
                # group_altitude     = meter              # Options are 'foot' or 'meter'
                # group_pressure     = mbar               # Options are 'inHg', 'mmHg', 'mbar', or 'hPa'
                # group_rain         = mm                 # Options are 'inch', 'cm', or 'mm'
                # group_rainrate     = mm_per_hour        # Options are 'inch_per_hour', 'cm_per_hour', or 'mm_per_hour'
                # group_temperature  = degree_C           # Options are 'degree_C', 'degree_F', or 'degree_K'
                # The following line is used to keep the above lines indented properly.
                # It can be ignored.
                unused = unused
           
            # Uncommenting the following section frequently results in more
            # attractive formatting of times and dates, but may not work in
            # your locale.
            [[[[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
                # The following line is used to keep the above lines indented properly.
                # It can be ignored.
                unused = unused
       
        [[[Labels]]]
            # Users frequently change the labels for these observation types
            [[[[Generic]]]]
                # inHumidity     = Inside Humid
                # inTemp         = Inside Temperature
                # outHumidity    = Outside Humidity
                # outTemp        = Outside Temperature
                # extraTemp1     = Temperature1
                # extraTemp2     = Temperature2
                # extraTemp3     = Temperature3
                # The following line is used to keep the above lines indented properly.
                # It can be ignored.
                unused = unused
    #
    ################################################################################
   
    [[Weather34Report]]
        skin = Weather34
        HTML_ROOT = /var/www/html/weewx/weather34/
        [[[Units]]]
            [[[[Groups]]]]
                group_altitude = meter
                group_degree_day = degree_C_day
                group_pressure = hPa
                group_rain = mm
                group_rainrate = mm_per_hour
                group_speed = meter_per_second
                group_speed2 = meter_per_second2
                group_temperature = degree_C
    #
    ################################################################################
   
    [[w34Highcharts]]
        HTML_ROOT = /var/www/html/weewx/weather34/w34highcharts
        skin = w34Highcharts
        enable = true
        [[[CheetahGenerator]]]
            [[[[ToDate]]]]
                [[[[[YearJSON]]]]]
                    stale_age = 600
        [[[Units]]]
            [[[[StringFormats]]]]
                centibar = %.0f
                cm = %.2f
                cm_per_hour = %.2f
                degree_C = %.1f
                degree_F = %.1f
                degree_compass = %.0f
                foot = %.0f
                hPa = %.1f
                inHg = %.3f
                inch = %.2f
                inch_per_hour = %.2f
                km_per_hour = %.0f
                km_per_hour2 = %.1f
                knot = %.0f
                knot2 = %.1f
                mbar = %.1f
                meter = %.0f
                meter_per_second = %.1f
                meter_per_second2 = %.1f
                mile_per_hour = %.0f
                mile_per_hour2 = %.1f
                mm = %.1f
                mmHg = %.1f
                mm_per_hour = %.1f
                percent = %.0f
                uv_index = %.1f
                volt = %.1f
                watt_per_meter_squared = %.0f
                NONE = N/A
            [[[[Labels]]]]
                centibar = cb
                cm = cm
                cm_per_hour = cm/hr
                degree_C = ° C
                degree_F = ° F
                degree_compass = °
                foot = feet
                hPa = hPa
                inHg = inHg
                inch = in
                inch_per_hour = in/hr
                km_per_hour = km/hr
                km_per_hour2 = km/hr
                knot = knots
                knot2 = knots
                mbar = mbar
                meter = meters
                meter_per_second = m/s
                meter_per_second2 = m/s
                mile_per_hour = mph
                mile_per_hour2 = mph
                mm = mm
                mmHg = mmHg
                mm_per_hour = mm/hr
                percent = %
                uv_index = Index
                volt = V
                watt_per_meter_squared = W/m²
                NONE = ""
        [[[Extras]]]
            numYears = 5
            [[[[MinRange]]]]
                outTemp = 10, degree_C
                windchill = 10, degree_C
                barometer = 20, hPa
                windSpeed = 10
                rain = 5, mm
                radiation = 500
                UV = 16
            [[[[WindRose]]]]
                title = Wind Rose
                source = windSpeed
                period = 3600, 86400, 604800, month, year
                aggregate_type = ""
                aggregate_interval = ""
                petals = 16
                petal_colors = aqua, 0x0099FF, 0x0033FF, 0x009900, 0x00CC00, 0x33FF33, 0xCCFF00
                speedfactor = 0.0, 0.1, 0.2, 0.3, 0.5, 0.7, 1.0
                legend_title = True
                band_percent = True
                bullseye_percent = True
                precision = 1
                bullseye_size = 20
                bullseye_color = 0xFFFACD
                calm_limit = 0.1

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

#   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 = US    # 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 + 0.2
        radiation = luminosity/126.7 if luminosity is not None else None

        lightning_distance = lightning_distance if lightning_strike_count > 0 else None


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

#   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]]
        barometer = 26, 32.5, inHg
        pressure = 24, 34.5, inHg
        outTemp = -40, 120, degree_F
        inTemp = 10, 120, degree_F
        outHumidity = 0, 100
        inHumidity = 0, 100
        windSpeed = 0, 120, mile_per_hour
        rain = 0, 10, inch

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

#   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 = software
   
    # Whether to include LOOP data in hi/low statistics
    loop_hilo = True
   
    # Uncomment and change to override logging for archive operations
    # log_success = True
    # log_failure = 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 = **********
        # The password (use quotes to guard against parsing errors)
        password = **********

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

#   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, user.weather34.Weather34RealTime
        xtype_services = weewx.wxxtypes.StdWXXTypes, weewx.wxxtypes.StdPressureCooker, weewx.wxxtypes.StdRainRater, weewx.wxxtypes.StdDelta, user.lastnonzero.LastNonZeroService
        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


[Accumulator]
   
    # Start Ecowitt Gateway driver extractors
    [[daymaxwind]]
        extractor = last
    [[lightning_distance]]
        extractor = min
    [[lightning_strike_count]]
        extractor = sum
    [[lightningcount]]
        extractor = last
    [[lightning_last_det_time]]
        extractor = last
    [[stormRain]]
        extractor = last
    [[hourRain]]
        extractor = last
    [[dayRain]]
        extractor = last
    [[weekRain]]
        extractor = last
    [[monthRain]]
        extractor = last
    [[yearRain]]
        extractor = last
    [[totalRain]]
        extractor = last
    [[p_rain]]
        extractor = sum
    [[p_stormRain]]
        extractor = last
    [[p_dayRain]]
        extractor = last
    [[p_weekRain]]
        extractor = last
    [[p_monthRain]]
        extractor = last
    [[p_yearRain]]
        extractor = last
    [[t_rain]]
        extractor = sum
    [[t_stormRain]]
        extractor = last
    [[t_dayRain]]
        extractor = last
    [[t_weekRain]]
        extractor = last
    [[_monthRain]]
        extractor = last
    [[t_yearRain]]
        extractor = last
    [[pm2_51_24h_avg]]
        extractor = last
    [[pm2_52_24h_avg]]
        extractor = last
    [[pm2_53_24h_avg]]
        extractor = last
    [[pm2_54_24h_avg]]
        extractor = last
    [[pm2_55_24h_avg]]
        extractor = last
    [[pm10_24h_avg]]
        extractor = last
    [[co2_24h_avg]]
        extractor = last
    [[wh40_batt]]
        extractor = last
    [[wh26_batt]]
        extractor = last
    [[wh25_batt]]
        extractor = last
    [[wh24_batt]]
        extractor = last
    [[wh65_batt]]
        extractor = last
    [[wh31_ch1_batt]]
        extractor = last
    [[wh31_ch2_batt]]
        extractor = last
    [[wh31_ch3_batt]]
        extractor = last
    [[wh31_ch4_batt]]
        extractor = last
    [[wh31_ch5_batt]]
        extractor = last
    [[wh31_ch6_batt]]
        extractor = last
    [[wh31_ch7_batt]]
        extractor = last
    [[wh31_ch8_batt]]
        extractor = last
    [[wn34_ch1_batt]]
        extractor = last
    [[wn34_ch2_batt]]
        extractor = last
    [[wn34_ch3_batt]]
        extractor = last
    [[wn34_ch4_batt]]
        extractor = last
    [[wn34_ch5_batt]]
        extractor = last
    [[wn34_ch6_batt]]
        extractor = last
    [[wn34_ch7_batt]]
        extractor = last
    [[wn34_ch8_batt]]
        extractor = last
    [[wn35_ch1_batt]]
        extractor = last
    [[wn35_ch2_batt]]
        extractor = last
    [[wn35_ch3_batt]]
        extractor = last
    [[wn35_ch4_batt]]
        extractor = last
    [[wn35_ch5_batt]]
        extractor = last
    [[wn35_ch6_batt]]
        extractor = last
    [[wn35_ch7_batt]]
        extractor = last
    [[wn35_ch8_batt]]
        extractor = last
    [[wh41_ch1_batt]]
        extractor = last
    [[wh41_ch2_batt]]
        extractor = last
    [[wh41_ch3_batt]]
        extractor = last
    [[wh41_ch4_batt]]
        extractor = last
    [[wh45_batt]]
        extractor = last
    [[wh51_ch1_batt]]
        extractor = last
    [[wh51_ch2_batt]]
        extractor = last
    [[wh51_ch3_batt]]
        extractor = last
    [[wh51_ch4_batt]]
        extractor = last
    [[wh51_ch5_batt]]
        extractor = last
    [[wh51_ch6_batt]]
        extractor = last
    [[wh51_ch7_batt]]
        extractor = last
    [[wh51_ch8_batt]]
        extractor = last
    [[wh51_ch9_batt]]
        extractor = last
    [[wh51_ch10_batt]]
        extractor = last
    [[wh51_ch11_batt]]
        extractor = last
    [[wh51_ch12_batt]]
        extractor = last
    [[wh51_ch13_batt]]
        extractor = last
    [[wh51_ch14_batt]]
        extractor = last
    [[wh51_ch15_batt]]
        extractor = last
    [[wh51_ch16_batt]]
        extractor = last
    [[wh55_ch1_batt]]
        extractor = last
    [[wh55_ch2_batt]]
        extractor = last
    [[wh55_ch3_batt]]
        extractor = last
    [[wh55_ch4_batt]]
        extractor = last
    [[wh57_batt]]
        extractor = last
    [[wh68_batt]]
        extractor = last
    [[ws80_batt]]
        extractor = last
    [[ws90_batt]]
        extractor = last
    [[wh40_sig]]
        extractor = last
    [[wh26_sig]]
        extractor = last
    [[wh25_sig]]
        extractor = last
    [[wh24_sig]]
        extractor = last
    [[wh65_sig]]
        extractor = last
    [[wh31_ch1_sig]]
        extractor = last
    [[wh31_ch2_sig]]
        extractor = last
    [[wh31_ch3_sig]]
        extractor = last
    [[wh31_ch4_sig]]
        extractor = last
    [[wh31_ch5_sig]]
        extractor = last
    [[wh31_ch6_sig]]
        extractor = last
    [[wh31_ch7_sig]]
        extractor = last
    [[wh31_ch8_sig]]
        extractor = last
    [[wn34_ch1_sig]]
        extractor = last
    [[wn34_ch2_sig]]
        extractor = last
    [[wn34_ch3_sig]]
        extractor = last
    [[wn34_ch4_sig]]
        extractor = last
    [[wn34_ch5_sig]]
        extractor = last
    [[wn34_ch6_sig]]
        extractor = last
    [[wn34_ch7_sig]]
        extractor = last
    [[wn34_ch8_sig]]
        extractor = last
    [[wn35_ch1_sig]]
        extractor = last
    [[wn35_ch2_sig]]
        extractor = last
    [[wn35_ch3_sig]]
        extractor = last
    [[wn35_ch4_sig]]
        extractor = last
    [[wn35_ch5_sig]]
        extractor = last
    [[wn35_ch6_sig]]
        extractor = last
    [[wn35_ch7_sig]]
        extractor = last
    [[wn35_ch8_sig]]
        extractor = last
    [[wh41_ch1_sig]]
        extractor = last
    [[wh41_ch2_sig]]
        extractor = last
    [[wh41_ch3_sig]]
        extractor = last
    [[wh41_ch4_sig]]
        extractor = last
    [[wh45_sig]]
        extractor = last
    [[wh51_ch1_sig]]
        extractor = last
    [[wh51_ch2_sig]]
        extractor = last
    [[wh51_ch3_sig]]
        extractor = last
    [[wh51_ch4_sig]]
        extractor = last
    [[wh51_ch5_sig]]
        extractor = last
    [[wh51_ch6_sig]]
        extractor = last
    [[wh51_ch7_sig]]
        extractor = last
    [[wh51_ch8_sig]]
        extractor = last
    [[wh51_ch9_sig]]
        extractor = last
    [[wh51_ch10_sig]]
        extractor = last
    [[wh51_ch11_sig]]
        extractor = last
    [[wh51_ch12_sig]]
        extractor = last
    [[wh51_ch13_sig]]
        extractor = last
    [[wh51_ch14_sig]]
        extractor = last
    [[wh51_ch15_sig]]
        extractor = last
    [[wh51_ch16_sig]]
        extractor = last
    [[wh55_ch1_sig]]
        extractor = last
    [[wh55_ch2_sig]]
        extractor = last
    [[wh55_ch3_sig]]
        extractor = last
    [[wh55_ch4_sig]]
        extractor = last
    [[wh57_sig]]
        extractor = last
    [[wh68_sig]]
        extractor = last
    [[ws80_sig]]
        extractor = last
    [[ws90_sig]]
        extractor = last
#
################################################################################

[Weather34RealTime]
    realtime_path_only = ""
    unit_system = METRICWX
    exclude_fields = rain
    cache_enable = True
    cache_stale_time = 900
    weewx_port = 25252
    webserver_address = ""
    weewxserver_address = ""
    weewx_file_transfer = ""
    HTML_ROOT = ""
#
################################################################################


[LastNonZero]
    algorithm = simple    # Or tetens
#
################################################################################

# Air quality, your own latitude, longitude, token and interval in seconds are required
# Weather Underground, your own latitude, longitude, API key, language, units and interval in seconds required
# Weather Underground Units key e = US, m = METRIC, s = SI(with m/s Scandinavia), h = UK(with mph)
# Example https://api.weather.com/v3/wx/forecast/daily/5day?geocode=51.94,-0.987&language=en&format=json&units=h&apiKey=yourapikeyhere
# Earthquake reports interval in seconds required
# K-Index reports interval in seconds required
# Metar reports airport code, API Key and interval in seconds required
# Example https://api.checkwx.com/metar/EGTK/decoded
# Example X-API-Key:yourapikeyhere
# Purpleair reports device ID and interval in seconds required
# Example https://www.purpleair.com/json?show=38365
# Select the services you require by creating a string of the services above
# Example services = ds.me.eq.ki.wu.aq.al.ah.ao.aa.pu
# Select your preferred time interval in seconds for each service

[Weather34WebServices]
    aq_url = https://api.waqi.info/feed/geo:52.152154;9.929318/?token=**********
    aq_interval = 3600
    awc_url = https://api.aerisapi.com/conditions/52.152154, 9.929318?format=json&filter=1min&plimit=1&client_id=**********&client_secret=**********
    awc_interval = 300
    awh_url = https://api.aerisapi.com/forecasts/52.152154, 9.929318?filter=1hr&limit=24&client_id=**********&client_secret=**********
    awh_interval = 1800
    awd_url = https://api.aerisapi.com/forecasts/52.152154, 9.929318?filter=daynight&limit=16&client_id=**********&client_secret=**********
    awd_interval = 1800
    awp_url = https://api.aerisapi.com/phrases/summary/52.152154, 9.929318?client_id=**********&client_secret=**********
    awp_interval = 1800
    awa_url = https://api.aerisapi.com/alerts/52.152154, 9.929318?format=json&limit=10&lang=it&client_id=**********&client_secret=**********
    awa_interval = 1800
    wu_url = https://api.weather.com/v3/wx/forecast/daily/5day?geocode=52.152154, 9.929318&language=en&format=json&units=&apiKey=**********
    wu_interval = 3600
    eq_url = https://www.seismicportal.eu/fdsnws/event/1/query?limit=50&lat=52.152154&lon=9.929318&maxradius=180&format=json&minmag=2
    eq_interval = 3600
    ki_url = https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json
    ki_interval = 21600
    me_url = https://api.checkwx.com/metar//decoded
    me_header = X-API-Key:
    me_interval = 3600
    pu_url = https://www.purpleair.com/json?show=
    pu_interval = 3600
    ns_url = http://www.bom.gov.au/fwo/
    ns_interval = 900
    uk_url = https://metoffice.gov.uk/public/data/PWSCache/WarningsRSS/Region/
    uk_interval = 3600
    services = aq.awc.awh.awd.awp.awa.eq.ki
#
################################################################################

# Apply your own latitude and longitude and continent to the URLs in this section

[Weather34CloudCover]
    enable = True
    db_field = signal8
    cc_interval = 300
    cc1_url = https://api.sat24.com/crop?type=visual5hdcomplete&lat=52.152154&lon=9.929318&width=300&height=300&zoom=1.00&continent=eu
    cc1_filename = /tmp/sat1.png
    cc2_url = https://api.sat24.com/crop?type=infraPolair&lat=52.152154&lon=9.929318&width=300&height=300&zoom=1.00&continent=eu
    cc2_filename = /tmp/sat2.png


#
####################################
# DWD Erweiterung
#

[DeutscherWetterdienst]
    # Konfiguration für dwd-cap-warnings
    [[warning]]
        icons = ../dwd/warn_icons_50x50
        states = Niedersachsen
        resolution = city
        [[[counties]]]
            Kreis Hildesheim = HIX
        [[[cities]]]
            Stadt Hildesheim = HI
[WeatherServices]
    # Verzeichnis, in das die Dateien gespeichert werden sollen
    path = /etc/weewx/skins/Belchertown/dwd
    # Konfiguration zum Download aktueller Meßwerte von offiziellen
    # Stationen
    [[current]]
    # Es folgen Beispiele.
    #       [[[station_nr]]]
    #           provider = ZAMG  # DWD, ZAMG or Open-Meteo
    #           prefix = observation_type_prefix_for_station
    # equipment of the weather station (optional)
    #           observations = air,wind,gust,precipitation,solar
    #       [[[station_code]]]
    #           provider = DWD
    #           model = POI
    #           prefix = observation_type_prefix_for_station
    #       [[[station_id]]]
    #           provider = DWD
    #           model = CDC
    #           prefix = K1546
    # equipment of the weather station (optional)
    #           observations = air,wind,gust,precipitation,solar
    #       [[[ThisStation]]]
    # actual readings out of the forecast for the location of this station
    #           provider = Open-Meteo
    #           model = dwd-icon
    #           prefix = observation_type_prefix
    # Konfiguration für dwd-mosmix
#    [[forecast]]
        # Speicherort der Symbole auf dem Web-Server
#        icons = ../images
    # zu verwendender Symbolsatz: belchertown, dwd, aeris
    #icon_set = belchertown
    # für welche Orientierungen soll die HTML-Datei erzeugt werden?
    #orientation = h
    # Sollen die Meßgrößensymbole in die Tabelle aufgenommen werden?
    #show_obs_symbols = True # optional
    # Soll die Meßgrößenbeschreibung in die Tabelle aufgenommen werden?
    #show_obs_description = False # optional
    # Soll der Ortsname über die Tabelle geschrieben werden?
    #show_placemark = True # optional
    # Warnungen (dwd-cap-warnings, bbk-warnings, msc-warnings)
    [[warning]]
        #icons = '../images' # Optional, für alle Provider
        #bbk_icons = ... # Optional, nur für BBK
        #bbk_logos = ... # Optional, nur für BBK
        #bbk_include_dwd ... # Optional, nur für BBK
        #dwd_icons = '../images' # Optional, nur für DWD
        #dwd_status_url = ... # Optional, nur für DWD
        #dwd_diff_url = ... # Optional, nur für DWD
        # Beispiele
        #        [[[1]]]
        #            provider = MSC # Canada
        #            office = ... # Code of the issuing office (try without if unsure)
        #            county = county_name
        #            file = target_file
        [[[103254000]]]
            provider = BBK
            # Die Überschrift ist die Kreiskennung.
            file = HIX
        [[[Hildesheim]]]
            provider = BBK
            county = 8032540210000
            file = HI
    # Konfiguration für die --belchertown Option von dwd-mosmix
    [[Belchertown]]
        # Name des Abschnittes der Belchertown-Skin in [StdReport]
#        section = Belchertown
        # Warndatei aus dem Abschnitt [[warnings]]
#        warnings = HIX
        # Vorhersagedatei aus dem Aufruf 'dwd-mosmix'
#        forecast = K1546
        # schließe Warnungen ein, die die angegebene Zahl von Sekunden in
        # der Zukunft gültig werden (optional)
#        include_advance_warnings = 3600
        # Quelle für Luftqualtitätsdaten (optional)
        # mögliche Werte: aeris, ubaXXXX
        aqi_source = aeris    # funktioniert
    #aqi_source = uba9482 # funktioniert NICHT
    #aqi_source = ubaDENI066 # funktioniert NICHT
   
    # Sprache für die Himmelsrichtungen (optional)
    # mögliche Werte: de, en, fr, it, cz, es, nl, no, gr
    #compass_lang = 'de' # optional
   
    [[BBK]]
        #icons =
        #logos = 

michael.k...@gmx.at

unread,
Aug 14, 2023, 8:15:46 AM8/14/23
to weewx-user
I cannot see from the config file why your database values for lightning distance aren't NULL, when lightning_strike_count = 0.
Message has been deleted

tarob...@gmail.com

unread,
Aug 17, 2023, 10:17:19 AM8/17/23
to weewx-user
Here is my graphs.conf section for lightning:

    [[daylightning]]
        title = Lightning (hourly total)
        time_length = today
        aggregate_type = sum
        aggregate_interval = 3600
        type = column
        [[[lightning_strike_count]]]
            name = Lightning
        [[[lightning_distance]]]
            name = Min Distance
            aggregate_type = min
            yAxis = 1

Blue is Lightning Strike Count and green is the Min lighting distance captured of those strike counts.

Lightning.png
Message has been deleted

Stefan Gliessmann

unread,
Aug 22, 2023, 9:23:25 AM8/22/23
to weewx-user
I made this change in my weewx.conf file under StdCalibrate / Corrections:

       lightning_distance = lightning_distance if lightning_strike_count > 0 else 0

and it yields this graph:
Screenshot 2023-08-22 at 11.15.30.png

Let's see if this works correctly when we have the next lightning ...

(The blue spot at 42 km was a test when I added a fix number to lightning_distance in weewx.conf to verify it reads it correctly)

Thank you all for your help & input!

michael.k...@gmx.at

unread,
Aug 22, 2023, 9:37:34 AM8/22/23
to weewx-user
This is interesting, but why doesn't 'None' work, when '0' works? Still a mystery to me.
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages