Hi,
i use the Meteo-Alarm for Weatheralarms.
I recently saw that all weatheralarms triggered from Meteo are doubled or even three times in the list, as you can see in the Screenshot.
Did someone else saw this behavior?
Greetings Martin
Hi,
i use the Meteo-Alarm for Weatheralarms.
I recently saw that all weatheralarms triggered from Meteo are doubled or even three times in the list, as you can see in the Screenshot.
Did someone else saw this behavior?
Greetings Martin
Hi Nol30dy,
PLEASE always include the link to your website.
Now i had to waste my time to adept a test-site to locate and study your 4 warnings.
This “multiple similar” warnings, normally happens when there are multiple warnings with adjacent time frames.
In your case there are warnings at two adjacent days
So the minimum to show is 2 blocks in the pop-up.
Sadly those warnings were also uploaded twice by GeoSphere Austria / [email protected].
First time <sent>2024-06-27T09:06:27+02:00</sent>
Second time <sent>2024-06-28T09:04:39+02:00</sent>
As there are no unique identifiers the scripts handle them as separate warnings.
Therefor you get 4 blocks instead of 2.
@ ALL
You can check the xml contents of the warning by clicking on the separator line in the pop-up
Hi,
sorry for not including a link to my site. Problem is this site is locked only for our club members. Next time i can give you access if needed
Multiple warnings for multiple days was not my problem, only multiple warnings for the same day with the same event.
With the xmls checked i see now what happens here in austria.
They send 1 message on 27 june → heat warning on 29 june.
They send 2 message on 28 june → heat warning on 29 june.
They send 3 message on 29 june → heat warning on 29 june.
So i get 3 times the same warning for every day, because all messages expire at the same time.
But i think i can do a workaround here. Since every XML of these 3 has a unique
> <web>http://warnungen.zamg.at/html/de/uebermorgen/hitze/at/kaernten/</web>
So i can check if 1 equal 2 and discard 1 same with 3 to 2.
Will update you if it works.
Thanks
Martin
Hello,
i found some time for coding.
Here is my code to captchre multiple entries for Austria.
I added this code to Line 170 in wrnWarningEU-CAP.php
if (!array_key_exists('web', $alert['info'][0]) ) {$cnts['missing']++; continue;} //check if web array exists
else{
if (!array_key_exists('value',$alert['info'][0]['area'][0]['geocode'][0])) {$cnts['missing']++; continue;} //check if geocode array exists
else{
if( $alert['info'][0]['area'][0]['geocode'][0]['value'] == $alarm_area ) { //check if geocode == alarm_area (e.g."AT")
$endofexpireday=strtotime('tomorrow -1sec', $from_l); //calculate the end of the Expireday
$expireTime = new DateTime(); //Generate DateTime Objects for Intervalcalculation
date_timestamp_set($expireTime,$endofexpireday);
$effectiveTime = new DateTime();
date_timestamp_set($effectiveTime,$from_e);
$nowTime = new DateTime();
$diffexpiretoeffective = $expireTime ->diff($effectiveTime); //calculate Difference Expire to Effective
$diffnowtoexpire = $nowTime ->diff($expireTime); //calculate Difference Now to Expire
$diffexpiretoeffectivesec = ($diffexpiretoeffective->days*24*60*60)+($diffexpiretoeffective->h*60*60)+($diffexpiretoeffective->i*60)+$diffexpiretoeffective->s; //Convert Interval to sec
$diffnowtoexpiresec = ($diffnowtoexpire->days*24*60*60)+($diffnowtoexpire->h*60*60)+($diffnowtoexpire->i*60)+$diffnowtoexpire->s; //Convert Interval to sec
$diff = $diffexpiretoeffectivesec-$diffnowtoexpiresec; //Calculate difference
if($diffexpiretoeffectivesec-$diffnowtoexpiresec>24*60*60){$cnts['to-old']++; continue;} //If difference is >1day message is old
}
}
}
Martin