magiva
(Magiva)
May 20, 2022, 10:21am
1
Does anyone know how to make iframe with a dynamic (templated) url ?
I did my card like this and included he elements i needed
type: iframe
url: >-
https://embed.waze.com/iframe?zoom=14&lat={{state_attr('sensor.geocode_destination','latitude')}}&lon={{state_attr('sensor.geocode_destination','longitude')}}&pin=1&desc=1
aspect_ratio: 50%
If i run this through template, it equates to the correct address (verified) but the card displays a blank map
Webpage Card ’s url
is not templatable.
Initially, I thought it might be possible to put an <iframe>
in a markdown card, but it seems to just render it as text (probably for security reasons).
I think you might have to look for a custom card to do this. I’ve found Lovelace card-templater card (Jinja2 card templating in Lovelace!) , but I haven’t tested it myself.
3 Likes
magiva
(Magiva)
May 23, 2022, 8:14am
3
type: custom:card-templater
card:
type: iframe
url_template: >-
https://embed.waze.com/iframe?zoom=14&lat={{state_attr('sensor.geocode_destination','latitude')}}&lon={{state_attr('sensor.geocode_destination','longitude')}}&pin=1&desc=1
aspect_ratio: 50%
entities:
- entity: sensor.geocode_destination
genius!
i initially didnt think it was working because the edit page preview didnt render it. But upon save, it worked a treat.
really appreciate you taking the time to answer.
3 Likes
danupshaw
(Dan Upshaw)
May 23, 2025, 7:34pm
4
3 years later, but just wanted you both to know, this was EXTREMELY helpful to me! What a great community. Thank you for sharing. @magiva @ondras12345