Lightning Detector shows bad data

215 views
Skip to first unread message

Kenny Stier

unread,
Mar 1, 2020, 7:17:01 PM3/1/20
to weewx-user
I am working on including my lightning detector data on my homepage but am having some issues.
I am using an Acurite 06045M over SDR on Belchertown. https://wx.millhousen.com/

1. For some reason, the Lightning Distance is shown on the graph as being 24 consistently, but it hasn't stormed in many months. 

2. Also, the number of strikes has many trailing zeros and is changed by MQTT to say 120. The database shows the 0.00000 number.

Where am I going wrong?

/etc/weewx/skins/Belchertown/skin.conf
    station_observations = "barometer", "dewpoint", "outHumidity", "rainWithRainRate", "lightning_strikes", "visibility"


/etc/weewx/skins/Belchertown/graphs.conf
    [[lightning]]
        title = Lightning
        [[[lightning_strikes]]]
            name = Lightning
            stacking = normal
        [[[lightning_distance]]]
            name = Average Distance
            stacking = normal

/etc/weewx/weewx.conf
[SDR]
    # This section is for the software-defined radio driver.

    # The driver to use
    driver = user.sdr
    cmd = /usr/local/bin/rtl_433 -M utc -F json -G 4
    [[sensor_map]]
        inTemp = temperature.0786.AcuriteTowerPacket    # Basement Bedroom
        inHumidity = humidity.0786.AcuriteTowerPacket
        inTempBatteryStatus = battery.0786.AcuriteTowerPacket
        outTemp = temperature.006D.Acurite5n1Packet    # Chicken Coop
        outHumidity = humidity.006D.Acurite5n1Packet
        outTempBatteryStatus = battery.006D.Acurite5n1Packet
        windDir = wind_dir.006D.Acurite5n1Packet
        windSpeed = wind_speed.006D.Acurite5n1Packet
        rain_total = rain_total.006D.Acurite5n1Packet
        extraTemp1 = temperature.2B96.AcuriteTowerPacket    # Basement
        extraHumid1 = humidity.2B96.AcuriteTowerPacket
        extraBattery1 = battery.2B96.AcuriteTowerPacket
        extraTemp2 = temperature.00E7.AcuriteLightningPacket    # Garage
        extraHumid2 = humidity.00E7.AcuriteLightningPacket
        lightning_strikes_total = strikes_total.00E7.AcuriteLightningPacket
        lightning_distance = distance.00E7.AcuriteLightningPacket
        lightning_rfi = rfi.00E7.AcuriteLightningPacket
        lightning_battery = battery.00E7.AcuriteLightningPacket

    [[deltas]]
        rain = rain_total
        lightning_strikes = lightning_strikes_total

mosquitto_sub -h 192.168.0.15 -t weather/loop
{"extraTemp3_F": "69.8754249949", "hourRain_in": "0.0", "dateTime": "1583108013.0", "rain24_in": "0.0", "maxSolarRad": "0.0", "rainRate_inch_per_hour": "0.0", "lightning_strikes": "0.0", "dayRain_in": "0.0", "lightning_distance": "24.0", "extraHumid2": "49.0", "lightning_battery": "1.0", "lightning_strikes_total": "120.0", "lightning_rfi": "0.0", "extraTemp2_F": "54.1", "usUnits": "1.0", "extraHumid3": "36.0101402392"}


Greg Troxel

unread,
Mar 1, 2020, 7:50:30 PM3/1/20
to Kenny Stier, weewx-user
Kenny Stier <kenny....@gmail.com> writes:

> I am working on including my lightning detector data on my homepage but am
> having some issues.
> I am using an Acurite 06045M over SDR on Belchertown.
> https://wx.millhousen.com/
>
> 1. For some reason, the Lightning Distance is shown on the graph as being
> 24 consistently, but it hasn't stormed in many months.
>
> 2. Also, the number of strikes has many trailing zeros and is changed by
> MQTT to say 120. The database shows the 0.00000 number.
>
> Where am I going wrong?

First, make sure that rtl_433 is reporting values that you think are
correct. If not, adding json and weewx isn't going to make things
better.

It is probably best to be up-to-date with rtl_433.

It may be that if strike count is 0, the rest is undefined.

As I understand it, rtl_433 for 6045M is a work in progress and the
codepoint/distance relationship is not fully worked out. Especially if
you have an Acurite console so you can obtain codepoint/distance pairs
(in US Customary or metric units), you should consider joining the
rtl433 mailinglist.

See https://github.com/merbanan/rtl_433 for pointers.

Greg Troxel

unread,
Mar 1, 2020, 8:08:01 PM3/1/20
to Kenny Stier, weewx-user
After a quick private discussion about rtl_433:

The basic issue is probably that rtl_433 simply decodes the fields as
transmitted from the 6045M. It does not maintain state; this is a
core rtl_433 principle.

Therefore, some code has to take the messages and accumulate strikes,
when the count goes up, and basically report a "n strikes happened,
last one's distance is X" when the count changes. This code has to
deal with wrapping.

The 6045M messsages will have a distance field that stays the same
until the next strike.

In doing all of this, keep in mind that the 6045M might be power
cycled.

So perhaps the SDR driver needs some attention in this area. It's
almost certainly going to take someone who can read/debug/fix the code
to improve it.

My advice to look at the rtl_433 output stands; if you find problems
there or have better codepoint/distance information, it's most welcome
on the rtl_433 list.

Greg

mwall

unread,
Mar 3, 2020, 6:35:17 PM3/3/20
to weewx-user


On Sunday, March 1, 2020 at 7:17:01 PM UTC-5, Kenny Stier wrote:
I am working on including my lightning detector data on my homepage but am having some issues.
I am using an Acurite 06045M over SDR on Belchertown. https://wx.millhousen.com/

1. For some reason, the Lightning Distance is shown on the graph as being 24 consistently, but it hasn't stormed in many months. 

as greg suggested, please check the raw output from rtl_433 to where the 24 is coming from. 

 
2. Also, the number of strikes has many trailing zeros and is changed by MQTT to say 120. The database shows the 0.00000 number.

its been awhile, but i'm pretty sure the 06045M reports a cumulative value for strikes.  i'm not sure when it wraps/resets.

the weewx-sdr driver will do delta calculations to convert a cumulative value (count since last reset/wraparound) to a delta value (count since last packet).  the build-in definition looks like this:

[[deltas]]
    rain: rain_total
    strikes: strikes_total

so if you have this mapping:

[SDR]
    ...
    [[sensor_map]]
        ...
        strikes_total = strikes_total.00E7.AcuriteLightningPacket

then the observation 'strikes' will have the delta value and 'strikes_total' will have the cumulative value.

or you can do this:

[SDR]
    ...
    [[deltas]]
        lightning_strikes = lightning_strikes_total

if you prefer to use the name 'lightning_strikes' instead of 'strikes'

of course, all of that assumes the sensor is sending sane data, and that rtl_433 is not doing any other manipulations.

m


Kenny Stier

unread,
Mar 29, 2020, 12:44:01 AM3/29/20
to weewx-user
The sensor appears to be sending sane data.

For some reason the site says Lightning Strikes 62 even though I told it to display the delta value lightning_strikes and not lightning_strikes_total
Message has been deleted

Andrew Milner

unread,
Mar 29, 2020, 1:31:41 AM3/29/20
to weewx-user
How did you tell it to display the delta value?

Did you stop/restart weewx after editing weewx.conf to put in the delta?

Kenny Stier

unread,
Mar 29, 2020, 3:37:26 PM3/29/20
to weewx...@googlegroups.com, weewx-user
My [SDR] config where I defined the delta is in my original message, and I have restarted since putting it in.
My Belchertown skin.conf is where I configured Belchertown to display the number of lightning strikes. (in first message as well)

On my site https://wx.millhousen.com/, Lightning Strikes show as "0.000000" until MQTT provides an update and changes it to 62 (which should be lightning_strikes_total).
The rtl433 output I posted earlier was during a thunderstorm, as are these entries in the weewx.sdb
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
Sent from Mailspring
Screenshot from 2020-03-29 15-35-13.png

Sean Ostermann

unread,
Jun 4, 2020, 7:54:38 PM6/4/20
to weewx-user
Kenny,

Did you ever get this worked out?  I am seeing the exact same issues you are.  I added lightning to my belchertown skin for station observations and I am seeing the 0.00000 for it until MQTT updates (but I get an undefined sometinmes).  Trying to figure out how to not display the 0.00000 and just show the number.

Sean


On Sunday, 29 March 2020 14:37:26 UTC-5, Kenny Stier wrote:
My [SDR] config where I defined the delta is in my original message, and I have restarted since putting it in.
My Belchertown skin.conf is where I configured Belchertown to display the number of lightning strikes. (in first message as well)

On my site https://wx.millhousen.com/, Lightning Strikes show as "0.000000" until MQTT provides an update and changes it to 62 (which should be lightning_strikes_total).
The rtl433 output I posted earlier was during a thunderstorm, as are these entries in the weewx.sdb


To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.
Sent from Mailspring
Reply all
Reply to author
Forward
0 new messages