Page 1 of 2

Api max values (changing 5 min db update)

Posted: Sun Dec 30, 2018 1:59 am
by mchd17
MT uses max values from api, for the day, from MB, correct?

Re: Api max values

Posted: Fri Jan 18, 2019 11:08 pm
by mchd17
I am asking because I am seeing differences in MT from other sites that I upload data to. I can attatch ss's if needed.

Re: Api max values

Posted: Sat Jan 19, 2019 12:01 am
by mchd17
Today

Meteobridge shows max wind of 15.0mph at 2:16am
MT shows wind gust of 13.0mph at 2:20am, (database updates at 5 minutes)
MT shows wind gust of 12.1mph at 2:15am
MT shows max wind gust of the day at 14.1mph at 3:00pm
WeatherLink shows max wind gust of 15.0mph at 2:20am(updates at 5 minutes)
PWSWeather shows max wind gust of 15 mph at 2:22 am (updates at 10 minutes)
WeatherCloud shows max wind gust of 15 mph at 2:22 am (updates at 10 minutes)

So there has to be a reason why MT doesn't use the max values of Meteobridge, ideas?
I have the api updating every 10 seconds

Re: Api max values

Posted: Sat Jan 19, 2019 12:30 am
by mchd17
Does MT cache the api values, even max values, and averages them for the 5 minute database entries? If so, I really won't know what the max wind gust really is

Re: Api max values

Posted: Sat Jan 19, 2019 10:31 am
by mchd17
Good for this morning
MT shows 30.0 mph at 4:20am
Other sites I upload data to showing 30 mph within minutes to 4:20 am.

So that's good.

Re: Api max values

Posted: Sun Jan 20, 2019 10:26 am
by mchd17
This morning

MT max wind gust 21.0 mph at 1:40 am

Meteobridge 23.9 mph at 1:36 am
All other sites I upload to show 23.9 at 1:36 am (or close to that time)

MT uses all averages, even for daily max values? Hmmmm

Re: Api max values

Posted: Mon Jan 21, 2019 12:55 pm
by mchd17
Is there an easy way to setup MT to update database at shorter intervals? Say 3 minutes instead of 5 minutes. Maybe that would help me to get more accurate entries. Could setup cron job I guess. Database will be larger.

Re: Api max values

Posted: Mon Jan 21, 2019 2:37 pm
by mchd17
Any known issues by changing this code in api.php on line 1147 (change db update from 5 minutes to 3 minutes)

Code: Select all

    ############################################################################
    // Check db update / update db
    ############################################################################

    $dbInterval = 300;
    
    // check if cache file contain a record
to this code

Code: Select all

    ############################################################################
    // Check db update / update db
    ############################################################################

    $dbInterval = 180;
    
    // check if cache file contain a record

Re: Api max values (changing 5 min db update)

Posted: Mon Jan 21, 2019 11:48 pm
by mchd17
Been running well all day. I have seen no issues, besides a faster growing db. Max wind gusts have been better recorded.

This forum is sure quiet

Re: Api max values (changing 5 min db update)

Posted: Tue Jan 22, 2019 9:43 am
by mchd17
Meteobridge showing max wind of 33.1 mph at 3:20am

MT showing 30 mph at 3:21am
MT max gust for the day 32 at 2:48am

Re: Api max values (changing 5 min db update)

Posted: Tue Jan 22, 2019 7:34 pm
by Jachym
Hi,
MT uses max value of gust, so if for example you send data to MT every minute, it would use the max value of G from the 5 minutes as wind gust and avg value of W for wind speed

Re: Api max values (changing 5 min db update)

Posted: Tue Jan 22, 2019 11:27 pm
by mchd17
Hi Jachym,

Some days MT is off max gust, lower than meteobridge. It isn't the same as what meteobridge shows as max. Today, right now is dead on. This morning it was off. Any way to diagnose this problem?

Re: Api max values (changing 5 min db update)

Posted: Thu Jan 24, 2019 2:10 am
by mchd17
Today is accurate, 30 mph max wind. MT is showing same as meteobridge.

Would love to know why some days are off.....ideas?

Re: Api max values (changing 5 min db update)

Posted: Thu Jan 24, 2019 2:31 am
by mchd17
Here's an example from Jan 18, a few days ago

Meteobridge ss which shows max wind at 2:16 am, notice the value
Image

MT ss, notice the time and value
Image

Here's the MT graph for 2:20 am, which Meteobridge shows the max wind of that day at 15 mph at 2:16 am. Remember, MT uses max values of G for the 5 minutes between 2:15 am and 2:20 am..............
Image

For the above date, MT records max wind, that's even lower than meteobridge max, almost 13 hours after true max wind?

Re: Api max values (changing 5 min db update)

Posted: Sat Jan 26, 2019 7:35 am
by Jachym
Hi,
MT simply uses "what it gets". It cannot make up numbers so if it shows "some numbers" it must have been sent to it by Meteobridge. Also, given you said it "sometimes" works, it means the script is fine. Scripts either work or they dont, If I simplify the update script it takes values sent to it, verifies them and sends them to the database. It does this over and over again so if you say it sometimes works fine, it did the same thing when it didnt work as expected. I therefore suspect the problem must be in what MB sends to MT. You can check this directly if you open
..templateRoot/meteotemplateLive.txt - this is raw data sent by whatever SW you use to the Meteotemplate api, W = wind, G = gust, both should be in km/h, the conversion happens later on the frontend, the API uses fixed units

Re: Api max values (changing 5 min db update)

Posted: Mon Jan 28, 2019 11:38 pm
by mchd17
Changed the api back to 5 minute updates due to the fact that i was still getting false max values at 3 minute database updates. Bothers me MT is not showing correct max values, grrrrrrrrrrr

I will try and keep an eye on ..templateRoot/meteotemplateLive.txt but I have to be home.

Re: Api max values (changing 5 min db update)

Posted: Wed Jan 30, 2019 7:48 pm
by mchd17
Trying 1 minute uploads from MB to MT, and current block interval at 65 seconds. Curious to see if G is then shown correctly. Will report back.

Re: Api max values (changing 5 min db update)

Posted: Wed Jan 30, 2019 8:46 pm
by MonyMony
Curious on this too although in my case I am fighting an upload issue with my provider where not every update from Meteobridge gets through to Meteotemplate (I think they are blocking my frequent connections but won't tell me). As Jachym stated, MT just uses 'what it gets'. I can understand how this might drive you crazy as it is for me too, but at least in my case I have an explination as to why this is happening.

Re: Api max values (changing 5 min db update)

Posted: Thu Jan 31, 2019 11:47 am
by mchd17
G is recording right this morning. Give it a few days and there will be a lower G value in MT than MB. One good thing I have noticed, now on the CC block, is that G is higher than wind more consistently. Still using MB upload at 1 minute, changed CC block to 30 seconds. Within the CC block, I noticed there might be a longer gap than 1 minute update. Might that be the problem......I will keep watching and report back.

Re: Api max values (changing 5 min db update)

Posted: Tue Feb 05, 2019 10:56 pm
by mchd17
So far so good with Meteobridge API updating once a minute. G has been correct every day. I said this in an earlier post, but usually now G is higher than Wind in the CC block. When I was updating at shorter intervals, G was lower than Wind most of the time.. I will report back if I see a difference in MT G to MB wind max.

Re: Api max values (changing 5 min db update)

Posted: Thu Feb 07, 2019 6:29 pm
by mchd17
That's sad.......spoke too soon

MB max G 28 mph at 1217
MT at 1220 db update is 25 mph

Am I the only one using MB that sees these types of G errors?

Re: Api max values (changing 5 min db update)

Posted: Thu Feb 07, 2019 10:52 pm
by mchd17
Higher G value happened later.....which recorded correctly....lol

Re: Api max values (changing 5 min db update)

Posted: Sat Feb 09, 2019 7:56 am
by Jachym
Hi,
update interval is irrelevant. The info I gave to Boris and the response I got back was that the value for G sent to MT should be the max since the last update. I.e. it should be irrelevant if you chose 1min or 5min updates. MB should in that case send 1min or 5min maximum. MT aggregates this and saves to db every min, for G it uses aggregating via maximum.
Eg:
5min updates from MB -> MB should send 5min max and MT saves it
1min updates from MB -> MB should send 1min max and MT caches it 5 times then saves max from the cache every 5mins

Re: Api max values (changing 5 min db update)

Posted: Sat Feb 09, 2019 9:21 am
by stephane01
Same problem here, for example, for today max gust on MB 46.8 km/h at 7:57, on MT 43,7 km/h at 8:00.
All other network I upload show the correct gust (weather34, WD software, WU,...)

Re: Api max values (changing 5 min db update)

Posted: Sat Feb 09, 2019 1:10 pm
by mchd17
Jachym-thanks for the response. I understand how it works. It just doesnt

stephane01-finally another user with same issue. Maybe most people don't see G values of 40, 50, 60 mph due to anemometer height and restrictions close by and don't realize inaccurate data.

I was thinking.......just maybe........its the pause MB does to allow my WeatherLink to contact my Davis logger. stephane01, I see you are running WD. Are you running WD through MB passthrough? Look at your MB system messages, does MB pause briefly for WD to make contact? I wonder if MB sends real time max G values to MT and not recorded max G values for say 5 minute duration.....hmmmmmm......and the pause MB does for WL I don't receive that max G value.