[OBSOLETE] Color Changing Smart Weather lamp app

I would like to try this with some of the Philips Hue light strips. I live in Oklahoma and ever since I was a kid, I wanted to simulate the red alert and yellow alert lights from the Enterprise on Star Trek. I would have them glow yellow for a thunderstorm watch, pulse yellow for a thunderstorm warning, glow red for a tornado watch, and pulse red for a tornado warning.


Awww, I love that idea! Please post a picture if you do it!

My only problem with this great app is that I find it hard to tell the difference between the blue and purple. Or is that just me?

1 Like

@ehnotsomuch - I thought they were very similar too. I changed the value for purple to hueColor = 82. I’m using a Hue Bloom and not the regular Hue bulb. Both produce different colors so you may need to play with that value a bit to get the color you want.

1 Like

Thank you! Will give it a try.

What do you think of adding the ability to make this run at a certain time or a hello home phrase instead of just by motion? Is this something you could throw in?

@jkohlen I made some major changes to the app to better suit my needs. I forked your code on GitHub(I’ve never done that before so I appologize if that wasn’t the right way to do it) with my changes at https://github.com/jdiben/Smart-Weather-Lamp/blob/master/Smart-Weather-Lamp.groovy in case it will benefit you or anyone else. I also created a new topic here at ColorCast - Color Changing Weather Lamp which details the updates I made which include the following major changes

  • You can now select the number of hours that you want to look ahead.
    This means you can install a version of the app for workdays that will
    check the weather for the next 8 hours and let you know if, during those
    8 hours, it is going to be cold, hot, windy, rainy or snowy. You can
    install another instance of the app for the evening, that only looks at
    the next 2 hours. You can select to look ahead from 1-24 hours or just
    check the current conditionsYou can specify the “cold” temperature, the “hot” temperature, and the wind speed to trigger weather events
  • If multiple weather conditions are matched, the lamp will cycle
    through all the applicable weather colors. For instance, if it’s going
    to be cold, windy and snowing, the light will turn on and change from
    blue to yellow to pink.
  • In the event of a weather alert, the light will work as it always does, but all applicable colors will flash
  • Added a page to the app setup that explains the need for a
    forecast.io API key. Included a link to the forecast.io developer
    section and an input for your unique API key.
  • Removed the “pollen” feature.

I welcome any feed back you have

1 Like

Awesome. Cant wait to try it.

Also, in case you want to add, I was in the process of adding smog detection for those living in cities with bad air quality based on EPA’s air quality index API. Code below:

log.debug "Checking Air Quality Index AQI"
Calendar localCalendar = Calendar.getInstance(TimeZone.getDefault());
def year = localCalendar.get(Calendar.YEAR);
def month = localCalendar.get(Calendar.MONTH) +1;
def day = localCalendar.get(Calendar.DAY_OF_MONTH);

log.debug "Alternative date is ${year}-${month}-${day}"
def date = "${year}-${month}-${day}"
httpGet("http://www.airnowapi.org/aq/forecast/latLong/?format=application/json&latitude=$location.latitude&longitude=$location.longitude&date=$date&distance=25&API_KEY=12B8BAE9-BA32-472B-A357-BC864B56AAC1") {response -> 
	if (response.data) {
   		def AQI = response.data.AQI[0]  // A numerical value between 0 and 500. Good = AQI 0-50, Moderate = AQI 51-100; USC 101-150 (unhealthy for sensitive groups); Unhealthy AQI=151-200; Very Unhealthy AQI = 201-300; Hazardous AQI = 301-500
		log.debug "Air Quality Index AQI = ${AQI}"
		if (AQI > 100) { 
    		color = "Yellow" 
	    	log.debug "Air Quality Index greater than 100 (unhealthy air for sensitive groups), setting light to Yellow."
   	}   else {
    	log.debug "HttpGet Response data from air quality API unsuccesful."

Love the app. Fast becoming a family favorite.
Works great with the Philips Hues but can not seem to get to work with LiFx bulbs though.
Using the device type and app from zzarbi for the LiFx.
Thanx for all the hard work from us copy and paste non coders.

1 Like

That’s a great addition. I’ll definitely add it but first I want to create an additional configuration page that will allow users to set their own colors for different events or even to ignore certain events. I’m sure people living in southern California don’t care about snow so they could use pink for something else.


How about an option for high winds/gusts? I’d like to know that before I go bike riding!

Great App. I was using it for a couple of weeks then accidentally uninstalled it when I changed my Hues. Now I receive an error when I try to use it in the Simulator. Using it live with the Android app crashes the app every time. Maybe 1.7.2 is flaky?

If it’s relevant, the app saves and publishes fine but running it in the sim produces the error:

grails.validation.ValidationException: Validation Error(s) occurred during save():
Field error in object ‘physicalgraph.device.Device’ on field ‘name’:
rejected value [null]; codes
[{0} cannot be null]

SoLifx bulbs are not being recognized with firmware 2.0.
I installed Lifx app (Connect)and the corresponding device type but I saw that chendo lifx-http
has currently issues with the new LIFX firmware.

So if anyone has them working can you please elaborate?
Thank you.

I like this app and what it does however I’m looking for an app that the bulbs stay on all the time and change color with Temperature. Does anyone know of any apps like that?

Hi I am not getting the app to work the original I put the api in line 129 and it came up with errors needed zipcode and more. the modified I got it all the way down to line 486 but there was no info there. Can you please give me a angle to go with.

thanks rich

This is a fantastic app I’ll be implementing soon. I think I’ll be using this lighting fixture also.



Will this app work with an Osram lightify RGBW led strip?

I just installed today the first version (or at least the version linked to in the first post) of this app and I can’t get it configured… It crashes the android SmartThings app constantly… Ideas?

IKEA FADA - That’s the same lamp that’s on my list for doing the weather lamp with! :smile:

Good choice - reckon it’ll look great!

hello all,

This is great app!

When the lamp goes one it has a greenish light color? how can i change that ?
also, instead of “warm light” wehn everything is fine, can i chnages it to something else?

All i am asking is where can i change the colors? cani use HEX color codes ?

Will this code work ‘as is’ in the UK or are there lines that will have to be amended?

Just need to go out and buy my Hues and the Ikea lamp.