maurizio53
(Maurizio Fabiani)
February 6, 2020, 8:19pm
21
I tried following your example, but cannot get the card visible…
Here it is my code:
- type: custom:config-template-card
card:
type: iframe
aspect_ratio: 100%
url: "${ vars[0] }"
style: |
ha-card {
font-size: 14px;
font-family: 'Georgia';
font-weight: normal;
border: solid 2px var(--primary-color);
}
entities:
- entity: binary_sensor.person_fha_url
name: Fha
- entity: binary_sensor.person_maurizio_url
name: Maurizio
variables:
- states['binary_sensor.person_fha_url'].attribute.url
- states['binary_sensor.person_maurizio_url'].attribute.url
The binary sensors are created and the attributes show the correct position in the map.
Why cannot see the card?
StefanOJ
(Stefan le Roux)
February 6, 2020, 10:06pm
22
Thanks petro, I got it working.
Just a note, it should be states[‘binary_sensor.person_xxx_url’].attributes .url instead of attribute.
I appreciate the help!
StefanOJ
(Stefan le Roux)
February 6, 2020, 10:07pm
23
Change .attribute. to .attributes .
1 Like
petro
(Petro)
February 6, 2020, 10:21pm
24
Thanks for that, i’ll update the post
maurizio53
(Maurizio Fabiani)
February 7, 2020, 10:33am
25
I did the change, but still no iframe showed…
Maybe something wrong in my side about variables?
Do i need to add something in configuration to have the variables?
maurizio53
(Maurizio Fabiani)
February 7, 2020, 7:13pm
27
Here they are @petro :
- platform: template
sensors:
person_fha_url:
value_template: "{{ state_attr('person.fha', 'latitude') and state_attr('person.fha', 'longitude') }}"
attribute_templates:
url: >
{% set lat = state_attr('person.fha', 'latitude') %}
{% set lon = state_attr('person.fha', 'longitude') %}
{% set zoom = 3 %}
https://embed.waze.com/it/iframe?zoom={{ zoom }}&lat={{ lat }}&lon={{ lon }}&pin=1&desc=1" width="600" height="450"
person_maurizio_url:
value_template: "{{ state_attr('person.maurizio', 'latitude') and state_attr('person.maurizio', 'longitude') }}"
attribute_templates:
url: >
{% set lat = state_attr('person.maurizio', 'latitude') %}
{% set lon = state_attr('person.maurizio', 'longitude') %}
{% set zoom = 3 %}
https://embed.waze.com/it/iframe?zoom={{ zoom }}&lat={{ lat }}&lon={{ lon }}&pin=1&desc=1" width="600" height="450"
petro
(Petro)
February 7, 2020, 11:30pm
28
your problem is all that crap at the end of each URL
That’s not part of the URL in the table above. That’s part of the html. Don’t have that in your binary_sensors.
genik
February 9, 2020, 11:06am
29
Hi all!
I have an issue with displaying Waze in Iframe in Google Chrome. There is just an empty space, though Waze is displayed in Iframe in Microsoft Edge. I’ve tried cleaning cache and reset settings in Google Chrome, but it didn’t help.
Could anyone suggest me a solution? Thanks!
maurizio53
(Maurizio Fabiani)
February 10, 2020, 11:54am
30
No way… i put off those entries from the binary sensors, but still getting no card…
EDIT: I discovered if i put this line into the model editor:
value_template: "{{ state_attr('person.fha', 'latitude') and state_attr('person.fha', 'longitude') }}"
I get this:
Why only the longitude attribute is rendered?
That’s why i get no card in the frontend?
How to fix?
petro
(Petro)
February 10, 2020, 1:37pm
31
That has nothing to do with it. What does the url attribute on person_fha_url display?
petro
(Petro)
February 10, 2020, 1:40pm
33
and if you copy and paste the url into a browser, does it work?
petro
(Petro)
February 10, 2020, 1:45pm
35
Then you aren’t properly creating a lovelace iFrame while using the template card.
maurizio53
(Maurizio Fabiani)
February 10, 2020, 1:46pm
36
That’s what i have in the ui-lovelace:
- type: custom:config-template-card
variables:
- states['binary_sensor.person_fha_url'].attributes.url
entities:
- binary_sensor.person_fha_url
card:
type: iframe
url: "${ vars[0] }"
style: |
ha-card {
font-size: 14px;
font-family: 'Georgia';
font-weight: normal;
border: solid 2px var(--primary-color);
}
What’s wrong?
petro
(Petro)
February 10, 2020, 1:51pm
37
Do you have the config-template-card installed?
maurizio53
(Maurizio Fabiani)
February 10, 2020, 1:53pm
38
Yes, of course…
- url: /community_plugin/config-template-card/config-template-card.js
type: module
petro
(Petro)
February 10, 2020, 1:55pm
39
Then it should be working. What is it doing right now? Is it showing the Iframe but not updating?
maurizio53
(Maurizio Fabiani)
February 10, 2020, 1:55pm
40
No, i get NO iframe card.