Weather Underground API GONE?

Is https://openweathermap.org/api an alternative?

Anyone found an alternative to WU?
Was a good feature seeing daily temp line on graphs.

https://openweathermap.org/api looks like a good alternative?

Hi,

I have been using https://github.com/Blackpaw/fronius-pvoutput to upload temperature data. I modified the script to only PUSH through the temperature data - I don’t need the Fronius inverter data pushed twice.

Caveat - The script is designed to PULL temperature data from a specified BoM ( Bureau of Meteorology ) weather site - so it’s only useful for people living in Aus. If the NWS or other national weather agencies provide observation data as JSON it can probably be adapted for that country.

1 Like

In addition to the other suggestions for weather data sources, for those in the USA, the National Weather Service actually provides a nice API, with no key required, for fairly detailed data updated hourly in XML format.

This is what I use:

https://w1.weather.gov/xml/current_obs/[StationID].xml

So for example, weather reports from Chicago Midway Airport can be obtained from:

https://w1.weather.gov/xml/current_obs/KMDW.xml

2 Likes

Hey grannos, I’m very new to all this but would love to add BOM data to my system, could you possibly let me know the settings I need to enter?

Hi Robbo19800.

You will need to obtain the PHP script from. You will need your PVOutput API key and to select your most suitable BOM site - make sure that your nearest site includes temperature - my nearest site only include tidal / maritime information. I chose Jandakot W.A.

http://www.bom.gov.au/fwo/IDW60901/IDW60901.94609.json

The fronius.php file and the config.php file [ the one you create with above info ] will need to be placed on a computer that will be able to execute them periodically - I have access to a Linux host which happens to function as a webserver and runs 24 x 4. You could use a RasberryPI or an older Windows PC / laptop so long as it can support PHP.

https://windows.php.net/

I also modified the original fronius.php file to change the ‘user-agent’ string from the PHP default.

The script needs to be scheduled to run periodically. On Linux this is easily achieved using cron. It can be readily scheduled on Windows and OS X as well.

The GitHub page https://github.com/Blackpaw/fronius-pvoutput gives a quite reasonable explanation of what is required. N.B. you don’t need to use any of the Fronius specific stuff in the script IF your Fronius inverter is already configured to PUSH data directly. Of course if you do not have a Fronius inverter you can ignore it too.

My WU went funny a few days ago and stopped reporting for a day but its back up now

Would be nice to have an easy replacment built into pvoutput

Hello B-Man,

Mine temperature and weather stopped working and is still not working.

Be good when a stable alternative is found.

Peter

Hello Grannos,

I have done some mods to the script to make it work without the Fronius stuff by setting the dataManagerIP to “” and adding some additional conditional if’s as I don’t need the Fronius stuff. I am having trouble with the retrieve of the BOM json. What did you do to that part of the script?

How did you change the’user-agent’ string? Can you post your version of the code or the code fragment where the user-agent’ string.

Hi Peter H,

I suspect that someone at BoM may be blocking the default PHP ‘user-agent’ string. When I tried retrieving the JSON file with WGET all was well so I assumed that the User-Agent string might be causing issues.

So after line #50 in fronius.php I added some code to change the User-Agent string. I advised the script’s author at the time. Since adding the User-Agent the script has behaved itself.

// Predeclare our variables
$consumptionEnergyTotal = NULL;
$consumptionPowerLive = NULL;
$inverterVoltageLive = NULL;
$inverterEnergyTotal = NULL;
$inverterPowerLive = NULL;
$temperature = null;

//
// Added $context to get around HTTP request failed! HTTP/1.0 403 Forbidden
//

$context = stream_context_create(
array(
“http” => array(
“header” => “User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36”
)
)
);

As of the 4th of March 2019 anyone with a free account API that does not have a personal weather station attached has had their account manually disabled.

1 Like

yep, the Wunderground API was terminated yesterday. :frowning:

1 Like

So when is PVOutput going to be able to handle the new WU API?

There is no new WU API. The current API from WU will still work if you have a free account AND a personal weather station populating WU. If you only have a free account and an API, this has now been manually disabled by WU due to their new pricing structure…

1 Like

Thanks for the reply. Still confused, by the WU contact person saying I needed to get a new API key even though I have a free account and have a weather station uploading to WU.

It sounded like my current API key was now invalid since they turned off the free accounts.

I do pay WU to keep the ads off my weather station page but I don’t believe that has anything to do with their new income stream from paid API access.

So whats the best fix…

1 Like

I’ve switched to OpenWeatherMap.com. There’s a free signup option with API and it can be used with pvoutput.
The only issue I have with it at the moment is the temperature doesn’t auto upload every 5 minutes, so the trace cycles between the local temperature and my house temperature, but I’m sure there will be a fix for that.

HOW TO GET YOUR WU API KEY WORKING
My WU API key quit working on 3/25/19 at 8:55am. On 3/31/19 I got it to work again. Here’s how;
Log on to your WU page. Upper right corner is “My Profile”. Click on it and a drop-down menu appears. Click on “Member Settings”. A new screen shows up with 5 tabs. The far right tab is labeled, “API KEYS”. Click on it. You will see a box marked “Your API Keys” and it will have dots instead of characters in it. Below this box is a tab marked, “Show Key”. Click on it and you will see the API Key in real numbers and letters instead of dots. There is a button labeled, “Copy To Clipboard”. Press it.
Now go to your PVOutput account where your WU API key is entered. Press the ‘test’ button to the right of the current API Key. A new page will open showing the API Key fails. Replace that API key with this new one. If you compare the current API key you have in your PVO account, you’ll see it’s different than this new one. Again press the ‘test’ button and verify the new API key works.
Once the new API key is entered, be sure the setting right under where you’ve entered your API key is set for “Enabled”. This is “Main Temperature”. You also need to be sure AUTOMATIC UPLOADS section has TEMPERATURE set to “Disabled”.
Within a few minutes, your PVOutput will start posting the temperature provided from WU and your API key associated with your weather station.

1 Like

@skipro3 This should work for anyone that has their own Personal Weather Station (PWS) that is uploading to WU. However anyone without a PWS linked to their login should not be able to get a new API Key.

Thanks for clarifying that - I thought there’s been a change of stance by WU on who can sign in. I keep seeing the occasional ‘how to enable WU API’ messages - not all mention it’s for PWS users only.