Hi Guys,
I have created a few entities card showing me the details of my tasmota devices (using the tasmota integration).
Now what I want to do is, when I click on the IP here that should take to the IP on the browser. How do I extract the sensor value here
This is what I have tried but this doesn’t seem to work
type: entities
entities:
- entity: sensor.basic_01_ip
tap_action:
action: url
url_path:
value_template: '{{states_attr(''sensor.basic_01_ip'', ''state'')}}'
Rishab
tom_l
December 16, 2020, 1:50pm
2
The URL path will not take a template without using a custom-template card.
See:
Lovelace Templates
I’ve gone and made a crazy card that allows you to pretty much template anything in Lovelace for your card configurations using any information available on the frontend; states, attributes, user, etc.
Want state/attribute-based icons? DONE!
Want dynamic stacks; vertical vs horizontal based on user? DONE!
Want OR conditionals? DONE!
The list is pretty much endless and I’m sure you all will come up with some crazy stuff. Be sure to share.
Go nuts! Enjoy!
Nope still redirects to
http://:8123/lovelace/[object%20Object]
Let me check and get back
tom_l
December 16, 2020, 2:01pm
6
It will end up something like:
url_path: "${this.hass.states['sensor.basic_01_ip'].state}"
I think. It has been ages since I used it.
This is my complete entity card yaml, could you help me fix it here?
Sorry I am still a noob at this.
I did add the config-template-card.js
as a resource
entities:
- entity: sensor.basic_01_ip
tap_action:
action: url
url_path: "${this.hass.states['sensor.basic_01_ip'].state}"
- entity: sensor.basic_01_last_restart_time
- entity: sensor.basic_01_restart_reason
- entity: sensor.basic_01_rssi
- entity: sensor.basic_01_ssid
title: Basic_01
state_color: true
footer:
type: graph
entity: sensor.basic_01_rssi
hours_to_show: 6
detail: 2
show_header_toggle: false
tom_l
December 16, 2020, 2:13pm
8
Look at the example on the github pages. https://github.com/iantrich/config-template-card
You have no card type:
, and no card:
defined.
@rishabmehta7 did you get this working? I am trying to do something similar to create a button that when clicked will open a dinamic google maps link showing the position of a HA entity, but cannot make it work even using the config-template-card
Nope. Abandoned it once the device view came in.
D0doooh
(D0doooh)
October 5, 2023, 12:34pm
11
i am also looking for a solution right now have you found a solution yet?
hello everyone, i’m trying to achieve a dynamic url in mushroom-template-card right now.
type: custom:mushroom-template-card
primary: '{{ states(''sensor.film_01'') }}'
secondary: ''
tap_action:
action: url
url_path: '{{ state_attr(''sensor.film_01'', ''film_url'') }}'
icon: ''
icon_color: ''
fill_container: true
multiline_secondary: true
layout: vertical
badge_icon: ''
double_tap_action:
action: none
hold_action:
action: none
badge_color: ''
picture: '{{ state_attr(''sensor.film_01'', …
D0doooh
(D0doooh)
October 5, 2023, 7:01pm
13
argh very bad… I thought really that must be possible.
Especially it works with images only not with Path URL’s
Yes, after a lot of trial and error I got it working, this is my card (hope it helps):
- type: custom:config-template-card
variables:
- states['person.xxxxxx'].attributes.latitude
- states['person.xxxxxx'].attributes.longitude
entities:
- person.xxxxxx
element:
type: image
entity: person.xxxxxx
image: /local/Floorplan_images/xxxxxx.png
tap_action:
action: url
url_path: >-
${'https://www.google.com/maps?daddr=' + vars[0] +
',' + vars[1]}
The only issue is recently this has stopped working from the mobile app (google maps app is opened but it doesn´t point to the HA person entity). It still works fine from the desktop, I guest something might have changed in the latest android version so the “daddr” parameter doesn´t work from mobile, but haven´t had time to look into it.
EDIT: a quick google search proved me wrong, it seems the daddr parameter has not worked from android in a while (at least from 2017) and the recommended method by google is expained in the link mentione here: android - Google maps does not show route when opened by link - Stack Overflow
Example: Google Maps
So it´s time to update my HA card