Daily Commute Traffic in Lights!


#4

Replying to my own post! Yep, that’s me.

You know I was thinking about this piston more. You know, it does not even make use of any devices. Other than the ST hub and a cell phone and in my case Alexa, nothing else is needed. No real switches or lights or anything else.

Really shows the flexibility of the Internet of Things in 2018. Google supplies the API and data (free), ST the platform (one time purchase) and the wonderfully powerful, yet fairly easy to use WebCore (free - highly recommend a donation!) for the automation.

Limited use case, but also very low cost assuming you have a phone and a smart speaker already. Really cool!

Take a step back and appreciate, thinking of where this stuff was back in 2000 with X10, etc. :slight_smile:

PS: I am eventually going to attempt to update this piston to use the Origin_Address to be my phone’s current location rather than hard coded office. I think it will be easy, I just need time to play with it. See if location gives me something the Google Maps API will accept as Origin.


#5

@Equis your phone number shows up in the screen shot, I would remove… lol


#6

If you used the webcore presense sensor, and the start location was one of your defined places, maybe you could put that info into the starting_destination variable?


#7

Replying to my own post as well. Webcore presence sensor does include current lat/long. I testing just putting origin address as lat, long, and it worked just fine. So I think you could do this pretty easy. Working on it now.


#8

So, this should work if you want to know how long your commute will be from where you are to Home, like for the one listed above.

Change Origin Address to:
Keep it a string Variable and set the value to
Expression
{[WebcorePresenceSensor :latitude]} ", " {[WebcorePresenceSensor :longitude]}


#9

Thanks again for this awesome idea. I used yours as a foundation for this one.
This will send me a text message if my commute will be heavy. For me I set the time to 30 minutes before I usually leave work. Then I can make sure to bring up waze for my commute home.
I also added one more restriction of a long commute time (2 hours)to cover if I was obviously out of the area. But forgot to turn off the text messages. Would be funny to see your commute will be 8 hours and 45 minutes. :slight_smile:


#10

Nice work, guys. I work from home so I don’t have a commute, but using your current location is a great idea. My wife leaves work to come home at the same time every day, so having a warning doesn’t really help/matter. She’s at the mercy of traffic at that time no matter what. She just follows whatever route Waze takes her. (Don’t think you know better than the GPS with live traffic!) At least in the morning she can leave a bit earlier if she needs to.

If you can poll your current location, I’ve thought it would be handy to trigger other stuff on your way home, too. Like, if my distance to home has been reduced by ‘n’ miles in ‘x’ minutes, it probably means I’m heading toward home and the piston should start warming or cooling the house. When my wife and I are out in the evening, we always forget to hit the “Warm up the house” button when we’re on our way and it only starts warming up once we’re inside the ST home radius.


#11

There is a state for Distance to home in the webcore presence sensor. I believe that if you are moving faster than a specific speed, it updates every 5 minutes. I’m basing that by looking at my smartthings history. If you’re not moving it does not update. I’m sure the distance is as the crow flies but could still be used to do what you’re talking about.

{[Presence - (Webcore) : distance]}


#12

This is awesome. Gonna give it a try and see what happens tomorrow morning.


#13

Only issue I’ve had is that my light does not turn on. I have Hue bulbs. What kind of RGB bulbs do you use? I just went ahead and added a step to turn it on before setting to 100%.


#14

I’m using Osram Lightify RGBW strips under my cabinets.


#15

How many API calls does this make a second (or in your start-stop defined range?)
Google gives you 40,000 element calls per month for free, then you pay a fee.


#16

It only makes a call every 10 minutes for about an hour and a half per weekday.


#17

Your phone number and API is in your piston.


#18

If you are on Android you can use tasker to launch Waze when this piston is true.


#19

If you are on an Android device you can tap into @webCoRE Tasker solution.


#20

Guys, I’m trying to use this to get the time to home minutes but it is always returning Zero and SMS notification also not working. Push notification work with same time as zero.

What did I do wrong. My API not working?


#21

Hi ICUC, not sure if this is the cause of your issue as I just started working on this project as well, but I believe it is because google changed their API query limit to one a day. At least that is what I see when I load the site directly. Maybe someone else with more experience can chime in?


#22

In the time since I created this, Google did start charging for access to the API. You have to associate a payment method to your account, but they have a free tier for some number of requests before they start charging. I currently get charged $.01 per month, but I limit my requests to weekday morning drive time.


#23

I thought of one better which should help avoid the 8hr commute notification. I just don’t know exactly how to do it so I will toss it out in hopes that someone runs with it.

Create a location in Webcore presence sensor for “Work” and have it run this piston when you left work. You’d have to set a time range so its not running when you leave work work but this way it only runs when you leave work and doesn’t when you never went to work.