Color Changing Smart Weather lamp app

smartapp_alerts
smartapp_weather
smartapp_lighting
weather

(Jkohlen) #21

Awesome fix @jdiben! Thanks for tracking it down. Ive updated the code here: https://github.com/jkohlen/Smart-Weather-Lamp


(Brian Smith) #22

@jkohlen - Might I suggest a version number or version date in the header? That way, people can tell what version they are currently running compared to what you have update to.


#23

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.


(Charity Froggenhall) #24

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?


(Joe DiBenedetto) #25

@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.


(Charity Froggenhall) #26

Thank you! Will give it a try.


(Mike French) #27

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?


(Joe DiBenedetto) #28

@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 http://community.smartthings.com/t/colorcast-color-changing-weather-lamp/13874 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


(Jkohlen) #29

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:

 	//  YELLOW BAD AIR QUALITY
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."
    }
}

#30

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.
Abe


(Joe DiBenedetto) #31

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.


(Charity Froggenhall) #32

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


(Graham S) #33

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
[physicalgraph.device.Device.name.nullable.error.physicalgraph.device.Device.name,physicalgraph.device.
[{0} cannot be null]


(Vagelis F ) #34

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.


(Joe) #35

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?


#36

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


(Shane Schwarzman) #37

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


(Robert) #38

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


(Daniel Consuegra) #39

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?


#40

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!