I think you might find the [[Corrections]] stanza belongs under 
[StdCalibrate] <http://weewx.com/docs/usersguide.htm#StdCalibrate> rather 
than the SDR driver.

Gary
On Monday, 24 May 2021 at 02:32:14 UTC+10 Eric K wrote:

> 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
>
>
> On Sunday, May 23, 2021 at 11:19:26 AM UTC-5 Eric K wrote:
>
>> 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?
>>
>> [image: ksnip_20210523-111132.png]
>>
>> On Thursday, July 23, 2020 at 5:55:55 AM UTC-5 [email protected] wrote:
>>
>>> 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 
>>>
>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/abbca7f3-6f34-4c66-896c-2e9f8d518306n%40googlegroups.com.

Reply via email to