[RELEASE] DriveTime - Powered by Google Traffic

Amazing.

See v1.1.0 for your request. You can just use the new "go" command to dynamically trigger directions between a provided origin and destination. The Preferences now include a mode of transportation preference.

That work?

Thank you.

I gave a shot with webcore. Distance isn't available to the device. I believe this needs to have a unique name, as 'distance (usc)' fails. Naming issue only?

The rest seems OK =)

Works with lat/long too... Here's a shot from webcore when prefs are saved as "driving...

... And again as walking...

... Which is perfect, although this requires a physical edit of the device between, so I'm not sure if the option can be included as an option in the new 'go' function to save a switch. Although as per usual, I'm just being needy because I can't code at all, I'm afraid.

Finally (and this is a massive push, but would allow some clever dash functionality), I'm not sure if the data's ready there and hidden, but I presume there's a way to expose the url to show the actual route?

For example, if I put this into Google maps...

Summary

It allows me to share directions...

Summary

Shared route
From Polar Bear Music Club, 229 Spring Bank, Hull HU3 1LR to University of Hull via Spring Bank and Chanterlands Ave.

6 min (2.2 mi)
For the best route in current traffic visit https://maps.app.goo.gl/VCC536g1VHyNuLr96?g_st=ac

Which provides a url
hxxps://maps.app.goo.gl/VCC536g1VHyNuLr96?g_st=ac

Summary

Basically, if this info is already included within the hard work of your code, and can be exposed, this could allow for some fairly creative magic to be done. You're looking at potentially a pretty cool way to use your existing work, with @lpakula owntracks code, to be able to dynamically set a navigation route from your current location to the location of say, your child, even if the child is moving.

How cool is that?

/ additional greed

1 Like

Simple enough. Check out V1.2.0 to see if that does what you want. Note that you'll need to make sure your API key has access to the Google Embed Maps API in order for the map to show. See updated install instructions above.

Note: I think the distance wasn't showing up because it was defined as a number but had text in it. I separated out a distance attribute and a distanceStr attribute that should be usable as expected now.

That's brilliant!

I have most of that working now. Amazing.

However, there is one thing missing to complete...

The map is brilliant but I don't use hubitat dashboard.

Clicking this....

Screenshot_20240607-185647_Chrome

... Takes you to this screen...

.. Is there a way of exposing the link itself? I'd like to access this via webcore you see.

Also, the ultimate challenge (but I think this is perhaps outside the scope of this)... Is....

Summary

From that link above, you can hit the start button to enter Google maps navigation. I wonder if its possible to automatically start?

Initially the destination which is set can be gained from your driver. The ultimate situation would be if it were possible, whilst navigation is active, to replace that destination with a new one and then have the navscreen redirect. This could be, for example, if a child tracker (owntracks) is in transit. Currently you'd need to periodically check the current location and replan the destination.

Who fancies a challenge?

Well, the auto-start navigation link is easy (see v1.3.0). But I am skeptical that auto-replacement of the destination mid-navigation is doable, at least from the perspective of this driver. Maybe if you had webcore execute the navigation link upon replacement of the destination? Wonder if that would effectively do what you want?

1 Like

Good idea, and thanQ once again.

I think this could get messy. However, I guess there'd be a botch to flick a switch somewhere to notify via a dash if the new destination has moved more than a certain distance away from the older stored one. You'd then need to click the link to replan. That'd work. I guess this is a bit niche.

It's effectively a way to navigate to a moving target, efficiently.

Hmmmm.............

Hiya, it seems I am dragging others into this.

Apologies, I just think the possibilities for this are pretty prenominal, whilst (almost) using existing processes, combined to make something really cool.

Here's the links you may be interested in (?).

Summary

Variable url on the dash
Url on dashboard - #5 by Darren - SharpTools Community

Also, in relation to this:

I gave it a crack. it doesn't work unless you end the navigation and then start again, as it doesn't see the new destination. Fairly sure you could easily create a link which would automatically end the navigation if active before doing the clever bit you already have working. If so, then some webcore magic would be able to initiate the 'refreshed destination' under certain circumstances, i.e. if the proposed destination is actually remarkably different from the initial values. That's something that could easily be achived outside of your driver, even by someone like me with no coding skills whatsoever.

Hope this makes sense. It would be so cool to bring this all together using your idea here, linked to jpsh's sharptools idea (once hopefully completed as per the other thread), and lp's owntracks. Perfect combination of 3 awesome ideas, linked through webcore or RM to create something very, very clever with a useful child-tracking feature.

This would blow life360 away and bring this all into a grate little ecosystem.

Are you trying on android or iOS? See this re iOS

I'm using android.

*"... On Android, the Google Maps app goes straight into turn-by-turn navigation with directions to the destination... *"

True

*If Google Maps was already open with navigation to a different location, the previous navigation is automatically cancelled and navigation to the new destination is started, all without user input. *
This is exactly the behavior we want... "

Not true. But this would be desirable.

Not sure if something changed over the years.

Must have. Sorry. I don't see a way to do what you want, at least from this driver's perspective.

Cheers.

Is there a way to use the driver to exit nav? If so, I can fudge the rest =)

Not that I know of

1 Like

Well looks like there might be workarounds. I’ll see if I can’t add a stop nav link that uses one of these workarounds so you can try it.

1 Like

I added a stop nav link. But it doesn't work on my iPhone without requiring the user to tap to exit navigation. Not sure it's going to do what you want.

1 Like

I believe the iphones don't work the same way.

I've installed the update, but I don't see the stopNav.

Any ideas please? Thanks again.

-=edit=-

clicked configure - all good

I have this driver setup and polling map information successfully. This might be a silly question but how to make use of this? Is it a push to a device that is registered in Hubitat or is it text to speech over a speaker? Either way might someone possibly post logic they are using in rule machine plz?
Thanks

I display the route info on my dashboard, and send a push notification if the time in traffic delay exceeds a threshold

Might you be able to share your rule machine logic please :pray:? Is it possible to take the information of delay to destination and play it ove text to speech speaker ?

No, sorry, I use the built-in logic of MultiPlace, so no rule machine rules.