Weather Underground Web Smartapp: the "poor guy" weather station with event based switches automation [Deprecated. See Weather Company version below]

Help…New to smartthings and the Groovy programming language. Trying to get the smartapp to trigger some switches when I have a high temperature. Installed smartapp and device handler per instructions. When I try to setup a trigger in the simulator I get a very long string of errors starting with:

grails.validation.ValidationException: Validation Error(s) occurred during save():

  • Field error in object ‘physicalgraph.app.InstalledSmartApp’ on field ‘state’: rejected value [COMPLETE]; codes …

In the phone app I just get an “Error saving page”.

I copy/pasted the code directly from the Github into my smartthings IDE

Any help would be much appreciated.

Check what I have done here and adapt the code to your need: https://github.com/philippeportesppo/AirMentorPro2_SmartThings/tree/master/smartapps/philippeportesppo/iaq-vent.src

You can post your code snippet in a PM to me and I will help you this weekend if you cannot make it by your own

It was a long weekend…I’m not sure what a CO2 vent has to do with a weather underground smart app/device handler. Maybe I’m just confused. Also, I guess I’m too new to smartthings community and I can’t PM you my code. Do you have any other suggestions?

the CO2 bent smartapp shows how to turn on off switch based on event.

I am PM you now. Please reply with your code copy/paste.

Thanks @geoengineer44 for pointing out the issues with the DTH. This has been normally fixed in the latest https://github.com/philippeportesppo/WeatherUndergroundWeb_SmartThings on the master branch.

im using the current (as well as alerrts)conditions, but logging the observation time, i find it going back in time and not updating for ageses. the loging is for “$mymap.current_observation.observation_time”

image
and
image

I know I’m late to the party, but perhaps I am missing something. Where and how do I specify which weather station I want to use? I own two personal weather stations, yet I don’t see how I can force it to use a specific one based on its unique station ID (such as KMDBALTIXXX).

never too late to do good :wink:

Try something like this:
def params = getWeatherFeature(“conditions”,“pws:KNJHGIGHT6”)

That should do the trick :wink:

Thank you for the suggestion. When I tried it, it worked for a bit and then stopped. Everything is blank and nothing refreshes. What I’m trying to do is use my personal weather station (and another outdoor sensor) as devices in my SmartThings account. I want to be able to use them as basic temperature and humidity sensors, which I can implement within automations and routines. Since they are both Ambient Weather brand, I tried another route of using a smart app which a developer made that requires an API and application key. That didn’t work either.

FWIW - WU’s API will be discontinued in Dec. I would not put much effort into it.

I am not sure.

See https://apicommunity.wunderground.com/weatherapi/topics/end-of-service-for-the-weather-underground-api

There seems to be another API to be roll-out for paying customers and we basically are paying customers through the ST API.

So since we go through Smartthings API that relies on the WU service, I am not sure we are going to suffer a disruption. This needs ST to confirm (@Dianoga ??).
After all, we don’t really care ST uses WU or whoever as long as ST provides access to the API.

(Funny fact: if you go to WU right now, you can no longer access the API as before, but using the API hyperlink in ST documentation of the getWeatherFeature, this still go to the right pages.)

This as well will apply since many ST users using the WU API also are WU providers.

“If you are a Personal Weather Station owner, you will receive more information about our plan to offer free access to the data you provide to Weather Underground. We’ll reach out once that plan has been finalized.”

Pretty sure this was not in the first notice I saw (a Reddit link).

I am still little confused. Where do you add this params? DTH or code in SmartApp?

Both or DTH only, it’s up to you:

The smartapp statement is used to name the DTH so that it will appear as “Weather in xxxx”
The default behavior is to use your hub location and I can only find the location by calling it.

In the DTH, it is really used to query the weather conditions.

Hope it helps and please remember that the DTH queries every 10min and using so, I never had a problem of refresh. Querying too often might cause an excess to the limit ST contracted with WU.

Thanks for your prompt reply. I tried to add to either DTH or App code, I still have error. Please see below. In DTH, which line number should I add to?

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
script_dth_metadata_4610f828_c3a1_4355_a67c_ecdb4d5aee08: 17: Invalid variable name. Invalid character at position: 11 of value: ” in name: KCAPASAD23”
. At [17:49] @ line 17, column 49.
therFeature(“conditions”,“pws:KCAPASAD23
^

1 error

I don’t have your code but I suppose that you are not using the right double quotes around the second string or forgot to close the string by one double quote.

For some reasons, copying pasting from this forum leads to incorrect double quotes. you have to ensure you are using " and not the up/down ones.

Question all. Pretty new to this…I’ve added the smartapp and device handler to my IDE and it the app shows in Smartthings, but how do I tell it what city/State to show weather data for?

As said earlier on above posts, it uses the location of your hub by default. You should see the name in the header of the device and in the device list.

check above posts to see how to specify a specific location by having both the 2 calls (in the dth and in the smartapp).

my tweeked version, can set it in settings

1 Like

That’s funny… My first version was simply the DTH with a setting to set the city but then I thought: let’s make it more convenient to install and use the smartapp to set it up, that will avoid support requests later due to typos in the query string. Well…well… well…

Between users having many stations around and want to set up the most accurate one and others using another city station (?), seems the setting is making more and more sense. I might put it back later next year. I saw a github user also asking for some light tuning based on the weather. That will be part of the next updates.