updated meteogram block

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

updated meteogram block

Post by davidefa » Fri Apr 09, 2021 10:21 pm

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 )

NOTE
Clear cache after updating parameters.
Attachments
meteogram_3.2d.zip
(719.34 KiB) Downloaded 173 times
meteogram_3.2c.zip
(719.28 KiB) Downloaded 100 times
meteogram_3.2b.zip
(719.13 KiB) Downloaded 109 times
Last edited by davidefa on Wed Apr 28, 2021 5:04 pm, edited 4 times in total.
Image

User avatar
meteolopik
Observer
Observer
Posts: 26
Joined: Tue Jun 04, 2019 11:09 am
Location: Lopik
Station model: Davis Pro 2 Plus
Software: Weather Display
Contact:

Re: updated meteogram block

Post by meteolopik » Mon Apr 12, 2021 10:22 am

Installed latest version and works just perfectly, Much appreciated!
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: updated meteogram block

Post by davidefa » Mon Apr 12, 2021 7:34 pm

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 150 times
Attachments
meteogram_3.3.zip
(719.5 KiB) Downloaded 107 times
meteogram.png
meteogram.png (104.3 KiB) Viewed 6859 times
Image

User avatar
magical46
Observer
Observer
Posts: 49
Joined: Mon Aug 21, 2017 2:19 pm
Location: Farnham, Surrey, UK
Contact:

Re: updated meteogram block

Post by magical46 » Wed Apr 28, 2021 9:07 am

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
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: updated meteogram block

Post by davidefa » Wed Apr 28, 2021 10:58 am

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
Image

User avatar
Meteopomezia
Observer
Observer
Posts: 22
Joined: Wed May 29, 2019 3:44 pm
Location: Pomezia/Italy
Station model: Davis Pro 2
Software: Wview
Contact:

Re: updated meteogram block

Post by Meteopomezia » Tue May 25, 2021 8:17 pm

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

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: updated meteogram block

Post by davidefa » 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
meteogram1.png (104.53 KiB) Viewed 6552 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 6552 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
Image

User avatar
Meteopomezia
Observer
Observer
Posts: 22
Joined: Wed May 29, 2019 3:44 pm
Location: Pomezia/Italy
Station model: Davis Pro 2
Software: Wview
Contact:

Re: updated meteogram block

Post by Meteopomezia » 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

Schermata del 2021-06-01 21-14-17.png
Schermata del 2021-06-01 21-14-17.png (785.19 KiB) Viewed 6494 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

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: updated meteogram block

Post by davidefa » Wed Jun 02, 2021 1:39 pm

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 )
Attachments
meteogram_3.3c.zip
(760.73 KiB) Downloaded 143 times
meteogram_3.3b.zip
(760.73 KiB) Downloaded 85 times
Image

User avatar
Meteopomezia
Observer
Observer
Posts: 22
Joined: Wed May 29, 2019 3:44 pm
Location: Pomezia/Italy
Station model: Davis Pro 2
Software: Wview
Contact:

Re: updated meteogram block

Post by Meteopomezia » Sun Jun 06, 2021 7:43 pm

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 ..

User avatar
Daali
Advisor
Advisor
Posts: 56
Joined: Mon Jul 26, 2021 8:06 pm
Location: Georgia, US
Station model: Ecowitt GW1002
Software: Meteobridge, FOSHKplugin
Contact:

Re: updated meteogram block

Post by Daali » Wed Aug 04, 2021 5:55 pm

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.
https://www.jeffersonweather.com
GW1000 gateway
WS68 Anemometer
WH40 Rain Gauge
WH32 Temp/Hum
WH57 Lightning
WH41 PM2.5 Air Quality
WH45 PM2.5/10/Co2 Air Quality
WN34S Soil temperature
WH31SM Soil Moisture

User avatar
tobydude
Forecaster
Forecaster
Posts: 192
Joined: Sun Jan 07, 2018 6:43 pm
Location: Norway
Station model: Netatmo
Software: Weatherdiaplay
Contact:

Re: updated meteogram block

Post by tobydude » Thu Aug 05, 2021 12:10 pm

Nice.
Just installed.
Is it possible to make the block so that users to change colors on temperature -line, pressure-line , and so on?
:)

User avatar
Daali
Advisor
Advisor
Posts: 56
Joined: Mon Jul 26, 2021 8:06 pm
Location: Georgia, US
Station model: Ecowitt GW1002
Software: Meteobridge, FOSHKplugin
Contact:

Re: updated meteogram block

Post by Daali » Thu Aug 05, 2021 12:46 pm

tobydude,

it must be working since you asked about colors, which version did you select 3.3c?
https://www.jeffersonweather.com
GW1000 gateway
WS68 Anemometer
WH40 Rain Gauge
WH32 Temp/Hum
WH57 Lightning
WH41 PM2.5 Air Quality
WH45 PM2.5/10/Co2 Air Quality
WN34S Soil temperature
WH31SM Soil Moisture

User avatar
tobydude
Forecaster
Forecaster
Posts: 192
Joined: Sun Jan 07, 2018 6:43 pm
Location: Norway
Station model: Netatmo
Software: Weatherdiaplay
Contact:

Re: updated meteogram block

Post by tobydude » Thu Aug 05, 2021 1:04 pm

3d

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: updated meteogram block

Post by davidefa » Thu Aug 05, 2021 1:59 pm

@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 )
Image

User avatar
Daali
Advisor
Advisor
Posts: 56
Joined: Mon Jul 26, 2021 8:06 pm
Location: Georgia, US
Station model: Ecowitt GW1002
Software: Meteobridge, FOSHKplugin
Contact:

Re: updated meteogram block

Post by Daali » Thu Aug 05, 2021 2:29 pm

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!
https://www.jeffersonweather.com
GW1000 gateway
WS68 Anemometer
WH40 Rain Gauge
WH32 Temp/Hum
WH57 Lightning
WH41 PM2.5 Air Quality
WH45 PM2.5/10/Co2 Air Quality
WN34S Soil temperature
WH31SM Soil Moisture

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: updated meteogram block

Post by davidefa » Thu Aug 05, 2021 2:48 pm

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 6221 times
and the result should be similar to this

arcade.png
arcade.png (72.12 KiB) Viewed 6221 times
Image

User avatar
Daali
Advisor
Advisor
Posts: 56
Joined: Mon Jul 26, 2021 8:06 pm
Location: Georgia, US
Station model: Ecowitt GW1002
Software: Meteobridge, FOSHKplugin
Contact:

Re: updated meteogram block

Post by Daali » 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
https://www.jeffersonweather.com
GW1000 gateway
WS68 Anemometer
WH40 Rain Gauge
WH32 Temp/Hum
WH57 Lightning
WH41 PM2.5 Air Quality
WH45 PM2.5/10/Co2 Air Quality
WN34S Soil temperature
WH31SM Soil Moisture

Joesab
Observer
Observer
Posts: 13
Joined: Sat Mar 06, 2021 10:33 am
Station model: Davis Pro V2
Software: weewx
Contact:

Re: updated meteogram block

Post by Joesab » 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 !

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: updated meteogram block

Post by davidefa » Sun Aug 08, 2021 9:00 pm

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
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: updated meteogram block

Post by davidefa » Sun Aug 08, 2021 9:10 pm

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 6182 times
Image

User avatar
Daali
Advisor
Advisor
Posts: 56
Joined: Mon Jul 26, 2021 8:06 pm
Location: Georgia, US
Station model: Ecowitt GW1002
Software: Meteobridge, FOSHKplugin
Contact:

Re: updated meteogram block

Post by Daali » 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!!
https://www.jeffersonweather.com
GW1000 gateway
WS68 Anemometer
WH40 Rain Gauge
WH32 Temp/Hum
WH57 Lightning
WH41 PM2.5 Air Quality
WH45 PM2.5/10/Co2 Air Quality
WN34S Soil temperature
WH31SM Soil Moisture

weatherbee
Observer
Observer
Posts: 15
Joined: Sun Aug 20, 2017 4:35 pm
Location: Sherman Connecticut
Station model: Davis Pro 2
Software: Weather Display
Contact:

Re: updated meteogram block

Post by weatherbee » Mon Aug 09, 2021 4:01 pm

Daali,
Thanks for posting your changes. It fixed mine too.
Tom
Image

User avatar
Daali
Advisor
Advisor
Posts: 56
Joined: Mon Jul 26, 2021 8:06 pm
Location: Georgia, US
Station model: Ecowitt GW1002
Software: Meteobridge, FOSHKplugin
Contact:

Re: updated meteogram block

Post by Daali » Mon Aug 09, 2021 5:19 pm

Awesome! Looking at it I guess it only affected us "imperial" unit guys/gals =P Everyone else was working fine!
https://www.jeffersonweather.com
GW1000 gateway
WS68 Anemometer
WH40 Rain Gauge
WH32 Temp/Hum
WH57 Lightning
WH41 PM2.5 Air Quality
WH45 PM2.5/10/Co2 Air Quality
WN34S Soil temperature
WH31SM Soil Moisture

kd7eir
Advisor
Advisor
Posts: 56
Joined: Sun Aug 20, 2017 2:58 pm
Station model: Ecowitt Wittboy
Software: FOSHKplugin

Re: updated meteogram block

Post by kd7eir » Tue Aug 10, 2021 8:24 am

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!
Image

Post Reply