How To: Trigger a RGBW Bulb or Strip for Severe Weather | SmartThings

How To: Trigger a RGBW Bulb or Strip for Severe Weather | SmartThings

Please note that this is not meant to be a substitute for alerting you for severe weather warnings. As IFTTT and SmartThings are both cloud based, there may be a delay in your bulb alerting you. As always, if you suspect severe weather, please check your phone and if necessary, take shelter.

Summary (TLDR)

In this article, you can use your RGBW bulb and strips to give you a heads up alert you when there's severe weather in your area. Program the bulbs and light strips around your house to turn red when there's a Tornado Watch, blue when there's a Flash Flood Warning, or white when there's a Winter Weather advisory, etc. This is done via IFTTT (If This Then That) and SmartThings.

How it will work is via an RSS Feed to Weather.gov and when there's a keyword/phrase detected (ie: tornado watch) in that RSS Feed, it will notify SmartThings to turn on your bulb and/or light strip. Then if you want them to be all be synced, we'll setup an automation to do so.

If you'd like to add Smart Switches to this please see our KB article: How To: Trigger a LED Bar Notification for Severe Weather | SmartThings

The following products below can be used in this scenario. Feel free to click on the pictures to be taken to the product page.

Model #'s from left to right: LZW42 (RGBW Bulb), LZW45 (RGBW Light Strip - Coming Soon, Not Shown) 


Pre-Requisites

Before we get into setting up the automation, there are a few things we need to do.
  1. Create a Virtual Switch in SmartThings
    1. Login to the IDE @ https://graph.api.smartthings.com/
    2. Click “My Devices”
    3. Click the “New Device” Button
    4. Name: Enter a “Name” for the device, this can be whatever you want.
    5. Label: Enter a “Label” for the device, this is optional and can be whatever you want.
    6. Zigbee ID: Leave blank
    7. Device Network ID: Enter a “Device Network Id” This can be anything you want. I recommend short and sweet but it cannot duplicate other device ID’s. Lets say it was a virtual switch for your living room fan lights, maybe call it LRVFL01
    8. Type: Select a “Type” from the dropdown, this should be, "Simulated Switch"
    9. Version: Set to Published
    10. Location: Should be your hub location, probably “Home”
    11. Hub: should be your hub name.
    12. Group: Leave blank
    13. Click Create
  2. Setup an IFTTT account (https://ifttt.com/)
  3. Figure out your RSS Feed
    1. Go to:  https://alerts.weather.gov/ (RSS Feed for Kalamazoo says it updates every 2-3 minutes -- check your city for speed)
    2. Click on, "By State/County" (on the left side) 
    3. Scroll down and find your state -- then select the county list
    4. Find your county and then click on the county code (ie: Kalamazoo, MI is MIC077)
    5. The URL is your RSS Feed (ie: Kalamazoo, MI =  https://alerts.weather.gov/cap/wwaatmget.php?x=MIC077&y=1 )


Directions

Now that the pre-reqs are out of the way, let's start setting this automation up. First, we'll setup the virtual switch and RGBW bulb/strip color automation via SmartThings (to use to notify you of inclement weather), then we'll setup IFTTT. In this example, we're going to have your bulb and/or light strip turn red when there's a Tornado Watch.

Setting up the Automation       

The first step is to create the automation that when the virtual switch is turned on via IFTTT, your bulb and/or light strip will turn on (we'll just use the bulb in this example). The reason we have to do this is because there's no built in effect in IFTTT to turn on your bulb to a certain color -- it only has the ability to turn on.            
  1. Open up your SmartThings App
  2. Click on the three lines at the top left of the screen and select, "SmartApps"
  3. SKIP IF YOU HAVE SMART LIGHTING INSTALLED: Then if you haven't installed the Smart Lighting SmartApp, click on the (+) and search for Smart Lighting and select it
  4. Open up your Smart Lighting SmartApp and select, "New Lighting Automation" and fill out the fields as shown below:
    1. Which devices do you want to control = Select your smart bulb(s) and/or light strip
    2. What do you want to do = Turn On & Set Color (ST shows Colour)
    3. Color = Red
    4. Dimmer Level = 100%
    5. Select Trigger = Switch
    6. Which switch? = Select your Virtual Switch
    7. Turn on & set color when = Turned On
    8. Turn off as well = De-select this
Check to see if this works by turning on your virtual switch -- your bulb should turn red.

Setting up the IFTTT Integration

Now that the notification animation is setup, it's time to setup your IFTTT Applet and then connect everything.
  1. Log into IFTTT and click, "Explore"
  2. Click on, "Services" at the top right and search for, "SmartThings"
  3. Click on, "Connect" and then enter in your credentials if prompted
  4. Select the devices you want IFTTT to be able to see (ie: select when you create an Applet)
  5. Once completed, you will see that SmartThings is connected
  6. Now click on, "Create" at the top right
  7. Click on, "If This (Add)" and search for, "RSS Feed" and select it
  8. Then click on, "New feed item matches"
  9. In the text box, "Keyword or simple phrase", type, "Tornado Watch" (NOTE: if you wanted to be notified whenever there's a Tornado Warning and Watch, just type the word, "Tornado")
  10. In the text box, "Feed URL" insert the Weather.gov URL from the Pre-Requisites section (ie: https://alerts.weather.gov/cap/wwaatmget.php?x=MIC077&y=1)
  11. Then click on, "Create trigger"
  12. Then click on, "Then That" and search for, "SmartThings" and select it
  13. Next click on, "Switch on"
  14. Under the, "Which device?" dropdown, select the Virtual Switch you created
  15. Click on, "Create action", "Continue", and then, "Finish"
Now whenever the keyword, "Tornado Watch" is detected in your RSS Feed (via Weather.gov), IFTTT will trigger an Applet which tells SmartThings to turn on your virtual switch and then SmartThings will run the automation we created to turn on your bulb(s) and/or light strip to red at 100%.