Closed SeanPM5 closed 5 years ago
Use any sensor (like sensor.time
) as entity, select a custom icon, select a custom name, and set tap_action
to navigate
.
Use any sensor (like
sensor.time
) as entity, select a custom icon, select a custom name, and settap_action
tonavigate
.
This would be an acceptable workaround for me, but it doesn't appear to work here (unless my code is wrong).
- entity: sensor.time
name: Plex
icon: mdi:plex
tap_action:
action: navigate
navigation_path: "http://127.0.0.1:32400/web/index.html"
When I try clicking/tapping on the icon it does nothing.
Yes. I was wrong. navigate
doesn't work with external urls.
Weblinks do work if you put them as an entity in configuration.yaml. However, they open the detail window first, so you have to click twice. If that could be resolved it would be perfect...
Weblink integration is deprecated as it's an entity that exists purely for UI purposes – it should be done via Lovelace config. So just like Entity card has different row types, glance should have the same.
Ok - I was not aware of that. So then yes, we do need this!
I think adding a url
action is the best and coincidentally easiest solution.
e.g.
tap_action:
action: url
url_path: http://127.0.0.1:32400/web/index.html
This is already how I'm doing it in some custom cards: https://github.com/custom-cards/custom-card-helpers/blob/master/src/handle-click.ts#L55
Currently the glance card seems to support almost everything except weblinks. It's kind of a bummer to have a clean looking glance card, and then you realize you can't put that one final entity inside it cause it's a weblink...
Here is how it could look: Would look identical to the other icons basically, the only difference is that clicking on it would launch the weblink instead of more-info pane. This example doesn't have it, but another idea would be to add "Weblink" or "Link" underneath the icon (as the "state") to make it even more obvious.
There are a number of scenarios where it'd be useful, just a few examples: