[RELEASE] Smart Weather Station Tile Updater and Severe Weather Notifications - Fix Broken Modes and Repeat Notifications

This is a bugfixed and enhanced version of the SmartThings SmartWeather Station Controller SmartApp. This one adds supports for modes, e.g. you can set it to update the SmartWeather Station Tile while only in a specific mode (e.g. Home, Away, Night etc).

The premium version SmartApp has the following additional features

  • Includes a Severe Weather Notification
    • Option to enable or disable repeat notifications
    • Send SMS to multiple numbers
    • Send Push notifications
    • Spoken notifications for supported devices like Sonos, Bose, Alexa, Ikea-Sonos SYMFONISK etc

Check out these other SmartApps

[RELEASE] Door Chimes and Notifications for Doorbells and Sensors

[RELEASE] Security System: Intruder Alert with Actions

The premium app is available on the RBoy Apps Server. Refer to our facebook page below to get access to the server.
If you like the Apps consider supporting our development efforts. Visit our Facebook page for updates on new apps and to get Access to all our Premium ST Apps Server. RBOY APPS SmartThings - Make your Home your Butler

The latest version of these apps with udpates are available on the RBoy server.

/* **DISCLAIMER**
 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * Without limitation of the foregoing, Contributors/Regents expressly does not warrant that:
 * 1. the software will meet your requirements or expectations;
 * 2. the software or the software content will be free of bugs, errors, viruses or other defects;
 * 3. any results, output, or data provided through or generated by the software will be accurate, up-to-date, complete or reliable;
 * 4. the software will be compatible with third party software;
 * 5. any errors in the software will be corrected.
 * The user assumes all responsibility for selecting the software and for the results obtained from the use of the software. The user shall bear the entire risk as to the quality and the performance of the software.
 */ 
 
 /**
 *  Weather Station Controller
 *
 *  Copyright 2014 SmartThings
 *	Bugfixed by RBoy
 *  Version 1.5
 *  2016-2-12 - Changed scheduling API's (hopefully more resilient), added an option for users to specify update interval
 *  2016-1-20 - Kick start timers on sunrise and sunset also
 *  2015-10-4 - Kick start timers on each mode change to prevent them from dying
 *  2015-7-12 - Simplified app, udpates every 5 minutes now (hopefully more reliable)
 *  2015-7-17 - Improved reliability when mode changes
 *	2015-6-6 - Bugfix for timers not scheduling, keep only one timer
 *			 Added support to update multiple devices
 *			 Added support for frequency of updates            
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 */

definition(
    name: "SmartWeather Station Controller",
    namespace: "rboy",
    author: "RBoy",
    description: "Updates SmartWeather Station Tile devices every hour. This contains a bug fix for the updates stops when user select custom modes and it updates every 5 minutes",
    category: "Convenience",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/SafetyAndSecurity/App-MindYourHome.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/SafetyAndSecurity/App-MindYourHome@2x.png"
)

preferences {
    section ("Weather Devices") {
        input name: "weatherDevices", type: "device.smartweatherStationTile", title: "Select Weather Device(s)", description: "Select the Weather Tiles to update", required: true, multiple: true
        input name: "updateInterval", type: "number", title: "Enter update frequency (minutes)", description: "How often do you want to update the weather information", required: true, defaultValue: 5
    }
}

def installed() {
    log.debug "Installed with settings: ${settings}"
    if (updateInterval <= 0) {
    	log.error "Invalid weather update interval $updateInterval minutes. Minimum update interval should be 1 minute"
        sendNotification "Invalid weather update interval $updateInterval minutes. Minimum update interval should be 1 minute"
    }

    initialize()
}

def updated() {
    log.debug "Updated with settings: ${settings}"

    unsubscribe()
    unschedule()
    initialize()
}

def initialize() {
    subscribe(location, modeChangeHandler)
    subscribe(location, "sunset", modeChangeHandler)
    subscribe(location, "sunrise", modeChangeHandler)
    scheduledEvent()
}

def modeChangeHandler(evt) {
    log.debug "Reinitializing refresh timers on mode change notification, new mode $evt.value"
    scheduledEvent()
}

def scheduledEvent() {
    log.trace "Refresh weather, update frequency $updateInterval minutes"
    runIn(updateInterval*60, scheduledEvent)
    weatherDevices.refresh()
}

For more details on SmartWeather Station Tile and Controller see this thread:

To Install the SmartWeather Station Tile and Controller, there are 2 steps:

Step 1: Install the Smart Weather Tile Device from the IDE (kinda silly but that’s the way it is)

  1. Login to https://account.smartthings.com
  2. Go to My Devices tab
  3. Click +New Device button in top right corner
  4. Enter a Name for the device
  5. Enter unique device network id, e.g. WEATHERSTATION1
  6. Select SmartWeather Station Tile from the list in Type*
  7. Select your Location
  8. Select your Hub
  9. Click Create

Step 2:

  1. Create and install the SmartApp given above
  2. If you need installation instructions on how to install a SmartApp you can refer to them here
9 Likes

Fixed an issue with updates stopped working after a few months, added support to select multiple weather tiles to udpate and also added an option to configure the update frequency

4 Likes

Improved scheduler reliability after a mode change

Simplified it further, so some reason SmartThings platform keeps dying on the timers. Now using a different and more reliable method to avoid timer failures. Now it updates every 5 minutes.

Updated to kick start refresh timers on mode change, to workaround the dying timers issues.
Make sure you re initialize the settings after updating the code for it to take effect.

Version 1.4 added kick start based on sunrise and sunset to make it more reliable

Thanks for the update…I’ll take a look at your Facebook page.

Steve

Anywhere in the code where I can change update interval?

I would be interested that option too. Unfortunately, I don’t know how to program in groovy to make the change. I’ve tried to modify the code a couple times but it still updates at 5 minutes or sooner.

Instead of

runEvery5Minutes(scheduledEvent)

use

runIn(60, scheduledEvent)

60 represents the number of seconds. Don’t use less than 60.

And dont forget to open and reinitialize your app once the code has been updated.

Thank you. I know you do this for profit so I GREATLY appreciate these freebies. I’m learning a bit too!

Version 1.5
Added options for users to configure update period in minutes and use new scheduling API’s, hopefully more stable

1 Like

Could you tell me where to find your SmartWeather Tile Controller app?
In the mobile app, the “+>More>Convenience” does not seem to exist anymore…
Am I missing the obvious?

I went to “Connect New Device” --> SmartApps --> More… and I didn’t find your app.

It’s in the first post of this thread. You will need to install it through the IDE interface.

First off, THANK YOU for all of your input, tools and advice! I am a member of your site and rely on your devices a things regularly.

I have researched everything I can find on the weather tile and controller from 2014 to now and cannot seem to find concise instructions for connecting the weather tile to a specific WU PWS.

Thanks again

Thanks for your support.

I did some research on this some time ago. The only way to do that is to write a custom device handler for the weather stations. You can refer to the WU API’s to get started.

https://www.wunderground.com/weather/api/d/docs

Thanks for the info. Keep it up.

Hi… before i spend the $20 i want to make sure i understand what the weather handler does. It will update automatically.without having to be open… correct? Does that include the lux info? Is anyone else using this weather decive as a lux sensor?

Thanks

This app just updates the weather station tile regularly without intervention.

Your question is about if the tile itself reports lux and that depends up on what tile you’re using. The stock tile does report lux but not the real lux, it has a proxy based on weather (see the ST code). There are other custom tiles floating around the forum you can check out, however this app won’t work those tiles as the device type smartWeatherStationTile isn’t natively supported by ST.

In short, if you’re using the stock ST weather station tile this app will keep it updated.

How reliable is the latest v1.5 of the updater? I’ve recently installed it, set to 5min updates - but find it misses updates frequently. It does appear to restart at sunrise, but then stops for hours at a time. I’m running on a v2 hub if that matters any.
thanks!