ambient-weather / api-docs

AmbientWeather.net API Documentation
65 stars 43 forks source link

lightning_hour clarification #45

Open tlskinneriv opened 1 year ago

tlskinneriv commented 1 year ago

Ambient weather devices do not seem to send this as a value to custom endpoints with the Ambient Weather API style communication. Is this field calculated server side? If so, what is the formula for calculation? Thanks!

themoosman commented 1 year ago

Here is some data to back this up. Here is my lightning data retrieved from the API today. Strikes per day and distance match what's on the UI, but the strikes per hour make no sense.

image

tlskinneriv commented 1 year ago

What is the delta time/transmit interval between each row of data?

EDIT: or if you can dump the table with the timestamps from the transmits, that works, too.

themoosman commented 1 year ago

Here are CSVs for yesterday (image above) and some data from today (today.csv)

yesterday.csv today.csv

tlskinneriv commented 1 year ago

So far, from the patterns that I can pick out, it looks like this is roughly calculated as:

(lightning_day(now) - lightning_day(now-1hr)) * 2

Logically, this doesn't make much sense to me. It seems like an arbitrary doubling of the number of strikes that have happened in the last hour. What does make sense to me, however is the following:

lightning_day(now) - lightning_day(now-1hr)

That deduces the number of strikes that happened in the last hour, which is what I think the sensor value is trying to communicate. For now, the latter equation is what I'll use to deduce the number of strikes for lightning_hour in my integration. Hopefully, Ambient Weather will chime in and let us know what's really happening.

owise1 commented 1 year ago

you may have found a bug! we'll look into it

owise1 commented 1 year ago

@themoosman would you mind providing your stations mac address so we can look into this further?

@tlskinneriv to answer your original question, lightning_hour is calculated on the server and should use the general logic you suggested. we ran some internal tests and the lightning_hour calculations appear to be working correctly. are you seeing the same strange "doubling" phenomena as well? if so would you mind providing your mac address?

tlskinneriv commented 1 year ago

@owise1 Unfortunately, I do not have a lightning sensor yet, so even if I was sending data, I wouldn't have any lightning data.

themoosman commented 1 year ago

@themoosman would you mind providing your stations mac address so we can look into this further?

@tlskinneriv to answer your original question, lightning_hour is calculated on the server and should use the general logic you suggested. we ran some internal tests and the lightning_hour calculations appear to be working correctly. are you seeing the same strange "doubling" phenomena as well? if so would you mind providing your mac address?

I can, but I'd need a secure way to transmit the MAC.

owise1 commented 1 year ago

@themoosman you can send it to dev@ambientweather.net

themoosman commented 1 year ago

@themoosman you can send it to dev@ambientweather.net

Sent.

themoosman commented 3 months ago

@owise1 Did you find anything in your investigation?