WUnderground Plugin -- quick and dirty re-write/strip-down

Posted on
Fri Jun 19, 2020 10:40 pm
Tim-n-Leon offline
Posts: 4
Joined: Jun 01, 2018

WUnderground Plugin -- quick and dirty re-write/strip-down

I did a quick and dirty re-write / strip down just to get the functionality that I needed working.
I mainly just need to know the temperature being reported by my PWS so that I can control an outdoor circuit that keeps water from freezing.

I posted the changes over here:

https://github.com/UberEclectic/WUnderg ... n/Contents

Anyone can just install the original plugin and then replace the following two files, locally:

/Library/Application Support/Perceptive Automation/Indigo {version}/Plugins/Wunderground.indigoPlugin/Contents/Info.plist
/Library/Application Support/Perceptive Automation/Indigo {version}/Plugins/Wunderground.indigoPlugin/Contents/Server Plugin/plugin.py

Must also change the "Location" property in the UI to a valid PWS station ID, such as KMIDEARB5 in my example.

Then restart the plugin.

Note, the "Location" property is different from how the field used to be interpreted. You need to drop the "PWS:" prefix and just put a station ID.

You can find station ID's by browsing wunderground.com directly.
Last edited by Tim-n-Leon on Fri Jun 19, 2020 10:46 pm, edited 1 time in total.

Posted on
Fri Jun 19, 2020 10:43 pm
Tim-n-Leon offline
Posts: 4
Joined: Jun 01, 2018

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

Note that there are only two units supported. "Standard" and "Metric" -- I didn't bother to update the config UI. If you pick Standard you get US and if you pick anything else you get Metric.

Posted on
Sat Jun 20, 2020 6:01 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

Glad you were able to find a solution that worked for you.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Jun 20, 2020 9:25 am
Tim-n-Leon offline
Posts: 4
Joined: Jun 01, 2018

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

@DaveL17 as I got super intimate with your code, I came to appreciate all the hard work you had put into it. It's really a shame what's happened to WU since they were acquired. I've been impacted by their incompetence left and right on the PWS side with the constant changes, breaking things left and right, EVEN under their new API. They're the worst. :-(

That said, if I had the motivation it would be possible to bring back a lot of the functionality that you had. Make two calls to the current observations API, one for metric, one for "standard" and combine the results.
It wouldn't be too hard to even merge the "imperial" and "metric" arrays into a single weather_data object, just to avoid having to completely re-architect how you are doing things.
Could switch to the 5-day forecast (instead of the former 10-day) without too much work.
Could add a function to compute the N/S/E/W wind direction from the angle.
The moon phases are still available. Unfortunately, the almanac is not.

Anyway, Kudos for what was obviously a labor of love.
Cheers!

Posted on
Sat Jun 20, 2020 12:21 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

I'd caution against putting a lot of effort in working on anything that works with WU's online API. IBM has said that they're planning to shut it down and were talking about some form of CSV download procedure for PWS owners to get access to their historical data. Of course, they'll still be happy to accept PWS data uploads.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Jun 28, 2022 5:38 am
ParMan offline
Posts: 11
Joined: Feb 15, 2019

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

Hi,
ı just downloaded the last couple of versions of the wonderground plugin - reading the warnings etc.
Does anybody have this working with Wonderground on Indigo 2022.1?
I have a working login to wonderground since long, and just added my new pws and get the data from that uploaded to WU, but just lots of errors from the two WU versions I tried in Indigo.
Is there any life here still? Does the quick and dirty rewrite work?

Thanks

Posted on
Tue Jun 28, 2022 6:46 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

The WUnderground plugin has been EOL'd for some time now. As far as I know, they have shut down their legacy API for downloading data completely, and are only allowing downloads of CSV data (and I believe that feature is only available to those that upload data from their own personal weather stations). I believe--but don't know for certain--that the WUnderStation plugin still works for uploading data to WUnderground. I will not be developing either plugin further, but their codebases are open source (folks are free to fork them and use the code as they wish).

The Fantastic Weather plugin replaced the WUnderground plugin and that has also been EOL'd due to Apple's acquisition of Dark Sky. The Dark Sky API is shut down for new accounts and Apple has said that they will shut down the API completely in March 2023 in favor of WeatherKit. Fantastic Weather is also open source.

WeatherKit will require an API key which can be obtained by purchasing an Apple Developer account (free accounts won't have access to the API) or an API key sourced from some entity that has a paid account. Since I cannot afford to pay for an API key with sufficient API calls to support Indigo users, I will not be developing against WeatherKit. That decision might change if access becomes available later on.

The current recommendation (by me, who wrote the two plugins above) is to find your preferred weather data source and use the GhostXML plugin to get the data into Indigo. If you're in the U.S., there is also the NOAA Weather plugin that ships with Indigo (I have been doing some work on the NOAA plugin lately, as well).

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed Jun 29, 2022 11:15 am
gskarp offline
Posts: 141
Joined: Apr 19, 2012

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

Thanks for the update. The one thing that I am unable to get from the current NOAA plugin is the precipitation forecast. They have that in the NOAA Plus plugin which will not be updated to Python 3, and is not in the regular plugin.I find that information is very helpful when setting irrigation schedules. I looked at the Fluent/WeatherSnoop, but am unsure if that will provide sufficient info on this. Would the GhostXML offer access to the NOAA info? Would love your thoughts.

Posted on
Wed Jun 29, 2022 11:59 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

There are several current options and there are plans to add more features to the built-in NOAA plugin going forward. NOAA has an updated API that provides more information than it used to.

I have kept on with the Fantastic Weather plugin because I have a legacy API key, but have been testing the GhostXML plugin with the Open Weather service which is showing promise. OWS does have pop (probability of precipitation) forecasts. (For us, the local NOAA site is a little too far from where we live.) YMMV, but you might check out Open Weather.

To directly answer your question, the NOAA API returns JSON and works just fine with the GhostXML plugin. However, a quick scan of the API shows that chance of precipitation is within the narrative forecast, but not as a separate element, so that value would have to be parsed from the narrative forecast. (I could be wrong about this last bit, however.)

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Jul 01, 2022 10:42 am
gskarp offline
Posts: 141
Joined: Apr 19, 2012

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

Thanks! I was able to get a feed from OpenWeather to GhostXML. This looks promising. I notice a number of custom states that show "list_" and a number followed by the reading. It looks like there are 40 . Do you know what each List and number state correspond to?

Posted on
Fri Jul 01, 2022 11:05 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

Good deal, glad to hear you were able to get that to work.

The GhostXML plugin is designed to be as agnostic as possible when converting data to device states. If an API node contains data arrayed as a list, it will prepend the word 'list' to the state name. So, for example, all the following data elements pertain to the same day (day 0 which is today):

Code: Select all
     list_0_clouds_all : 100 (integer)
     list_0_clouds_all.ui : 100 (string)
     list_0_dt : 1656698400 (integer)
     list_0_dt.ui : 1656698400 (string)
     list_0_dt_txt : 2022-07-01 18:00:00 (string)
     list_0_dt_txt.ui : 2022-07-01 18:00:00 (string)
     list_0_main_feels_like : 299.13 (real)
     list_0_main_feels_like.ui : 299.13 (string)
     ...
The plugin returns *everything* provided by the API and creates both a data state and a "ui" state (how the data are displayed in the Indigo UI). It's up the the user to convert values to local standard (metric, imperial, etc.). It's been a while since I looked at the raw data from the API, but the above data probably comes in something like this:

Code: Select all
['0': {'dt': 1656698400, 'dt_txt': '2022-07-01 18:00:00', ...}, '1': {'dt': 1656698400, 'dt_txt': '2022-07-02 18:00:00', ...}]

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Jul 01, 2022 11:34 am
gskarp offline
Posts: 141
Joined: Apr 19, 2012

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

Thanks! I actually sussed that out shortly after hitting post. This is great!

Posted on
Fri Jul 01, 2022 1:29 pm
roquej offline
User avatar
Posts: 608
Joined: Jan 04, 2015
Location: South Florida, USA

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

Is there a good mechanism to round values returned by the API beside using variables?

JP


Sent from my iPhone using Tapatalk Pro

Posted on
Fri Jul 01, 2022 1:43 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

Not built into the GhostXML plugin. GhostXML is only designed to get the data into a place that Indigo can see it.

What I do in these circumstances is use the Adapters plugin and then key off that value(s) I need to change. The Adapters plugin has several different (customizable) converters and updates automatically when the source data changes (eliminating the need for separate triggers, etc.)

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Jul 01, 2022 8:30 pm
roquej offline
User avatar
Posts: 608
Joined: Jan 04, 2015
Location: South Florida, USA

Re: WUnderground Plugin -- quick and dirty re-write/strip-d

Ok - thanks


Sent from my iPhone using Tapatalk Pro

Who is online

Users browsing this forum: No registered users and 1 guest