Need replacement for noaa.gov temperature reading. Solved

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
caz
Level 4
Level 4
Posts: 314
Joined: Mon Dec 31, 2012 6:48 am
Location: England

Need replacement for noaa.gov temperature reading. Solved

Post by caz »

I lost the temperature reading that my conky script shows a few days ago, it's now stuck on zero.

I have been reading a few threads related to the problem and it appears that the weather.noaa.gov site that I use to get the temperature reading has stopped sending out the info.

Here's the section of conkyrc which request the info.

Code: Select all

${voffset 140}${font caviar dreams:size=10}${alignr}HOME${font}
${font caviar dreams:size=12}${color FFFFFF}${alignr}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ EGMC temperature temperature 30} °C${font}


What I was hoping for was the address to another website where I can get the temperature reading from. I have been looking around but haven't found anything yet, or the things that I have found involve adding extra code to conky which will change the look of my setup.

Any help with this is much appreciated.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Some stuff I made using FOSS http://caz747.deviantart.com/
Monsta
Level 10
Level 10
Posts: 3071
Joined: Fri Aug 19, 2011 3:46 am

Re: Need replacement for noaa.gov temperature reading.

Post by Monsta »

Check the text files at http://tgftp.nws.noaa.gov/data/observat ... /stations/.
From your code I assume you're using the station with code EGMC, so that would be EGMC.TXT file in that dir.
caz
Level 4
Level 4
Posts: 314
Joined: Mon Dec 31, 2012 6:48 am
Location: England

Re: Need replacement for noaa.gov temperature reading.

Post by caz »

Thanks for the info Monsta.

I found the text file but to be honest I had no idea what to do with it. It does look as if the temperature info from the noaa.gov website has been suspended. If I start conky from terminal I get a message saying that the server cannot be found.

I have found a replacement after following this tutorial https://bbs.archlinux.org/viewtopic.php?id=37381

Needed to play around with the conkyrc file to place the new temp reading where I wanted it, and for the size and type of font used. All seems to working okay.

I will mark this as solved.
Some stuff I made using FOSS http://caz747.deviantart.com/
Monsta
Level 10
Level 10
Posts: 3071
Joined: Fri Aug 19, 2011 3:46 am

Re: Need replacement for noaa.gov temperature reading. Solved

Post by Monsta »

Oh, I just meant that you could possibly replace http://weather.noaa.gov/pub/data/observations/metar/stations/ with http://tgftp.nws.noaa.gov/data/observations/metar/stations/ in the script (hoping these are the same files as on the old server, with the same format). :)
caz
Level 4
Level 4
Posts: 314
Joined: Mon Dec 31, 2012 6:48 am
Location: England

Re: Need replacement for noaa.gov temperature reading. Solved

Post by caz »

Cheers Monsta for the extra info.

I changed my conkyrc, removed the old noaa address and added the new one. It appears to be a none starter though, starting conky though terminal gives this warning

Code: Select all

conky: could not recognize the weather uri


It was worth having a look at.
Some stuff I made using FOSS http://caz747.deviantart.com/
JohnF76
Level 1
Level 1
Posts: 15
Joined: Tue Sep 25, 2007 11:48 pm

Re: Need replacement for noaa.gov temperature reading. Solved

Post by JohnF76 »

I was able to get it working this way, using this link:

http://ostatic.com/blog/noaa-breaks-wea ... s-valve-20

"
So for the weather app, open the stations file and change the address for your city zone to http://tgftp.nws.noaa.gov/data/observat ... d/XXXX.TXT, where XXXX is your city zone code."

#1) I went to my stations file (in /usr/share/weather-util), and did the following edit. I went to my station, ksch
and changed this

[ksch]
description = Schenectady Airport, NY, United States
location = (0.7478735844795702, -1.2903800936411411)
metar = http://weather.noaa.gov/pub/data/observ ... d/KSCH.TXT
zone = ('nyz049', 0.00056064252466014354)

to this

[ksch]
description = Schenectady Airport, NY, United States
location = (0.7478735844795702, -1.2903800936411411)
metar = http://tgftp.nws.noaa.gov/data/observat ... d/KSCH.TXT
zone = ('nyz049', 0.00056064252466014354)


#2) Went to my .conkyrc file and changed

${font AvantGardeLTMedium:bold:size=10}${color Tan1}Weather ${color slate grey}${hr 2}${font}
${color1}${texeci 7200 weather KSCH.TXT}

to

${font AvantGardeLTMedium:bold:size=10}${color Tan1}Weather ${color slate grey}${hr 2}${font}
${color1}${texeci 7200 weather ksch}

and it worked! Thanks to Monsta, Susan Linton, OMGUBUNTU, and all the other people that worked on this. (note...I see that the metar links are shortened. Just hover over them, or right click and copy them to Text Editor or Xed, and you'll see the full address!)
caz
Level 4
Level 4
Posts: 314
Joined: Mon Dec 31, 2012 6:48 am
Location: England

Re: Need replacement for noaa.gov temperature reading. Solved

Post by caz »

Just as an update to my previous post and the tutorial I used for adding the weather to my conkyrc file.

Well, I was getting a temperature reading but it wasn't for my country or location. I noticed this when conky said it was sunny and 33c but in fact it was cloudy,getting dark and the temp was closer to 23c.

So, it appears that accuweather now gives out a series of numbers for the location code, but these don't appear to work correctly with the script. What is actually needed in the conkyrc file is the old style for the location code, something like this "EUR|UK|UK118|Amersham"

A list of the old style codes can be found here http://stackoverflow.com/questions/1245 ... ccuweather Check out the first answer, it has a link to the codes.


Thanks for the update and tutorial, JohnF76. It doesn't currently work for me as I have no stations file. I guess it's due to me not having the weather app installed. I had a look in synaptic but there are a few weather listings and I wasn't sure which one to install.
Some stuff I made using FOSS http://caz747.deviantart.com/
JohnF76
Level 1
Level 1
Posts: 15
Joined: Tue Sep 25, 2007 11:48 pm

Re: Need replacement for noaa.gov temperature reading. Solved

Post by JohnF76 »

Hi Caz!

From the link https://askubuntu.com/questions/390329/ ... m-terminal

" First you need to install the weather-util package, to do that just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo apt-get install weather-util

You’ll need your local weather code.(Link here http://www.nws.noaa.gov/tg/siteloc.php )
(ugh, don't think that works...try looking here http://weather.rap.ucar.edu/surface/stations.txt and search for Amsterdam on the page. I think it's EHAM)

After installation you can run weather -i <code>. The code you get from the link above."

Here is the Ubuntu page with the weather command options http://manpages.ubuntu.com/manpages/tru ... her.1.html

I edited my Stations file, and manually changed the links to the new URL ( http://tgftp.nws.noaa.gov/data/ ), and also checked them to make sure they worked. Not all of them did (I don't really get marine reports in Schenectady!), and some of them I had to use the Albany info, though they usually ended with a nyz049.txt. In any case, I would work back the URL, then go forward to see what was avaliable.

Once I did this with [ksch], i just copied it to the [12304] section, so now i can run weather ksch and weather 12304. I hope this helps!
caz
Level 4
Level 4
Posts: 314
Joined: Mon Dec 31, 2012 6:48 am
Location: England

Re: Need replacement for noaa.gov temperature reading. Solved

Post by caz »

Hi, JohnF76, and thanks for the info.

I installed the weather-util app. Should have it up and running in conky soon.

Cheers.
Some stuff I made using FOSS http://caz747.deviantart.com/
Locked

Return to “Compiz, Conky, Docks & Widgets”