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 Hubitat.
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 Hubitat 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.
Products Used & Links to Purchase
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.
- Create a Virtual Switch in Hubitat
- Login to the Hubitat Portal @ portal.hubitat.com
- Click on, “Devices”
- Click the “Add Virtual Device” Button
- Device Name: Enter a “Name” for the device, this can be whatever you want
- Device Network ID: Leave whatever is there
- Device Label: You can leave this blank
- Type: Select, "Virtual Switch"
- Zigbee ID: Leave blank
- Click, "Save Device"
- Setup an IFTTT account ( https://ifttt.com/ )
- Figure out your RSS Feed
- Go to: https://alerts.weather.gov/ (RSS Feed for Kalamazoo says it updates every 2-3 minutes -- check your city for speed)
- Click on, "By State/County" (on the left side)
- Scroll down and find your state -- then select the county list
- Find your county and then click on the county code (ie: Kalamazoo, MI is MIC077)
- 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 Hubitat (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.
- Open up your Hubitat Portal and click on, "Apps"
- Click on, "Rule Machine" (if you do not have Rule Machine installed, click on, "Add Built-In App" and search for it)
- Click on, "Create New Rule", name your rule and then click anywhere on the page and other variables will pop up
- Click on, "Select Trigger Events"
- Next click on the, "Select capability for new Event Trigger" drop-down and select, "Switch"
- Now click on the section, "Capability Switch" and select your Virtual Switch that you created
- Click, "Done with this Trigger Event"
- Next click, "Done with Trigger Events"
- Click on, "Select Actions to Run"
- Click on the, "Select Action Type to add" drop-down and click on, "Set Dimmers and Bulbs"
- Under the, "Select Which Action" click on, "Set dimmer level"
- Now click on, "Select dimmer device to set level" and select the bulb(s) and/or light strip(s) you want to turn on
- Enter 100 in the, "> To this level (0.. 100)*" section and then, "Done with this action"
- Again, click on, "Select Action Type to add" and click, "Set Dimmers and Bulbs"
- Under the, "Select Which Action" and click on, "Set color and level"
- Now click on, "Set color for these bulbs" and select the bulb(s) and/or light strip(s) you want to turn on
- Select, "Red" from the drop-down titled, "> Bulb color?"
- Enter 100 in the, "> To this level (0.. 100)*" section and then, "Done with this action"
- Click on, "Done with Actions" and then, "Done"
- Check to see if this works by turning on your virtual switch -- your bulb should turn red.
Now we're going to set an automation to turn off your virtual switch so that it can trigger again if need be.
- Click on, "Rule Machine" (if you do not have Rule Machine installed, click on, "Add Built-In App" and search for it)
- Click on, "Create New Rule", name your rule and then click anywhere on the page and other variables will pop up
- Click on, "Select Trigger Events"
- Next click on the, "Select capability for new Event Trigger" drop-down and select, "Switch"
- Now click on the section, "Capability Switch" and select your Virtual Switch that you created
- Click, "Done with this Trigger Event"
- Next click, "Done with Trigger Events"
- Click on, "Select Actions to Run"
- Click on the, "Select Action Type to add" drop-down and click on, "Control Switches, Push Buttons"
- Under the, "Select Which Action" click on, "Turn switches off"
- Click on the, "Turn switches off" box and select your Virtual switch
- Click on the, "Delay" toggle to turn it on -- enter in 1 under the, "Minutes" section
- Click on, "Done with this action"
- Click on, "Done with Actions" and then, "Done"
- Now your Virtual Switch should turn off 1 minute after it turns on -- this way when the IFTTT Applet fires again, the virtual switch will turn on and thus your bulb/strip will turn on
Setting up the IFTTT Integration
Now that the notification animation is setup, it's time to setup your IFTTT Applet and then connect everything.
- Log into IFTTT and click, "Explore"
- Click on, "Services" at the top right and search for, "Hubitat"
- Click on, "Connect" and then enter in your credentials if prompted
- Select the devices you want IFTTT to be able to see (ie: select when you create an Applet)
- Once completed, you will see that Hubitat is connected
- Now click on, "Create" at the top right
- Click on, "If This (Add)" and search for, "RSS Feed" and select it
- Then click on, "New feed item matches"
- 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")
- 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 )
- Then click on, "Create trigger"
- Then click on, "Then That" and search for, "Hubitat" and select it
- Next click on, "Turn on a device"
- Under the, "Which device?" dropdown, select the Virtual Switch you created
- 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 Hubitat 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%.