1st post ā link at the bottom titled āfantasticā ā auto-entities
Thanks for the indeed fantastic collection of references. I went through it and found similar posts. I edited my template and changed it to this:
type: custom:auto-entities
card:
type: entities
title: Critical Battery Status
filter:
template: >
{% for entity in states.sensor if entity.attributes.device_class ==
'battery' and area_name(entity.entity_id) and entity.state|float < 60 %}
{{
{
'entity': entity.entity_id,
'secondary_info': 'last-changed',
'card_mod': {
'style': {
'.': '.ha-card { --paper-item-icon-color: red; }',
}
}
}
}},
{% endfor %}
The icon is still in HA-blue and not getting recolored to red.
Means - this is what you expect, right?
type: entities
title: ...
entities:
- entity: xxx
secondary_info: last-changed
card_mod:
style: |
.ha-card { --paper-item-icon-color: red; }
But the style is wrong, can you see ?)
Unrelated to card-mod:
- Use ādefaultā:
entity.state|float(default=0)
- Should be properly converted to a list - use ā-ā:
... < 60 -%}
...
{%- endfor %}
Besides, what a reason to use āāpaper-item-icon-colorā if all battery-level sensors have colored icons by default? Probably listing problematic entities (< 60%) would be enough. Just add
sort:
method: state
numeric: true
on a auto-entities-card level, not on filter level.
Hello
I just started playing with card_mod for glance card.
I was able to :
- resize the card height
- resize the font size
But iād like to center the text and strangely the area where the text is do not follow the card size
let me explain with image :
font size 30px
font size 80px
Iād like the text to be big and to occupies the whole space, does anyone know how ?
Heās the yaml
show_name: false
show_icon: false
show_state: true
type: glance
entities:
- entity: sensor.poele_on_last_fill_2
card_mod:
style: |
:host {
font-size: 80px;
height: 69px;
}
thx a lot
I tried playing with the Wrapped value example, but I cant get it to work
Ps : glance is not an obligation, i just want the visual, but glance is the one I reached the closest to my needs.
There are examples for Glance, you have already been advised.
yep, thx a lot for that, but I donāt understand how to get it to work.
If you could point me to the right direction that would be lovely
Take any example for Glance card & start playing)
didnāt think off that !
thx a lot
Can someone please help me? I have a camera that has a double feed because it has a stable camera and a rotating one. However the feed comes out as one video. How can I use card-mod to crop the upper half of the image?
Please elaborate. Attaching a picture would be useful.
Good evening,
Iāve read Ildarās posts, and tried the tricks for getting iframes to resize. I have a card, weather-radar-card. While itās no longer maintained, it works for now, and I like it better than some less interaction ideas like grabbing animated GIFs from the NWS or embedding their radar page on my dashboards.
Thing is, I cannot figure out how to control the height of this card. I saw elsewhere in this thread (from searching) that itās not possible to ābreak intoā iframes, for security reasons, but it seems like there should be a way to control the height of this card through the tricks for iframes that already exist.
The āthreadā that I tried, but could not make work, was:
card_mod:
style: |
style: |
div#mapid iframe {
transform: scale({{states("NUMBERS")|float / 100|float}});
transform-origin: 0 0;
width: 100000px;
height: 100000px;
}
Where NUMBERS is where I tried lots of values, none of them changed the output at all. It MUST be possible to force this card to be an arbitrary width / height; I just want it to be wider than it is tall.
[sneaky edit]
Iād also use this:
This NWS site in an website / iframe card
but the ācontrol boxesā take up too much space and I donāt want them, or would like to force them to be smaller, and the above code doesnāt seem to work when theyāre in an iframe card, either.
Good evening, and thanks for responding. I appreciate it.
The reason I rejected that is because it starts cutting off the bottom of the card when you do that. In other words, it clips the content instead of scaling the - for lack of a better term - viewport while leaving the controls intact.
Increasing a size of a map itself imho cannot be done w/o entering itās internal structure - which is prohibited.
This particular one is impossible then, eh?
Imho - impossible.
Would be glad to be wrong.
Thatās what I figured, but I appreciate you chiming in. I really did try before asking!
Is there some sort of card that I could shoehorn the radar-card into that would have the desired effect?
Do not think so (may be just do not know it).
I am having trouble getting my senors to data value to change color to red if the humidity is below 30% and above 70% and temperature in red if temps go below 59F and above 70F but the ymal code i put is not working correctly to trigger the color changes this is one of 3 cards i want the trigger done on but its not working correctly i do have bot the card mod and the other card mod resources installed
type: entities
entities:
- entity: sensor.museum_attic_southeest_humidity_level
name: Humidity level
style: |
:host {
āpaper-item-icon-color:
{% if states(āsensor.museum_attic_southeest_humidity_levelā) | float < 30 or >70 % > āredā %} - entity: sensor.museum_attic_southeest_temperature
name: Temperature
title: Museum - Attic Near Stairwell
state_color: true
I would suggest you to follow forum rules when posting a code (formatting) and use punctuation marks, do not get me wrong. And use Dev tools ā Template for testing your templates, they are wrong. Docs for templating.