New App: Travel Time Guru (Beta)

What’s up STs forum! Super excited to share my next smartapp with you! I am in need of some BETA testers for it.

My new app “Travel Time Guru” is a automated alert system for travel time to your workplace. It uses the free version of the Bing Maps API to lookup travel times based on the current traffic conditions. The cool part is you can tell it when you want to arrive at work and the app will automatically calculate how much time you have left until you need to leave to be on time for work. It will check the traffic every 5 minutes until you leave the house at which point you can restrict it from running based on Mode and Presence. (Make sure you setup a restriction)

There are a few caveats though:

  1. Traffic data is not available everywhere. I believe it is available most places but there is a chance it may not be available for you.
  2. Right now it is only for driving directions. BUT transit schedules and times will come at a later date.

How Do I Start?

In order to use the app you need to sign up for a free Bing Maps API key. You can do so at bingmapsportal.com. Follow these steps to get a key:

  1. Go to bingmapsportal.com
  2. Sign up for an account
  3. Once logged in select “My Profile” > “Create or View Keys” > “Click here to create a new key”
  4. Make the key a “Basic” and “Non-Profit” key. (That’s right, you are NOT allowed to profit using this API key.)
  5. It will create a key that you can input into the app.

Then just install the code below as normal.


How well does it work?

This app is in BETA right now. I am going to add a ton more features to it in the future but I want to make sure my logic works and is bullet proof before I do. Please give your recommendations here and I will implement them if possible and if you find any problems with the app please let me know so I can resolve them! :smile:

Right now the app is hard coded with responses that refer to “work”. In an upcoming update the app will be more customizable. I work from home so I am looking for guinea pigs to test this for me so I know the logic is sound.


FAQ

  1. Why did you not use the Google Maps API?

The free version of the Google Maps API does not provide “travel time in traffic” but the Bing Maps API does :smile: If someone is willing to front the $0.50 it takes for each lookup on the Google API then we can use that one :wink: Anyone? :stuck_out_tongue:

  1. Can I get transit times?

Soon


https://github.com/tslagle13/SmartThings/blob/master/smartapps/tslagle13/travel-time-guru.groovy

6 Likes

How about HERE maps? https://developer.here.com/api-explorer#traffic

Thought about this. But the research I did lead me to believe Bing has better real time traffic data.

Fun idea, but seems completely redundant to Google Now (any Android KitKat or above).

Amazon Echo also provides this info upon request.

1 Like

True, but as of now Google Now can’t change hue bulb colors (good for people with hearing loss) or send a spoken notification over Sonos. (alerts you in the shower)

Besides, I just like writing stuff. So why not. :stuck_out_tongue:

10 Likes

I like the way you think, @tslagle13 :smile:

4 Likes

This is cool. It would be great if this can be combined with a “Connected Alarm Clock” . If I can enter the time it takes for me to get ready and leave to work, the app can reverse calculate the time which at I should be waking up and set the alarm dynamically. It could consider traffic at a given time and predict with some level of approximation how it could change in next hour or so… based on which it can calculate what time I should be getting up to reach office in time. May be its far fetched, but thats the true IoT vision… isn’t it?

2 Likes

Don’t want to give away all my secrets… but stay tuned my friend :wink:

2 Likes

I just installed the app…Will keep you posted on how well its working for me. Is it supposed to tell me the current travel time even now? or only in the morning time ? I thought that when I click on the app I am supposed to know the current time…Missing something?

would you integrate with my calendar too, so it’ll set my alarm clock to the earliest meeting I have with traffic calculation and my average showering and washing up time plus average time to dress up my kids. Also if I have flight to catch, could you write something to auto check in for me?

ROFL
:smile:

All hitting the button does is update the current travel time which is displayed in the app. I just pushed a small update too so pull the latest. Fixed a random issue.

So when you wake up tomorrow whatever you have set to “trigger” the app will start the sequence. Then it will send an initial notification followed by notifications based on the settings you setup in the app. Hope that makes sense.

I think I need to add a time restriction as well. So it doesn’t run at 3am or something. Which I’ll do tomorrow :smile:

I see that as “null” minutes after hitting the button. I entered the Bing Key and also checked all other parameters are right. Address is in the format - House#, Street, City ,State [Did not enter zip code]

Is the travel time at the bottom or top of the app? If its at the.bottom then there was a small bug I squashed and you should pull the new code :smile:[quote=“ashutosh1982, post:12, topic:17613”]
House#, Street, City ,State
[/quote]

This should work

Ahh! It was at the bottom … Let me try the new code.

1 Like

Side note, there shouldnt be a comma between the house number and street. That may also give you problems.

It works now…And yes I dont ave a comma, I put one in that example by mistake.
It shows accurate travel time based on how much time it takes for me to go without any traffic… Great Job!!!

1 Like

@tslagle13 :+1: I have installed this SmartThings app and it is working perfectly for travel times. I have it configured to get me to the local airport when I travel. Great idea and I plan to have my Sonos alert me!

BTW: I love the other SmartApps you have developed for home automation. What a find! :gift_heart:

1 Like

The app did not trigger this morning, I wonder why. I checked everything again - It was the latest code, all settings were right, the app was calculating time as well, but I did not recieve any notifications on my VLC player or push notifications…Am I missing something?

What triggers did you set up?

@tslagle13,

When I check the logs, while using the app press trigger in the Smartthings app, I get this error when I press it.

" error
Error creating device: groovyx.net.http.HttpResponseException: Service Unavailable"

If I press it a second time, not long after I pressed it originally I usually do not get this error, and the program seems to running fully.

When it throws the error it is directly after it lists the following

info
    Time Left = 141.0

info
    Time until event = 172.0

I am only using the push notification option since I do not have any Hues or Sonos, though I have an UBI, I may add that to the program once you finalize it…