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 Strikes | 0 |
| Lightning Distance | N/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