ironsheep / lightning-detector-MQTT2HA-Daemon

Linux script to monitor AS3935 lightning detector and report detections to MQTT
GNU General Public License v3.0
34 stars 7 forks source link

MQTT lightningdetector/detect not updating count and distance #8

Closed lightmaster closed 3 years ago

lightmaster commented 4 years ago

Checklist:

Release with the issue: v2.0.3 Last working release (if known):

Hardware, Operating System, Python version: RPi 3B, Raspberry Pi OS, Python 3.7.3

Description of problem: MQTT messages to detect for count and distance always equal 1, even though the messages sent to crings and prings count properly and show reasonable distances.

MQTT Lightning Detect Count bug

Python errors shown in the logs (if applicable):

Additional information:

ironsheep commented 4 years ago

A review of code shows nothing notable. I'm going to have to recreate this to determine if there is a problem. More soonish....

FYI-

ironsheep commented 4 years ago

@lightmaster I'm guessing that our latest finding is the explanation for this lack of reporting? I'll bet when you proved the AS3935 is communicating this will be better!

ironsheep commented 4 years ago

Is this fixed too then?

lightmaster commented 4 years ago

I need some lightning to know that, lol. Where's Thor when you need him?

ironsheep commented 4 years ago

I'll leave this open so you can post status when you finally hear some... ;-)

lightmaster commented 4 years ago

Nope, MQTT is still showing 1 count on the Home Assistant MQTT Integrations card.

Lovelace Card showing 2 strikes

MQTT Devices card showing 1 strike

ironsheep commented 4 years ago

I'm not seeing anything wrong here. [count, distance, energy, and last] report the latest detection.

The count should be the count of detections in the last 3 seconds (it only reports every three seconds so we don't storm the MQTT broker.) If detections are 3 seconds apart, or more, this will be 1. If the count is > 1 then distance and energy are the latest detected values.


re: my alternative to your pull request (Thank you for it and for noting that I should fix this stuff, as always!) Changes committed to /master and appear in v2.2.7 and later.

See: Release Notes v2.2.7.

ironsheep commented 4 years ago

Saw your "works great" on my commit. Good to hear. Closing this issue then.

lightmaster commented 4 years ago

I was in the middle of typing up something about it on here and gonna close the issue when I got called away at work.

ironsheep commented 4 years ago

No worries, you can always enter more after closing. But I re-opened it for you.