Url on dashboard

Hi all.

Sorry, wasn’t sure where to post this.

I’m trying to figure out how to create something on the dash (on my phone) which will open a particular url in chrome when clicked.

The issue is that this url can vary. The actual url will be stored and accessible through webcore. It will frequently change.

I cannot for the life of me figure out how to have a dash button, which will read the new url and use this as a destination.

Any ideas without things getting really messy?

I believe you would have to use Custom Tiles to accomplish it.

Here’s a similar request, but instead of loading the URL as a hyperlink, their URL was pointing to an image they wanted to display:

:link: Embed variable into a URL on Custom Tile - #4 by josh

Here’s a sample Custom Tile to get you started…

:arrow_double_down: Import Dynamic URL (variable) Custom Tile

Thanks josh, that looks like it’s almost there.

I’ve had a play and created a rule, and managed to make progress. I’ve hit a snag.

Here’s the device in hubitat, with the important part circled…

This is the copy of the clipboard if I copy that link:

https://www.google.com/maps/dir/?api=1&dir_action=navigate&origin=6+keel+road%2C+hull&destination=64+inchcliffe+crescent%2C+newcastle+upon+tyne&travelmode=driving

But here’s the contents of the sharptools variable when created from the rule…

I. E

<a href='https://www.google.com/maps/dir/?api=1&dir_action=navigate&origin=6+keel+road%2C+hull&destination=20+keel+road%2C+hull&travelmode=walking'>Start Navigation</a>

… Which fails.

Can you please assist?

My apologies, but I must have read into the title from the Hubitat thread Variable URL on the Dash and when I read that alongside it getting updated in WebCoRE, I interpreted that you meant it was in a Hubitat, WebCoRE, or SharpTools variable.

I suppose “Variable” in the topic title was meant to refer to the “dynamic” nature of how the value changes.

Can you help me better understand the setup?

And have you tried the navigateURL which looks like it might be the string representation of the startNavigationLink and work just fine with this existing tile.

Otherwise, we have a Hubitat HTML Attribute custom tile we put together a while back and I’ve had it in the back of my head to update that to have direct access to thing attributes. So if the update in WebCoRE ultimately writes to the attributes in the device in your screenshot above, then that might also be a good approach.

Thanks for the efforts.

To be clearer, it’s in relation to this thread here:

Summary

[RELEASE] DriveTime - Powered by Google Traffic - Custom Drivers - Hubitat

JustinL developed something quite basic, but pretty fantastic. Here’s a pic of the device screen:

Summary

This means that you can use webcore to set the start location / destination and use google api to plan a route between the two. Expanding on this, this makes it currently possible to use a bit of trickery to pull the lat/long details from owntracks to instantly plan a route between your own current location and the current location of say, your child’s owntracks device location.

Accessing the device direct through hubitat’s ‘devices’ menu shows the screen above. Justin helpfully tweaked it to include a clickable link…

image

… which, when used on a mobile, directly opens and starts google navigation. How cool is that??!!

However, I wished to be able to use that link easily from a dashboard button instead of needing to remote admin, access devices, browse for it, and click the link. Not something which is reasonably doable. A button on a sharptools dash to click, allowing you to instantly navigate to your child’s current location? Amazing.

Hence the request for this.

I did try to pull the values from the device and store in another basic string attribute device. See below, where there’s a temporary sharptools hero attribute tile just for ‘debugging’…

Summary

This successfully shows the actual link that’s required, which for now, I’ve managed to automatically populate to a sharptools variable through sharptools rules, passing to the custom tile you created above, i.e.

Summary

Unfortunately, although the link looks fine (there’s no additional wrapping, to me, it looks perfect, I’m probably completely barking up the wrong tree as the custom tile just fails when clicked.

Here’s the result on a desktop:

Summary

Fully aware this is a long way around and could definitely be better. The long story short comes down to How do I create a button in sharptools which allows me to duplicate the actions of clicking the variable link from the hubitat device circled below?

Hope this makes sense.

You would need to change the target to ‘New Window’

Google blocks embedding their regular pages into another site. You would generally use their Google Maps API if you wanted to integrated Google Maps directly into your site (or SharpTools in this case) which would require a Google API Key.

Opening in a New Window is probably much simpler in this case.

Attributes

In case it helps, the point I was trying to make is that startNavigationLink attribute looked like it was just the navigateURL with the wrapping HTML needed to turn it into an actionable link within a browser.

So in our case since we’re looking for the raw URL, it looks like it was already available from the device as the navigateURL, right? Of course I’m looking at a clipped version, so it’s possible the full URLs are slightly different. :man_shrugging:t2:

That did it. I’m an idiot.