Can Someone Create this with Hue

Can someone create a smartapp that allows one to put in their work address and when they do it lets hue know the traffic on the way to work and when they do the hue turns to green, yellow, red based on the traffic on the way to work. help would be much appreciated.

Ben Fein


Now this is what home automation is supposed to take us to eventually! This might make me get a Hue or a Bloom!

with the mapquest directions API you can get realTime return as a time in seconds for the trip. You could pretty easily build a SmartApp that would request the user to put in the expected travel time and if realTime exceeds the expected travel time then change the color of the Hue. You need to supply the start time of the trip so it can properly calculate.
If I were better with REST calls in groovy I would do it, but I’m a novice at this point.

Does the mapquest API have an “average time” so you could just compare it to that without having to input the expected time? I recall seeing directions on google that say time and time with traffic.

yes you can turn off “traffic influenced routes”
—reading more----

ok WOW! I just was diving into this more and it gets way better folks. By specifying timeType=3 you are giving the “arrive by” time.
So say you start work at 8am, you put that in as your time variable and it gives you a result of when you should leave. This could be epic by flashing your hue bulbs when its time to leave based on traffic. You can also set toleranceBefore and toleranceAfter to give yourself a few minutes leeway. Its also giving you statistical averages based on that time during that day of week if no traffic information is available or its too far in the future. Very cool!

no traffic = flash green @ 7:35
some traffic = flash yellow @ 7:20
tons of traffic = flash red @ 6:45

I suspect the app would have to query the API every minute or so to keep traffic and ETA up to date with traffic conditions.

This is a very interesting idea. I would like to see the app not only for work but for events you put in.

Has anyone figured it out yet? if anyone did please post a link to the source :smile:

Ben Fein

I have code started here.

It requests the time you would like to arrive at work (ie 8AM), and when to start checking for traffic (ie 7AM) and then it logs out the color the hue should change to. I don’t have the actual hue control coded in yet. This is my first SmartApp written from scratch.

Feel free to fork and send pull requests on it! Don’t worry about using my API key. Just dont abuse it.

This looks awesome. How’s the programming going?

Please tell me someone continued developing this.
I would love to have my lights strobe when I need to leave (I don’t have any Hue bulbs but do have z-wave enabled fixtures)

So, I was browsing around and saw this. Did anyone ever finish writing some code for this? I’m logically thinking that there would be an issue if say at 7am the traffic app thinks traffic is good and the system is going to blink green at 7:30… but then suddenly there is an accident or some other issue that causes the leaveby time to become earlier than the current time. this could cause the program to not send a light-blinking alert at all. just wanted to throw that out there…

Can this be used without Hue. I just want to get the traffic report on my phone via ST or Alexa.