Author Topic: InfluxDB/Grafana with Acurite 6045M Lightning Detector  (Read 1005 times)

0 Members and 1 Guest are viewing this topic.

Offline allenm

  • Member
  • *
  • Posts: 8
InfluxDB/Grafana with Acurite 6045M Lightning Detector
« on: April 01, 2021, 12:13:12 PM »
Is anyone using Grafana (or something similar) to display lightning activity from their Acurite 6045M? Just wondering what would be a meaningful way to display strikes and distance in graph form. I am currently using Influx & Grafana to display other sensor data retrieved with rtl_433, including (6) Acurite 592TXR Temperature / Humidity and (2) Acurite 986 Refrigerator / Freezer sensors. No thunderstorms yet this season here in New Hampshire, so I don't have any lightning data to try.

Offline allenm

  • Member
  • *
  • Posts: 8
Re: InfluxDB/Grafana with Acurite 6045M Lightning Detector
« Reply #1 on: April 22, 2021, 07:57:26 AM »
Well, we had our first thunderstorm of the season here in New Hampshire yesterday, so I was able to capture some lightning data. It started at 16:25 and lasted about an hour. I wasn't sure what to expect, as far data captured using rtl_433 and have some questions.

A quick overview of what I'm doing: rtl_433 sends the 6045M data to a text file each time a transmission occurs, a Python program monitors the text file and sends any new data to an influx database, Grafana monitors the database and updates its graphs every 5 seconds.

My 6045M had been reporting a distance of 10 and a strike count of 21 since I installed it a couple of months ago. At 16:25 the dstance went to 20 and the strike count went to 22. At 16:28 the distance went to 8 and the strike count to 23. The strike count continued to increment while the distance stayed at 8. Then at 16:44 the distance dropped to 4 and the strike count kept incrementing. At 16:49 the distance dropped to 0 while the strike count kept incrementing on up to 67.

I guess the storm had passed by 17:26 because the distance went to 12 where it has remained. The strike count has stayed at 68 and hasn't changed either.

I assume the distance will go to 20 the next time a storm comes along, but what will the strike count do? Will it start incrementing from 68?

Without an programatic way to "reset" the 6045M, this makes it difficult to chart meaningful data. I suppose my Python program could clear my text file after a storm has passed, but that's a bit crude.

I've attached a clip of my graph right after the storm.

 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]
« Last Edit: April 22, 2021, 08:00:14 AM by allenm »

Offline Storm017

  • Senior Contributor
  • ****
  • Posts: 172
Re: InfluxDB/Grafana with Acurite 6045M Lightning Detector
« Reply #2 on: April 22, 2021, 08:13:01 AM »
"I assume the distance will go to 20 the next time a storm comes along, but what will the strike count do?" Depends on the distance of the next lighting strike.

"Will it start incrementing from 68?" Yes it will start to increment from 68.  The counter will roll over @ 255 and start over @ 0.

The 6045M Lightning Detector is based on the AS3935 lightning sensor. For additional information, refer to https://eu.mouser.com/pdfdocs/AMS_AS3935_Datasheet_v4.pdf



Offline allenm

  • Member
  • *
  • Posts: 8
Re: InfluxDB/Grafana with Acurite 6045M Lightning Detector
« Reply #3 on: April 22, 2021, 09:06:02 AM »
Thanks, that helps me better understand how it works. The strike count must be maintained in whatever CPU chip (PIC, etc) is interfaced to the AS3935. In any case, there probably isn't any practical way to reset the strike count short of pulling the batteries. That would no doubt change the ID, which creates a problem for my Python program the way it's written. I guess the best solution for me is to rewrite my Python program to not rely on a specific ID and also rescale the strike count so that it isn't way out of proportion as it gets upward to 255 compared to the strike distance of 0 - 25 for graphing purposes.

I need to program in an alarm sound anyway since my 6045M is outside where I can't hear it.
« Last Edit: April 22, 2021, 09:07:51 AM by allenm »

Offline Storm017

  • Senior Contributor
  • ****
  • Posts: 172
Re: InfluxDB/Grafana with Acurite 6045M Lightning Detector
« Reply #4 on: April 22, 2021, 09:38:19 AM »
When I changed batteries in the 6045M, the ID did not change. Need to watch your counter because the count does not always increment by 1. 

As for a program, I use Node Red on a RPI.  There is a node available for RTL_433 which decodes fine.  Here is an output from that node:
 
{"time":"2021-04-22 09:35:24","model":"Acurite-6045M","id":121,"channel":"B","battery_ok":1,"temperature_F":59.5,"humidity":33,"strike_count":82,"storm_dist":24,"active":0,"rfi":0,"exception":0,"raw_msg":"80796f21901ba918f5"}

 

anything