Weather Underground Plugin

Posted on
Mon Mar 20, 2017 5:49 am
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Small feature request

Hi Bleasel - Are you looking for the WUnderstation plugin to track yesterday's precipitation? WU's WUnderstation API doesn't have a field for yesterday's precip.

Code: Select all
rainin - [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min
dailyrainin - [rain inches so far today in local time]

I'd like to keep the plugin API-specific, so I think you have a couple options. If you're using the WUnderstation plugin together with the WUnderground plugin, you can pull yesterday's precip from WUnderground.

You could also create a variable and a couple triggers to track it. Create your variable and then create a trigger to update the variable any time your precip value is greater than the variable value (to get the highest number for the day), then create another trigger to zero out the variable value when it's a new day (say, at 00:00:01, or something like that). You could also do it with a simple Python script which I'd be happy to help you gin up.

If WU ever adds yesterday's precip to the API, I'd be happy to include it.

[Moderator's Note] Moved to the proper thread.

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

[My Plugins] - [My Forums]

Posted on
Mon Mar 20, 2017 6:27 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: Small feature request

Thanks

I was looking here: https://www.wunderground.com/weather/ap ... erday&MR=1

Didn't notice that these are different plugins. The request is for the Weather underground plugin.

[Moderator's Note] Moved to the proper thread.

Posted on
Mon Mar 20, 2017 7:50 pm
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Small feature request

Bleasel wrote:
Thanks

I was looking here: https://www.wunderground.com/weather/ap ... erday&MR=1

Didn't notice that these are different plugins. The request is for the Weather underground plugin.

Thanks for clarifying. The WUnderground plugin has a device state in the WUnderground Weather Device type that tracks yesterday's precipitation. Look for the device state called 'historyPop'. In the control page and trigger menus (etc.), it's called "History - Precipitation". I'll admit that this could be more aptly named and I'll change in the next update.

Please let me know if that will work for you or if you need something else.
Dave

(I moved our posts to the proper forum.)
Attachments
Screen Shot 2017-03-20 at 8.44.09 PM.png
Screen Shot 2017-03-20 at 8.44.09 PM.png (22.05 KiB) Viewed 3871 times

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

[My Plugins] - [My Forums]

Posted on
Mon Mar 20, 2017 8:07 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: Weather Underground Plugin

Thanks for that.

I did look at all the custom state values (when it was raining) and tried to match the value on WU with the custom states. It matched Precipitation today, and Precipitation - I hr, but did not match for yesterday ( I looked at 3 stations nearby that were recording rainfall). Unfortunately it has stopped raining, so all values are now "0".

But it is what I was after. I have now incorporated it in the trigger menus.

Posted on
Mon Mar 20, 2017 8:29 pm
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Weather Underground Plugin

Bleasel wrote:
Thanks for that.

I did look at all the custom state values (when it was raining) and tried to match the value on WU with the custom states. It matched Precipitation today, and Precipitation - I hr, but did not match for yesterday ( I looked at 3 stations nearby that were recording rainfall). Unfortunately it has stopped raining, so all values are now "0".

But it is what I was after. I have now incorporated it in the trigger menus.

Great, thanks for letting me know. In case you're curious, I'm pulling from the history API using yesterday's date. If the value isn't right, I can do some more digging. It could be a problem with my code, or with WU's API.

Please let me know if you see something hinky.
Dave

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

[My Plugins] - [My Forums]

Posted on
Mon Mar 20, 2017 8:31 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: Weather Underground Plugin

Will do. I have created a variable, so I can track whether data is going to that custom state.

Posted on
Tue Mar 21, 2017 1:17 am
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: Weather Underground Plugin

Update.

It is now raining and the state historypop is going up equally with precipitation_today. They were both zero two hrs ago. It is 6pm here. It did not rain yesterday.


Using station INEWSOUT349
Attachments
IMG_0548.PNG
IMG_0548.PNG (442.24 KiB) Viewed 3878 times
WU.tiff
WU.tiff (73.93 KiB) Viewed 3879 times

Posted on
Tue Mar 21, 2017 5:58 am
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Weather Underground Plugin

Bleasel wrote:
Update.

It is now raining and the state historypop is going up equally with precipitation_today. They were both zero two hrs ago. It is 6pm here. It did not rain yesterday.


Using station INEWSOUT349

Confirmed. I'm using the following URL for your station:

Code: Select all
http://api.wunderground.com/api/API_KEY/geolookup/alerts_v11/almanac_v11/astronomy_v11/conditions_v11/forecast_v11/forecast10day_v11/hourly_v11/lang:EN/history_v11_20170320/tide_v11/q/pws:INEWSOUT349.json

For history precip, I'm using: ['history']['dailysummary'][0]['precipm'] (24.4mm)
For today's precip, I'm using: ['current_observation']['precip_today_metric'] (24mm)

Either I've misunderstood the API (quite possible), WU is sending the wrong data via the API (quite possible) or WU has changed the API and didn't tell anyone (also quite possible). I've seen behavior that I expect for the sites that I monitor, but that doesn't mean that something's not wrong. Let me do some more research and get back to you.

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

[My Plugins] - [My Forums]

Posted on
Tue Mar 21, 2017 7:19 am
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: Weather Underground Plugin

Looking at the link I sent a few posts ago: History returns a specified date's data. Could be that that date defaults to today. Whereas use of "yesterday" returns yesterday's data.

Posted on
Tue Mar 21, 2017 3:58 pm
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Weather Underground Plugin

Bleasel wrote:
Looking at the link I sent a few posts ago: History returns a specified date's data. Could be that that date defaults to today. Whereas use of "yesterday" returns yesterday's data.

I pulled the code that generates the history date we're calling and it properly comes up with yesterday's date. I'm going to look at converting that part of the code to the Yesterday API and then I won't have to worry about sending the wrong date anymore. It shouldn't be too heavy of a lift.

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

[My Plugins] - [My Forums]

Posted on
Tue Mar 21, 2017 8:21 pm
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Weather Underground Plugin

Okay, did deeper research on this and my findings agree with yours.

  • History - returns data related to the specified date. Could be any date.
  • Yesterday - returns exactly the same fields as history, but just for yesterday (no date specified).

Both include a daily summary so it won't take any refactoring of the parsing code to make this work (which is nice). I'll work on updating the the URL used to get the data in the first place. Then, any hinkiness will be on WU. :D

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

[My Plugins] - [My Forums]

Posted on
Tue Mar 21, 2017 9:14 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: Weather Underground Plugin

Thanks.

Posted on
Wed Mar 22, 2017 9:24 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: Weather Underground Plugin

Thanks again, the update is displaying yesterday's rainfall correctly.

Posted on
Thu Mar 23, 2017 3:46 am
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Weather Underground Plugin

Excellent. Thanks for reporting back. I'm still at a loss why the history code was working correctly for me and incorrectly for you.

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

[My Plugins] - [My Forums]

Posted on
Sun Apr 16, 2017 6:31 am
Different Computers offline
User avatar
Posts: 2556
Joined: Jan 02, 2016
Location: East Coast

Re: Weather Underground Plugin

Am I missing a new location for downloads? I've re-downloaded it twice now, and I'm getting 1. 004 while the plugin tells me 1.0013 is available.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Page 50 of 56 1 ... 47, 48, 49, 50, 51, 52, 53 ... 56

Who is online

Users browsing this forum: No registered users and 15 guests