[RELEASE] Ready For Nature - alert for inclement weather when a door/window is open

smartapp_weather
project_weather

#1

I’m pleased to announce the release of Ready For Nature, my first effort in SmartApp coding. This SmartThings app is a fork of the Ready for Rain app by @imbrian that is currently in the Marketplace, with the following enhancements:

  • An option to check the hourly forecast instead of the whole day forecast, which is useful during days with changeable weather.
  • The ability to send TTS alerts to a configured media speaker (devices with capability.musicPlayer)
  • An option to check and alert on the Air Quality Index via the U.S. EPA AirNow API.
  • An option to check and alert on the pollen index via Pollen.com.

I actually finished the current version in October but wanted to give it a period of real-world testing before announcing the release. It’s been working very well for us over the winter so I’m pretty sure it should work for others without any major issues.

What use is this then?

If you’ve used Ready For Rain before then you probably already have an idea for how this could be useful, and the extra options might be handy for you. My personal use case for this is that it monitors our front door and warns us via a DLNA speaker if we are about to be rained/snowed on as we leave to walk the dog. The air quality and pollen monitoring is also useful to let my my wife knows if she needs to take her inhaler. Alert levels are configurable via standard AQI and pollen count thresholds so you can tailor it to your own level of sensitivity.

Setup

All features including pollen data work out of the box except for air quality index (pollution) data, which requires you to register for a free personal API key from AirNow. Both Pollen and Air Quality features are U.S. only (sorry international users).

Code is linked below, but I recommend using GitHub integration if you can. I also recommend reading the ReadMe file, especially if you want to use the Air Quality feature, as it goes into more detail about where to register for an API key and how to set it up.


#2

Also, if anyone is interested in using the AirNow AQI or pollen data in something like webCoRE, you may be interested in the following virtual DTH projects that expose the data as virtual sensors you can read from:

(Note: you don’t need to install these if you just want to use the above SmartApp.)


(John P. Hoke) #3

@JSchlackman thank you for this … I’ve gone through the install of AirNow and did find some bits in the documentation that need tweaking:

In step 3 in the “My Devices section”

Go to the new device you created SmartThings IDE > My SmartApps > Ready For Nature and click on App Settings in the top right.
Click Settings and paste in your API key in the Value box next to airNowKey

This should read

Go to the new device you created SmartThings IDE > My Devices > and click on edit Preferences in the left hand column towards the bottom.
Click Settings and paste in your API key in the Value box next to airNowKey

Once my undercaffinated brain recalled I installed a DTH not a smartApp all was well. I am still waiting for it to update (I dont use pollster) once it does I will let you know how things went :slight_smile:

Thanks again!

… Pollen Virtual Sensor is next …

EDIT
I have my zipcode and my API Key entered correctly and getting this in my livelogging in the IDE for the AirQuality Device


#4

Zipcode is not required unless you want data for a different zipcode than your default hub location. It should work either with or without it, but maybe try leaving it undefined. If that makes no difference, would you mind letting me know what zipcode you are using? PM me if you don’t want to post it here.

Also, is your API key something other than a bunch of zeroes? I seem to recall the AirNow webpages sometimes showing an API key that is all zeroes, which doesn’t work.


#5

Good spot - that’s what i get for copy & pasting from the SmartApp readme in a hurry. I’ve corrected those steps.


(John P. Hoke) #6

PM Sent - the issue occurs with or without the ZipCode in the settings, and double checked the API Key (Starts with FF)


(John P. Hoke) #7

Pollen Device works … as I assume you are using it primarily in your Nature app it could use some layout love for a stand-alone device type :wink:


#8

Looks like that might be an iOS app issue. It looks fine on my Android device. Not sure what I can do in this case as the formatting is supposed to be handled by the app. :confused:


#9

I replied to your PM as well, but for anyone else experiencing the same, there are some zipcodes for which AirNow does not return any data. I’ve added a note about this to the readme with details of how to test whether your zipcode is served by AirNow. Due to the nature of the reponse, there’s no way for the SmartApp to determine whether the lack of data is due to a temporary problem or because the area is not one they report on, hence the generic error message.

They do state in their FAQ that “forecasts are not necessarily available for all reporting areas”, but I was hoping those areas would be few and far between, and in more rural areas than is apparently the case.


(John P. Hoke) #10

Thanks … I will see what happens using the alternative provided :beer:


#11

The SmartThings Twitter featured an ad that made me smile this morning. I know they’re probably thinking of the marketplace Ready for Rain app that mine is based on, but still…

For anyone interested in smarter pollen/allergen alerts, I recently updated Ready For Nature to allow you to filter alerts based on the ‘Top Allergens’ that Pollen.com lists in its forecasts. So if you are only allergic to specific types of pollen, you can avoid getting pollen index alerts when the current allergens in the air don’t affect you.

To specify what pollen alerts to get, there is a new option in the Ready For Nature configuration where you can type in a keyword to check against the allergens listed in the forecast. In the below example from our house, we’ve entered “Oak” because my wife is allergic to oak pollen. Whatever text you enter will be substring checked (case insensitive) against the allergens list, so if you enter “Maple”, it would match “read maple” and “silver maple”. If you were only allergic to red maple, enter the full string “red maple” and it would ignore “silver maple”.


(JimmyJames) #12

Excellent App. Is it possible to make it send Notifications to certain people though? When I select Send Push Notification there is only Yes and No, so it will push to all users on my account. On other Apps I can select from Family Members on who and who should not receive certain types of messages.


(Orange Scuba) #13

Have you tried sending a text message to a specific number? I think you can add more then one number just by adding a coma at the end of each number. If you only want a push notification and not a text you might want to try creating it using WebCoRE.


#14

I wasn’t aware it was possible to send push notifications to select users yet - the Developer Docs say this ability is coming, but not yet enabled. I’d be happy to implement it if I can figure it out. Can you give me some examples of apps that have this feature? If they have publicly accessible code I should be able to figure out how they achieved it and do something similar.

That wouldn’t have worked when you suggested it, but I just committed a change to Github so it will work now. :grin:


(JimmyJames) #15

I will try the TXT msg thing. Thanks. Here are a couple of apps that can send separate notifications to without having to use WebCore

Device Monitor [RELEASE] Device Monitor - Get Notified if Devices Stop Reporting

Super Notifier is one I use that I can select users in. [RELEASE] Super Notifier - All your alerts in one place!

Also the Notify Me When is another. https://support.smartthings.com/hc/en-us/articles/115000140766-Notify-Me-When-in-SmartThings-Classic

Here’s a couple screenshots from SuperNotifier


#16

This appears to be using the Contact Book feature that the docs say isn’t available. Interesting.

I haven’t enabled this for my account, and given some of the posts I’ve read this evening about how unofficial the support is, I’m not planning to yet. However, the code to use it is pretty straightforward and I’ve committed the changes that should do what you’re looking for. Please give it a try and let me know if it works or not.


#17

I’d chock that up to the docs being old and incomplete. Contact book was phased in I think to everyone’s account more than a year ago. I remember other folks taking about using it before I could, but also remember it being enabled for everyone. Super Notifier is my app, feel free to use the contact book code in there to make yours work (I borrowed it from somewhere myself, mixed in with the docs’ info). We need contact book support in all the smartapps, super nice to just enter the user info once instead of typing it all over the place.