set the color of my card manually
background: url('/local/images/aloe.png'), linear-gradient(to right, transparent, #313244 50%);
set the color of my card manually
background: url('/local/images/aloe.png'), linear-gradient(to right, transparent, #313244 50%);
I have no clue. I was in the same situation. I used the double editing method:
then
Then seach for style:
with
card_mod:
style:
ready in my clipboard and started the tedious replacement…
Not possible with card-mod.
Consider custom:logbook-card.
I thought i may have had that wrong, thanks for the pointer
Thanks for all the help, that’s very helpful
HI sorry
- entity: alarm_control_panel.mieszkanie
card_mod: null
style: |
:host {
{% if is_state('alarm_control_panel.mieszkanie', 'disarmed') %}
label-badge-background-color: green;
--label-badge-red: green;
{% else %}
label-badge-background-color: red;
--label-badge-red: red;
{% endif %}
}
Not working always showing RED
See yourself. Compare with examples. Also, “null” value is rather unusual & tells about an error which you need to fix.
I checked it before , when I remove null and save after edit showing again
Means - this “null” is set automatically because of some problems with the code. Now compare your code with examples.
I dont understand You
example
- entity: light.kitchen_lights
card_mod:
style: |
:host {
color: blue;
}
my code
- entity: alarm_control_panel.mieszkanie
card_mod: null
style: |
:host {
{% if is_state('alarm_control_panel.mieszkanie', 'disarmed') %}
label-badge-background-color: green;
--label-badge-red: green;
{% else %}
label-badge-background-color: red;
and before upgrade to last version all was working
Check indentation which is important in yaml.
Really? Then compare again. Is card_mod and style in both examples in eqal places and with the same indentation?
indentation is as always important.
thx
working now
Is it right to loose every card_mod addition if editing an entry via gui and visual editor?
In the second the VE opens the card_mod is on vacation to dev/null or so.
How to prevent it?
There is an open issue for this.
Hello together,
I would like to change the color of my blind icon to orange in case my blind is not ‘closed’. Somehow I managed the code but it does not update once the status is changing, the color will stay even status changed. Only via browser refresh the color will change accordingly. Many thanks for support upfront!
My questions:
My code
type: vertical-stack
title: Rollläden
cards:
- type: custom:mushroom-cover-card
entity: cover.hausrollladen
tap_action:
action: more-info
double_tap_action:
action: toggle
show_position_control: false
show_buttons_control: false
card_mod:
style:
mushroom-shape-icon$: |
.shape {
background: none !important;
}
:host {
{% if states('cover.hausrollladen')!='closed' %}
--card-mod-icon-color: orange;
{% endif %}
}
@RkcCorian There are two methods you can use. Keep the Mushroom template card with something similar to this:
type: vertical-stack
title: Rollläden
cards:
- type: custom:mushroom-template-card
entity: cover.hausrollladen
icon: mdi:blinds-horizontal
primary: Your Device
secondary: |
{% if is_state(config.entity, 'open') %} Open
{% else %}
Closed
{% endif %}
tap_action:
action: more-info
double_tap_action:
action: toggle
icon_color: >
{% if is_state(config.entity, 'open') %}
orange
{% else %}
{% endif %}
card_mod:
style:
mushroom-shape-icon$: |
.shape {
background: none !important;
}
or just use the Mushroom-Cover-Card like this:
- type: custom:mushroom-cover-card
entity: cover.pc_curtains
show_position_control: true
show_tilt_position_control: false
show_buttons_control: true
layout: horizontal
card_mod:
style:
mushroom-shape-icon$: |
.shape {
background: none !important;
}
.: |
ha-state-icon {
color: {% if is_state(config.entity, 'open') %} orange
{% else %}
{% endif %};
background: none !important;
}
ha-card {
background: none !important;
}