Ask Alexa - Weather Reports

The Unofficial SmartThings Blog
Jump to: navigation, search

Weather Reports is an extension to Ask Alexa, the popular SmartThings Add in. You must be running Ask Alexa to use Weather Reports. More information about Ask Alexa can be found here: Ask Alexa

While Alexa Enabled Devices can give you weather reports and forecasts natively, you may want to get additional information that is not normally available in Alexa's default weather report. Using these reports, you can get the current weather (including items like UV index and precipitation) along with today's, tonight's or tomorrow's forecast, either individually or all in one report. In addition, you can also find out the sunrise and sunset (or moon rise/set) for the location in your SmartThings account (or optionally, from another zip code you designate). Finally, you can also get the lunar phases and tide information, if you are interested in that data, along with the option of expanding any weather advisories that may occur.

Summary

Weather.png

Category: Ask Alexa Extension - Requires Ask Alexa

Author:Michael Struck --MichaelStruck (talk) 00:01, 1 January 2016 (EST)

ST Community handle: https://community.smartthings.com/users/michaels/activity

Latest Version

The latest version this extension (as of 3/16/18)
Ask Alexa Extensions Area Used Version Location
Weather Report Code SmartThings IDE 1.0.8 https://github.com/MichaelStruck/SmartThingsPublic/blob/master/smartapps/michaelstruck/ask-alexa-weather-report.src/ask-alexa-weather-report.groovy

Ask Alexa Extension Code Installation

To install the extension use the code located here:

   https://github.com/MichaelStruck/SmartThingsPublic/blob/master/smartapps/michaelstruck/ask-alexa-weather-report.src/ask-alexa-weather-report.groovy 

The steps for installation of the extensions are almost exactly the same as Ask_Alexa#Ask_Alexa_Code_Installation:

  • Copy the raw code from the GitHub link above
  • Go to the SmartThings IDE page and log in
  • Click the My SmartApps link
  • Click the +New SmartApp link
  • Click the From Code tab
  • Paste the GitHub code in the open area
  • Click Create from the bottom left corner
  • Save the code using the button in the upper right-hand corner of the page
  • There is no need to do any OAuth settings on extension code.
   Please Note:
   You DO NOT need to publish the extension code; however, there is no harm in doing so. 
   Simply be aware that if you publish it the extension will show up in the 
   SmartThings Marketplace. However, you should NOT install it from there...
   Ask Alexa will utilize this child code from the main (parent) application.

Creating A Weather Report

To begin creating a weather report, find the Ask Alexa Extensions are on the main Ask Alexa menu, then click Weather Reports. You will find a green + sign labeled <<Create A New Weather Report>>. A screen as shown below will open. First, simply input a name, along with assigning any aliases you want to that report.

AAWeatherExt.png

Weather Reporting

Below name input area is <<Weather Reporting>>. This area allows you to set up the weather output to include either the current weather or the weather forecast. Options for each of these areas are outlined below.

Current Weather

While voice reporting is perfect for giving you the details at your house (using your SmartThings sensors), there are limits to what those sensors can give you. For those item, the current weather report will give you more of the detail about your local conditions. This include:

  • Temperature (with conditions like cloudy, sunny, etc)
  • Humidity with wind speeds and barometric pressure
  • Dew point
  • Solar and UV radiation
  • Visibility
  • Precipitation

Weather Forecast Options

In this area you have three options: Today's forecast, tonight's forecast and tomorrow's forecast. Not much to configure on this page, but you can choose any of the three selections (or all of them) and they will play in order from soonest to latest.

Sunrise/Sunset

As the name implies, you can turn on or off the announcement of the sunrise and sunset for the area designated in the zip code area. Please note the reports are day centric. That means if the sun rose at 7am and you run this report at 9am, it will report THAT day's sunrise, not tomorrow's. Same thing with sunset.

Other Weather Information

The lunar rise/set has the same day-centric configuration as the sunrise/sunset. That means if the moon rose at 7pm and you run this report at 9pm, it will report THAT day's moonrise.

Regarding advisories, please see Ask_Alexa#Weather_Reports_and_Advisories for a practical use case that allows for you to break up your forecast and call advisories directly.

Location

   Please Note:
   While a Zip Code is typically needed for weather reporting functions, you can also designate specific 
   weather stations (using the Weather Underground standard) for your reports. This 
   is an undocumented feature, but may give you more specific information that just a zip code. 
   For more information on weather stations, go here [1]
   
   To find another weather station, search for your location/city on https://www.wunderground.com/
   Then click on "change station", and you'll get a map with several nearby stations to choose from.
   The PWS ID is listed in parenthesis next to the location name in the list.


While convenient to call a weather report based on a name you designate, weather reports become even more powerful in other reports or extensions. To add a weather report to a voice report, simple find the <<Include Other Reports>> area in the voice reports area. Then, choose any of the weather reports (or other voice reports) you want to add. For advanced users that would like a weather report at the end of a macro or voice report, simply add the name of the weather report (surrounded by %) to the text fields of any other macro/extension. For example, you could end a good night report with a text field that says:

%forecast% Good Night, sleep well!

This assumes you have a weather report named "Forecast". This would append the report with the "forecast" report, and then say "Good Night, sleep well!"

Another option is to run the Weather Report as part of a group of and Extension Group(see Ask_Alexa_-_Macros#Extension_Group).

Finally, weather reports show up and playable as flash briefings.

Output Options

If you wish to not only output the real time results to Alexa, but to other speakers in the house, and SMS number, or even to a push location you may output the results to the Ask Alexa Message Queues. See Ask_Alexa_-_Message_Queues for more information.

Restrictions

Just like macros, you have the option to restrict when the weather report activates. These include restrictions based on the day of the week, time of day, which mode you are in, whose presence sensors are 'present', which Alexa you are speaking to or which switches are on or off. These restrictions, by themselves, may not be very useful on their own; however, when used with extension groups, the responses can be more 'dynamic', possibly playing different weather reports based on the the day of the week.

AHResitrictions.png

Reminder About Amazon Developer Slots

Please remember ANY changes or additions you make to your Ask Alexa environment should immediately be followed up with running <<Settings>> <<Setup Variables>> in the main Ask Alexa SmartApp. This will allow newly created weather reports to be reflected in the Amazon developer site. See Ask_Alexa#Setup_Variables for more information.