Belchertown lightning graph

576 views
Skip to first unread message

Mark Fraser

unread,
Jun 20, 2023, 6:05:47 AM6/20/23
to weewx...@googlegroups.com
I currently have this in graphs.conf to show lightning strikes over the
past 3 hours and it works:

[[Lightning_chart]]
title = Lightning (Last 3 Hours)
time_length = 10800
aggregate_interval = 300
gapsize = 108000
type = column

[[[lightning_strike_count]]]
name = Lightning Count
zIndex = 1
aggregate_type = sum

Except that:
user.belchertown: Observation lightning_strike_count is using unit count
that returns %d for StringFormat, rather than float point decimal format
value - using 0 as rounding
Is showing in the system log.

Dan Roman

unread,
Jun 20, 2023, 9:30:23 AM6/20/23
to weewx-user
Thanks Mark, I will give it a try and add it to my graphs to see if it works with Weatherflow.

Were you able (or did you try) to add a last 3 hours lightning count to the Belchertown main page, for example, "Lightning count last 3 hours: 15"?

That's one of the things that Alex and I were trying to accomplish as well.

Dan

Mark Fraser

unread,
Jun 20, 2023, 5:49:57 PM6/20/23
to weewx...@googlegroups.com

Dan,

I haven't got that far with it yet, only installed the skin a few weeks ago.  I have managed to create a couple more 1 line observations similar to rain & rain rate so that the inside temp & humidity are on 1 line, same with UV index & radiation.

Still need to figure out what to do with luminosity - it was added to units.py in 1 commit and then removed a little while later and how to rename the battery statuses from "batteryStatus1" to something meaningful.


Mark.

Kevin Crivelli

unread,
Jun 20, 2023, 7:10:18 PM6/20/23
to weewx...@googlegroups.com
I lost my mind trying to get this right but I think I'm happy now with these two graphs. One works better for shorter periods of time the other works better for longer periods of time where the first has trouble.

Here's a screenshot of how I have mine set up. This is in week view. For day, yesterday, 24 hour I use the first one you see here. At week view I use them both and month and year I use the second one in this screenshot that just does total strikes. That's my set up anyway. I'm going to check out the ones everyone else shared here.

lightning graphs.JPG

Here is the configuration


    [[chart7]]
        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 = "#6FE7FB"
            lineWidth = 0
            [[[[marker]]]]
                enabled = true
                radius = 3
            [[[[states]]]]
                [[[[[hover]]]]]
                        lineWidthPlus = 0

[[chart8]]
title = Lightning Total

        [[[lightning_strike_count]]]
            name = Lightning Count
            observation_type = lightning_strike_count
            type = column
            stacking = normal
aggregate_type = sum



--
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/9368fe1c-b65f-f291-8cc9-479cfde041c6%40gmail.com.

Mark Fraser

unread,
Jun 22, 2023, 5:11:35 AM6/22/23
to weewx...@googlegroups.com
On 20/06/2023 14:30, Dan Roman wrote:
> Thanks Mark, I will give it a try and add it to my graphs to see if it
> works with Weatherflow.
>
> Were you able (or did you try) to add a last 3 hours lightning count to
> the Belchertown main page, for example, "Lightning count last 3 hours: 15"?
>
> That's one of the things that Alex and I were trying to accomplish as well.

Dan,
Any ideas how to get rid of

"Observation lightning_strike_count is using unit count that returns %d
for StringFormat, rather than float point decimal format value - using 0
as rounding "?

Dan Roman

unread,
Jun 24, 2023, 10:15:11 PM6/24/23
to weewx...@googlegroups.com
Had a thunderstorm today and lightning still does not register at all even after adding the graphs. I don't think lightning is being saved in my database and I have to figure that out first, then I might be able to display it.


--
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/8S1zsvbW2v8/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/fa0a934d-146e-2e89-034c-e4edcf6b394d%40gmail.com.

pmcg...@gmail.com

unread,
Aug 27, 2023, 10:25:11 AM8/27/23
to weewx-user
Di you ever figure out how to get rid of this?

Observation lightning_strike_count is using unit count that returns %d for StringFormat, rather than float point decimal format value - using 0 as rounding

Thanks!

Dan Roman

unread,
Aug 28, 2023, 11:27:01 AM8/28/23
to weewx...@googlegroups.com
Hi Mark,

Coincidentally I was just working on this last week.  I have not been able to get lightning working completely still. In my configuration lightning_strikes and avg_distance still display as Invalid Observations in Belchertown.  I was able to get the following observations added but have to wait for a thunderstorm to see if it works.  I added a second lightning entry lightning_strike_count to my sensor map to experiment with because I think my entries in [Accumulator] are causing problems.
Lightning Strikes0
Lightning DistanceN/A
  

I have been playing with the graphs too.  I am able to get a graph to display by distance but trying to get more than just that on the graph broke things.  I wanted to try a column chart for the number of strikes, but could not figure it out.  For my Tempest I am using the Weatherflow UDP and this is my sensor map, pretty standard...

    [[sensor_map]]
        # This section is for handling data for the Tempest Weather Station
        outTemp = air_temperature.ST-00102080.obs_st
        outHumidity = relative_humidity.ST-00102080.obs_st
        pressure = station_pressure.ST-00102080.obs_st
        lightning_strikes = lightning_strike_count.ST-00102080.obs_st
        avg_distance = lightning_strike_avg_distance.ST-00102080.obs_st
        outTempBatteryStatus = battery.ST-00102080.obs_st
        windSpeed = wind_speed.ST-00102080.rapid_wind
        windDir = wind_direction.ST-00102080.rapid_wind
        luminosity = illuminance.ST-00102080.obs_st
        UV = uv.ST-00102080.obs_st
        rain = rain_accumulated.ST-00102080.obs_st
        #windBatteryStatus = battery.ST-00102080.obs_st
        radiation = solar_radiation.ST-00102080.obs_st
        lightning_distance = distance.ST-00102080.evt_strike
        #lightningYYY = energy.ST-00102080.evt_strike
        lightning_strike_count = lightning_strike_count.ST-00102080.obs_st

The last entry I added as a duplicate to experiment with.

And I have this correction...

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

And this for accumulator...

[Accumulator]
    [[lightning_strikes]]
        extractor = sum
    [[lightning_distance]]
        extractor = min
    [[avg_distance]]
        extractor = avg

I have not been able to get all the lightning info I want to display with either the Seasons or Belchertown skins.

I played around with Seasons to see if I could get things working there since I was having trouble in Belchertown.  I put the same observations in Seasons as Belchertown and get the same results.  I tried this in skin.conf for graphs too, but they don't look right, may need to accumulate some data:

        [[[daylightning]]]
            yscale = None, None, 1
            plot_type = bar
            [[[[lightning_strikes]]]]
                aggregate_type = sum
                aggregate_interval = hour
                label = Lightning (hourly total)

        [[[daylightningdistance]]]
           yscale = None, None, 1
            plot_type = bar
            [[[[lightning_distance]]]]
                aggregate_type = min
                aggregate_interval = hour
                label = Lightning (closest hourly)

And in Belchertown these entries in graph.conf throw errors (I have them commented for now):

#    [[Lightning_chart]]
#        title = Lightning count
#        time_length = 10800
#        aggregate_interval = 300
#        gapsize = 108000
#        type = column
#
#        [[[lightning_strikes]]]
#            name = Lightning Count
#            zIndex = 1
#             aggregate_type = sum

Throws this error:
weewx.UnknownType: 'lightning_strikes' or 'sum'
Warning: Error trying to use database binding wx_binding to graph observation lightning_strikes. Error was: 'lightning_strikes' or 'sum'.

#    [[LightningInfo]]
#        title = Lightning
#        [[[lightning_strikes]]]
#            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                

This throws:
weewx.UnknownType: lightning_strikes
Warning: Error trying to use database binding wx_binding to graph observation lightning_strikes. Error was: lightning_strikes.

Not sure if my weewx.conf entry under [Accumulator] is causing the problem?

I also tried Kevin's graphs that he provided on June 20th but haven't gotten them to work either, which is why I added the lightning_strike_count to my sensor list. Get errors:
TypeError: unsupported operand type(s) for %: 'NoneType' and 'int'
Warning: Error trying to use database binding wx_binding to graph observation lightning_strike_count. Error was: unsupported operand type(s) for %: 'NoneType' and 'int'.

Maybe I have to wait for some lightning data to be added first.

It has been very frustrating!

Dan


Dan Roman

unread,
Sep 11, 2023, 10:05:43 AM9/11/23
to weewx-user
An update since I experienced a lot of lightning over the past week.  As a refresher, here are my pertinent lines from weewx.conf:

    [[sensor_map]]
        # This section is for handling data for the Tempest Weather Station
        outTemp = air_temperature.ST-00102080.obs_st
        outHumidity = relative_humidity.ST-00102080.obs_st
        pressure = station_pressure.ST-00102080.obs_st
        lightning_strikes = lightning_strike_count.ST-00102080.obs_st
        avg_distance = lightning_strike_avg_distance.ST-00102080.obs_st
        outTempBatteryStatus = battery.ST-00102080.obs_st
        windSpeed = wind_speed.ST-00102080.rapid_wind
        windDir = wind_direction.ST-00102080.rapid_wind
        luminosity = illuminance.ST-00102080.obs_st
        UV = uv.ST-00102080.obs_st
        rain = rain_accumulated.ST-00102080.obs_st
        #windBatteryStatus = battery.ST-00102080.obs_st
        radiation = solar_radiation.ST-00102080.obs_st
        lightning_distance = distance.ST-00102080.evt_strike
        #lightningYYY = energy.ST-00102080.evt_strike
        lightning_strike_count = lightning_strike_count.ST-00102080.obs_st

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

[Accumulator]
[[lightning_strikes]]
extractor = sum
[[lightning_distance]]
extractor = min
[[avg_distance]]
extractor = avg

I experimented with the Seasons skin to double-check what I was doing in the Belchertown skin.  These two entries in skin.conf yield the graphs shown.  Seems to work ok for both.   But I had to use my new lightning_strike_count variable because the Accumulator summing lightning_strikes must have been messing up the graphs.  At least that is my theory, any input is appreciated.

        [[[weeklightning]]]

            yscale = None, None, 1
            plot_type = bar
            [[[[lightning_strike_count]]]]
                aggregate_type = sum
                aggregate_interval = day
                label = Lightning (daily total)
weeklightning
        [[[weeklightningdistance]]]
            yscale = 0, 25, 5
            line_type = None
            marker_type = box
            marker_size = 2
            [[[[lightning_distance]]]]
                label = Lightning Distance
weeklightningdistance

And for Belchertown:
   [[weekLightningInfo]]

        title = Lightning
        [[[lightning_strike_count]]]
            yAxis = 0
            yAxis_min = 0
            yAxis_tickInterval = 1
            yAxis_label = "Number of Strikes"
            stacking = normal
            color = "orange"
            lineWidth = 0
            #aggregate_type = sum

            [[[[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
            #aggregate_type = min

            [[[[marker]]]]
                enabled = true
                radius = 3
            [[[[states]]]]
                [[[[[hover]]]]]
                        lineWidthPlus = 0    
 
Screenshot 2023-09-11 095402.png
I have to do some further tweaking on the left y-axis tick interval, but the data looks good.  Need to figure out how to get rid of the 0 value for all the no-strike points.

I tried this, but it yields a blank graph, probably because of the aggregate options...
   [[lightningthisweek]]
        title = Lightning (hourly total)
        time_length = week
        aggregate_type = sum
        aggregate_interval = 3600

        type = column
        [[[lightning_strike_count]]]
            name = Lightning
        [[[lightning_distance]]]
            name = Min Distance
            aggregate_type = min
            yAxis = 1

This one yields a good graph and I will probably try to combine this with the lightning strikes/distance graph above.
Screenshot 2023-09-11 100013.png

This guy's site https://weather.sangrephotography.com/ has a good lightning graph (only lightning for the day so you have to wait for a thunderstorm for the graph to appear).  I contacted him trying to get the config files he uses but he has not responded.

I need to read through and understand High Charts better.

Dan

Joachim Puttkammer

unread,
Feb 14, 2024, 3:51:40 PM2/14/24
to weewx-user
Except that:
user.belchertown: Observation lightning_strike_count is using unit count
that returns %d for StringFormat, rather than float point decimal format
value - using 0 as rounding
Is showing in the system log.

Have you solved the problem?

Dan Roman

unread,
Feb 14, 2024, 4:00:41 PM2/14/24
to weewx...@googlegroups.com
No, I have not.  The consensus was since it is only a warning, and everything else still works, it wasn't worth trying to muck around and fix the format in the belly of the beast.  So I just let it be.


--
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/8S1zsvbW2v8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.


--
Dan Roman
 
Reply all
Reply to author
Forward
0 new messages