thomas, i am sorry for beeing a noobâŠ
so i will try to focus one question at the timeâŠ
my 1st goal would be to change
this
background: 'radial-gradient(lightgray, green)'
entities:
- entity: sensor.planta_conductivity
name: Condutividade
- entity: sensor.planta_moisture
name: Humidade
- entity: sensor.planta_temperature
name: Temperatura
- entity: sensor.planta_light_intensity
name: Luz
heading: "\U0001F33F Ficus Benjamina"
link: /lovelace/bathroom
panel: true
row_size: 4
type: 'custom:banner-card'
into red text if for example sensor.planta_conductivity is <400
1 Like
First you need to find the css and/or js path of the part you wish to modify. The element inspector of your browser can help with this, but you also need to know your way around HTML, javascript and CSS.
I donât use banner-card myself, so I canât help, unfortunately, but just scanning the code for it on github, Iâd think youâd end up with something like:
something something .overlay-strip .entities .entity_state:n-th-of-type(1) .entity-value
Similar to the advanced example in the readme.
Then you need a template for the color, something like
color: [[ if(sensor.planta_conductivity < 1000, "red", "black") ]]
should do it. Play around, and start with a simpler example - like the button you tried first.
Hi,
Need help for:
$document.querySelector(âbody > home-assistantâ).shadowRoot.querySelector(âhome-assistant-mainâ).shadowRoot.querySelector(âapp-drawer-layout > partial-panel-resolver > ha-panel-lovelaceâ).shadowRoot.querySelector(âhui-rootâ).shadowRoot.querySelector("#view > hui-view").shadowRoot.querySelector("#columns > div:nth-child(2) > hui-vertical-stack-card").shadowRoot.querySelector("#root > hui-vertical-stack-card:nth-child(2)").shadowRoot.querySelector("#root > hui-horizontal-stack-card:nth-child(2)")
I try with:
- type: horizontal-stack
style: |
"#states div":
hui-vertical-stack-card:
$:
hui-horizontal-stack-card:
$: |
#root {
display: none;
}
It is not working.
cjsimmons
(Chris Simmons)
July 12, 2019, 11:20am
45
Hmm, I like the idea of this card, but itâs too confusing⊠The old card-modder
worked great.
Ok, so trying to hide a box-shadow on a custom:vertical-stack-in-card
. Iâm not sure if I got things right or not. Any help would be appreciated. This is what I have copied from the GUI card editor.
- type: 'custom:vertical-stack-in-card'
style:
.: ''
'#states div:nth-child(1)':
$: |
vertical-stack-in-card: {
box-shadow: none;
}
This is the selector:
#states > div:nth-child(1) > vertical-stack-in-card
I donât understand whatâs going on.
benm7
(Ben M)
July 12, 2019, 12:14pm
46
Is there a way to increase the size of the icons/entity picture of a person entity in an entities card? I have two entities as below however I would like the pictures to be larger if possible. I added a regular entity with an icon and was able to enlarge that using card modder but id didnât enlarge the person pictures for some reasonâŠ
KoenChiau
(Koen Chiau)
July 18, 2019, 1:09pm
47
Friends,
I am trying to change the header of a fold-entity-row from normal to bold font-weight.
This fold-entity-row is populated through an auto-entities custom-card.
I have tried inspecting the element in my browser, attempted many different ways to get this done through Card-Mod, but do not succeed.
My yaml code:
- type: custom:auto-entities
filter:
include:
- entity_id: "cover.gelijkvloers_bureau*"
show-empty: false
card:
type: custom:fold-entity-row
head:
type: section
label: Bureau
# style: ?????????
A desperate guy looking for some guidance, a solution, âŠ
horacecar
(Horacecar)
July 18, 2019, 1:34pm
48
I am sorry, i have the same question⊠i still do not understand what this meanâŠhow can i use if and else?
@keyframes blink {
50% {
background: [[ if(states.binary_sensor.meteoalarm.attributes.severity == âModerateâ, âyellowâ, ââ) else if (states.binary_sensor.meteoalarm.attributes.severity == âHighâ, âredâ, ââ)]];
}
}
ha-card {
animation: blink 10s linear infinite;
}
horacecar
(Horacecar)
July 18, 2019, 1:50pm
49
thomasloven:
]]
Actually i wanna 3 color , when battery lower then 40 yello, lower then 20 red, then normal is black.
You mean pretty much exactly like the example in the documentation?
auto-entities is not a card and has no ha-card component.
Youâll have to apply the styles from the entities card.
KoenChiau
(Koen Chiau)
July 21, 2019, 2:03pm
52
Thanks for the feedback, Thomas.
Does this mean that what I want to achieve cannot be done ?
Dino-Tech
(Darren Wilson)
July 21, 2019, 3:45pm
53
Here is how I style my lovelace-fold-entity-row
's to get this:
- type: custom:card-modder
<<: *darrentintstyles
card:
type: entities
entities:
- type: custom:fold-entity-row
head:
type: section
label: Areas
padding: 0px
items:
- type: 'custom:hui-glance-card'
...
and the anchor
with the styles:
darren_tint_styles: &darrentintstyles
style:
background: rgba(0,0,0,0.35)
border-radius: 15px
"--primary-text-color": "#f2f2f2"
"--paper-card-background-color": 'rgba(0, 0, 0,0.65)'
font-weight: bold
font-size: 1.55em
text-transform: capitalize
font-variant: small-caps
text-shadow: "1px 1px 2px black, 0 0 25px green, 0 0 5px darkgreen"
"--paper-item-icon-color": lime
"--iron-icon-stroke-color": green
"--iron-icon-height": 41px
"--iron-icon-width": 41px
3 Likes
No. It means
I.e.
type: entities
style:
STYLES GO HERE
entities:
- whatever
NOT HERE
Use the object inspector in your browser to find the correct path for the styling, starting from the <hui-entities-card>
tag.
LbDab
(Lb Dab)
July 21, 2019, 7:58pm
55
Trying to hide part of more-info-card but IDK if itâs even possible.
This is more-info-card of climate entity, Iâm trying to hide graph part:
In Chrome>Inspect if I add display: none
to state-history-charts
it works but when adding to HA config it is not hiding, my config:
- type: custom:more-info-card
entity: climate.ac
style: |
state-history-charts {
display: none;
height: 0px;
}
also tried with state-history-chart-line
and ha-chart-base
and another options found in Chrome>Inspect without success
Is it possible?
hekm77
July 22, 2019, 10:52am
56
@thomasloven ,
Iâm trying to change the color of the header.
Where is my mistake?
Thanks.
("#states > div:nth-child(1) > fold-entity-row").shadowRoot.querySelector("#head > entity-row-maker > hui-section-row").shadowRoot.querySelector("div.label")
- type: entities
style:
.: |
"#states div":
fold-entity-row:
$: |
"#head":
$:
entity-row-maker:
$:
hui-section-row:
$: |
.label {
color: var(--accent-color);
}
entities:
- type: custom:fold-entity-row
head:
type: section
label: Test
#head
doesnât have a shadowroot, so there shouldât be a $
there.
There are shadowroots in your way. Look at the post below yours. Thatâs a great example on how to dissect a selector path.
1 Like
hekm77
July 22, 2019, 8:22pm
60
@thomasloven
I still do not understand.
Could you help me?
I deleted $
from #head
, but nothing has changed, I canât get to .label
- title: Test Card Mod
cards:
- type: entities
style:
.: |
ha-card {
border-radius: 10px;
}
"#states div":
fold-entity-row:
$: |
"#head":
entity-row-maker:
hui-section-row:
$: |
.label {
color: #FFFFFF;
}
entities:
- type: custom:fold-entity-row
head:
type: section
label: Test
items:
- light.bedroom
- light.kitchen
- light.hall
I canât really say whatâs wrong, but I can give you a tip for finding the problem.
Try one step at a time, i.e. start with
style:
"#states div": |
whatever {
color: red;
}
Then open up the object inspector and make sure the following is added inside the correct <div>
tag.
<style class="card-mod-style">whatever {
color: red;
}
</style>
Then you move on to
style:
"#states div":
fold-entity-row: |
whatever {
color: red;
}
and so onâŠ
3 Likes