Page 1 of 3

updated meteogram block

Posted: Fri Apr 09, 2021 10:21 pm
by davidefa
ver 3.2a
Updated the block to support the new api 2.0 of yr.no
Location specification changed: you have to specify latitude, longitude and altitude ( using following format: lat=xxx&lon=yyy&altitude=zzz )
Added option to show forecast with 1h resolution ( 2.5 days ) or 6h resolution ( 10 days ), option 'all' shows a mix of both
Added option to align sun/clouds icons on top of chart or 'along temperature line'

ver 3.2b
- corrected precipitation and icons representation

ver 3.2c
- restored wind speed indication in arrow

ver 3.2d
- time converted in local time ( it was utc )

ver 3.7 2024/12/09
- updated block as tooltip didn't work anymore

NOTE
Clear cache after updating parameters.

Re: updated meteogram block

Posted: Mon Apr 12, 2021 10:22 am
by meteolopik
Installed latest version and works just perfectly, Much appreciated!

Re: updated meteogram block

Posted: Mon Apr 12, 2021 7:34 pm
by davidefa
ver 3.3
This version has a wind speed spline ( with superimposed wind direction arrow )
Height configurable in setup ( as % )

ver 3.3a
Time converted in local time ( it was utc )

meteogram_3.3a.zip
(719.63 KiB) Downloaded 1604 times

Re: updated meteogram block

Posted: Wed Apr 28, 2021 9:07 am
by magical46
Hi, I noticed when using the original meteogram it recently was saying "failed to load data from external source. So I have updated to this latest version, I have put the co-ordinates in as
Farnham,lat=51.2339&lon=-0.7795&altitude=90
however now it is just saying "loading data from external source and whirring away without coming up with any data.
My site is www.philsweather.co.uk
any help much appreciated.
I don't think its connected to this issue but the GFS block is not showing any data either.
Phil

Re: updated meteogram block

Posted: Wed Apr 28, 2021 10:58 am
by davidefa
I see your site is ok now ( when changing block's settings always clear the cache, otherwise you'll continue to see the previously cached data, untill the cache expires, tipicaly 1 hour ).
For the gfs block update to the latest version ( gfs_2.4 ), it should be already fixed

Re: updated meteogram block

Posted: Tue May 25, 2021 8:17 pm
by Meteopomezia
Grande davide ottimo lavoro,
Ti volevo chiedere una cosa,su lato sx del meteogramme non si legge bene che devo modificare? guarda :D
https://www.meteopomezia.it

Poi un ultima cosa anche se e una domanda out,
per avere il template a tutto schermo come il tuo cosa devo modificare? :D :D :D

Re: updated meteogram block

Posted: Wed May 26, 2021 9:23 am
by davidefa
Dove di preciso, a cosa ti riferisci?

P.S.
Mi ci vuole un po' per capire, sarà... a volte l'ultima label della scala velocità si sovrappone con la prima label della scala temperature ( cosa che nella immagine non succede ), intendi questo?
---
P.S. Are you referring to the fact that sometime ( not in the attached image ) the last label of the wind speed scale overlaps with the first label of the temperature scale?

meteogram1.png
meteogram1.png (104.53 KiB) Viewed 74250 times
Per eliminare la scroll bar orizontale ho diminuito la 'custom page width' nel setup iniziale ( oppure puoi modificare la variabile $customMaxWidth intorno alla riga 161 in config.php, che è la stessa cosa ), l'ho diminuita finchè non è scomparsa
---
To remove the horizontal scroll bar I reduced the 'custom page width' in the initial setup ( you can do the exact same thing modifying variable $customMaxWidth near line 161 in config.php ), I reduced till the scroll bar disappeared

pagewitdh.png
pagewitdh.png (104.6 KiB) Viewed 74250 times
To remove the horizontal scroll bar I reduced the 'custom page width' in the initial setup ( you can do the exact same thing modifying variable $customMaxWidth near line 161 in config.php ), I reduced till the scroll bar disappeared

Re: updated meteogram block

Posted: Tue Jun 01, 2021 7:17 pm
by Meteopomezia
davidefa wrote: Wed May 26, 2021 9:23 am Dove di preciso, a cosa ti riferisci?

P.S.
Mi ci vuole un po' per capire, sarà... a volte l'ultima label della scala velocità si sovrappone con la prima label della scala temperature ( cosa che nella immagine non succede ), intendi questo?
---
P.S. Are you referring to the fact that sometime ( not in the attached image ) the last label of the wind speed scale overlaps with the first label of the temperature scale?


meteogram1.png

Per eliminare la scroll bar orizontale ho diminuito la 'custom page width' nel setup iniziale ( oppure puoi modificare la variabile $customMaxWidth intorno alla riga 161 in config.php, che è la stessa cosa ), l'ho diminuita finchè non è scomparsa
---
To remove the horizontal scroll bar I reduced the 'custom page width' in the initial setup ( you can do the exact same thing modifying variable $customMaxWidth near line 161 in config.php ), I reduced till the scroll bar disappeared

Schermata del 2021-06-01 21-14-17.png
Schermata del 2021-06-01 21-14-17.png (785.19 KiB) Viewed 74090 times
To remove the horizontal scroll bar I reduced the 'custom page width' in the initial setup ( you can do the exact same thing modifying variable $customMaxWidth near line 161 in config.php ), I reduced till the scroll bar disappeared
A questo guarda immagine sulla destra

Re: updated meteogram block

Posted: Wed Jun 02, 2021 1:39 pm
by davidefa
ver 3.3b
Minor update: added option to define a separation between Temperature and Wind graphs ( so labels do not overlap )

ver 3.3c
Corrected the offset of the wind arrows ( introduced in ver 3.3b )

Re: updated meteogram block

Posted: Sun Jun 06, 2021 7:43 pm
by Meteopomezia
Meteopomezia wrote: Tue Jun 01, 2021 7:17 pm
davidefa wrote: Wed May 26, 2021 9:23 am Dove di preciso, a cosa ti riferisci?

P.S.
Mi ci vuole un po' per capire, sarà... a volte l'ultima label della scala velocità si sovrappone con la prima label della scala temperature ( cosa che nella immagine non succede ), intendi questo?
---
P.S. Are you referring to the fact that sometime ( not in the attached image ) the last label of the wind speed scale overlaps with the first label of the temperature scale?


meteogram1.png

Per eliminare la scroll bar orizontale ho diminuito la 'custom page width' nel setup iniziale ( oppure puoi modificare la variabile $customMaxWidth intorno alla riga 161 in config.php, che è la stessa cosa ), l'ho diminuita finchè non è scomparsa
---
To remove the horizontal scroll bar I reduced the 'custom page width' in the initial setup ( you can do the exact same thing modifying variable $customMaxWidth near line 161 in config.php ), I reduced till the scroll bar disappeared

pagewitdh.png
To remove the horizontal scroll bar I reduced the 'custom page width' in the initial setup ( you can do the exact same thing modifying variable $customMaxWidth near line 161 in config.php ), I reduced till the scroll bar disappeared
A questo guarda immagine sulla destra
Good evening Davide solved the problem of the display on the right side.
at line 323 increased marginRight: from 40 to 50 and now it looks good ..

Re: updated meteogram block

Posted: Wed Aug 04, 2021 5:55 pm
by Daali
I've gone thru and verified the url's in the browser
https://api.met.no/weatherapi/locationf ... titude=267
but debugging(always tough with php) it looks like this like does not populate with the '.$meteogramIDs[$locationID] which I can see has data in the variable $meteogramLocations but gets lost in the explode(maybe a debug issue on my part)

Code: Select all

$yrNoLocation = 'https://api.met.no/weatherapi/locationforecast/2.0/compact?'.$meteogramIDs[$locationID][1];
Is the meteogram working for everyone else? There may be something else wrong in my config or settings throwing it off.

Re: updated meteogram block

Posted: Thu Aug 05, 2021 12:10 pm
by tobydude
Nice.
Just installed.
Is it possible to make the block so that users to change colors on temperature -line, pressure-line , and so on?
:)

Re: updated meteogram block

Posted: Thu Aug 05, 2021 12:46 pm
by Daali
tobydude,

it must be working since you asked about colors, which version did you select 3.3c?

Re: updated meteogram block

Posted: Thu Aug 05, 2021 1:04 pm
by tobydude
3d

Re: updated meteogram block

Posted: Thu Aug 05, 2021 1:59 pm
by davidefa
@tobydude
Ok, I'll add color selection

@daali
This is my setting

Code: Select all

Fano-Italy,lat=43.84052&lon=13.01665&altitude=12
note the comma between the location name and the coordinates ( without any spaces leading/trailing/between )
Could you check if it works for you or please post your configuration ( so I can check )

I'm using ver 3.3c ( the difference between ver 3.2 and ver 3.3 is the arrow wind position )

Re: updated meteogram block

Posted: Thu Aug 05, 2021 2:29 pm
by Daali
Arcade,lat=34.07789&lon=-83.56155&altitude=267 is mine that just spins. Using your data just spins as well.

I'll purged the block directory, re-downloaded 3.3c, and tried again. still no luck with your settings. I wonder if my system using https is affecting it.

Thanks guys!

Re: updated meteogram block

Posted: Thu Aug 05, 2021 2:48 pm
by davidefa
Forgot to mention to clear cache after modifying the settings ( or you'll continue to see the previously cached data until cache expires, generally 1h, giving you the impression that every change you make has no result )

Your settings should be similar to this
meteogram2.png
meteogram2.png (112.06 KiB) Viewed 73919 times
and the result should be similar to this

arcade.png
arcade.png (72.12 KiB) Viewed 73919 times

Re: updated meteogram block

Posted: Thu Aug 05, 2021 2:54 pm
by Daali
do you mean browser cache or the cache directory? nothing is populating in my cache directory of the block

I've verified the meteogram/cache folder is set to 755, still, nothing populates there.

My issue has to be something host-related, something simple. I've reset the folder to 0705(like others in the working block section), checked the owner. dataloader never populates the cache.

*went all the way back to original in thread: no data
*hacked up dataloader.php to be single site with no cache logic, pulled data! so Curl works.
*went back to original in thread: no data.
*reverted to http (from https): no data
*called dataloader (dataLoader.php?callback=?) and at least got 400 bad request
*called dataloader (https://www.jeffersonweather.com/homepa ... ack=?&id=0) and got data back.
*changed from http to https, called dataloader
(https://www.jeffersonweather.com/homepa ... ack=?&id=0) and got data back.

I cannot really debug it on the hosted server, it has to be something silly, just doesn't seem like the parameters are being passed to dataloader.php

Re: updated meteogram block

Posted: Sun Aug 08, 2021 2:35 pm
by Joesab
bonjour à tous
gfs fonctionne
par contre meteogramme non,
je ne comprends pas ce qu'il faut que je rentres comme ligne de paramétrage... :cry:

merci pour les explications
sabine

édit : c'est ok, ça marche

merci pour le boulot que vous faites !

Re: updated meteogram block

Posted: Sun Aug 08, 2021 9:00 pm
by davidefa
Joesab wrote: Sun Aug 08, 2021 2:35 pm bonjour à tous
gfs fonctionne
par contre meteogramme non,
je ne comprends pas ce qu'il faut que je rentres comme ligne de paramétrage... :cry:

merci pour les explications
sabine

édit : c'est ok, ça marche

merci pour le boulot que vous faites !
You should enter something like this: Bailleval,lat=49.34976&lon=2.44068&altitude=156

Re: updated meteogram block

Posted: Sun Aug 08, 2021 9:10 pm
by davidefa
Daali wrote: Thu Aug 05, 2021 2:54 pm do you mean browser cache or the cache directory? nothing is populating in my cache directory of the block

I've verified the meteogram/cache folder is set to 755, still, nothing populates there.

My issue has to be something host-related, something simple. I've reset the folder to 0705(like others in the working block section), checked the owner. dataloader never populates the cache.

*went all the way back to original in thread: no data
*hacked up dataloader.php to be single site with no cache logic, pulled data! so Curl works.
*went back to original in thread: no data.
*reverted to http (from https): no data
*called dataloader (dataLoader.php?callback=?) and at least got 400 bad request
*called dataloader (https://www.jeffersonweather.com/homepa ... ack=?&id=0) and got data back.
*changed from http to https, called dataloader
(https://www.jeffersonweather.com/homepa ... ack=?&id=0) and got data back.

I cannot really debug it on the hosted server, it has to be something silly, just doesn't seem like the parameters are being passed to dataloader.php
In the firefox error console there is an error when the block is loaded.
Not sure how to debug this, but you may try to move the block outside the menuBlock of meteotemplate, and see if something change ( or at least a more meaningful error is returned )
meteogram3.png
meteogram3.png (289.91 KiB) Viewed 73880 times

Re: updated meteogram block

Posted: Mon Aug 09, 2021 12:07 am
by Daali
Thank you davidfa, but I probably caused that error while hacking away at it.

I've reverted back to your latest 3.3c. and you have led me to a new debugging path!

Found 3 missing "(" and ")" that were causing me issues in the math.round sections

original line 658:

Code: Select all

echo "y: Math.round(element.data.next_6_hours.details.precipitation_amount)*0.0393701*100)/100";
changed line 658

Code: Select all

echo "y: Math.round(((element.data.next_6_hours.details.precipitation_amount)*0.0393701*100)/100)";
original line 675:

Code: Select all

echo "y: Math.round(element.data.next_1_hours.details.precipitation_amount)*0.0393701*100)/100";
changed line 675:

Code: Select all

echo "y: Math.round(((element.data.next_1_hours.details.precipitation_amount)*0.0393701*100)/100)";
original line 713:

Code: Select all

echo "y: Math.round(parseFloat(element.data.instant.details.air_pressure_at_sea_level)*0.0295299830714*100)/100";
changed line 713:

Code: Select all

echo "y: Math.round((parseFloat(element.data.instant.details.air_pressure_at_sea_level)*0.0295299830714*100)/100)";
image loads! hurray!!

Re: updated meteogram block

Posted: Mon Aug 09, 2021 4:01 pm
by weatherbee
Daali,
Thanks for posting your changes. It fixed mine too.
Tom

Re: updated meteogram block

Posted: Mon Aug 09, 2021 5:19 pm
by Daali
Awesome! Looking at it I guess it only affected us "imperial" unit guys/gals =P Everyone else was working fine!

Re: updated meteogram block

Posted: Tue Aug 10, 2021 8:24 am
by kd7eir
Daali wrote: Mon Aug 09, 2021 12:07 am Thank you davidfa, but I probably caused that error while hacking away at it.

I've reverted back to your latest 3.3c. and you have led me to a new debugging path!

Found 3 missing "(" and ")" that were causing me issues in the math.round sections

original line 658:

Code: Select all

echo "y: Math.round(element.data.next_6_hours.details.precipitation_amount)*0.0393701*100)/100";
changed line 658

Code: Select all

echo "y: Math.round(((element.data.next_6_hours.details.precipitation_amount)*0.0393701*100)/100)";
original line 675:

Code: Select all

echo "y: Math.round(element.data.next_1_hours.details.precipitation_amount)*0.0393701*100)/100";
changed line 675:

Code: Select all

echo "y: Math.round(((element.data.next_1_hours.details.precipitation_amount)*0.0393701*100)/100)";
original line 713:

Code: Select all

echo "y: Math.round(parseFloat(element.data.instant.details.air_pressure_at_sea_level)*0.0295299830714*100)/100";
changed line 713:

Code: Select all

echo "y: Math.round((parseFloat(element.data.instant.details.air_pressure_at_sea_level)*0.0295299830714*100)/100)";
image loads! hurray!!
This fixed the block for me, thank you!