Hi Mike,
great support and explanation how to improve the card .
But weird things have happened meanwhile or should I say the weird things before have been reversed:
For whatever reason the card_mod: lines are now still there if I want to edit the card - they are no longer being deleted.
I have no clue what had caused the issue.
I can also not say what has made this to happen unless it happened this morning while working with chatgpt on the topic of âdynamic titleâ for the bar which is showing the 100% value of the sensor - in this case the production of the best PV string on the roof.
It took quite a while cause first chatgpt suggestions did not work at all and code was not really homeassistant related. Just pure phantasy adding a sensor into the title: line.
I am using lmarena.ai where I get 2 answers from 2 models and in this case the 2nd answer was the best by explaining that a real dynamic title is not possible with a usual bar card but with a vertical stack of a markdown card for the headline or title and then the well known bar card.
Step by step chatgpt found a way to increased fontsize and thickness / bold . Also background and then remove the rounded corners.
But finally I was able to fix and understand more of your code and help myself cause I had removed the separator blank sensor at one point and the line had vanished when I did not realize it and had to search for it.
Here is the final resuult and I am happy with that, hence time to share the code for the 80s and 90s equalizer LED style bar I was looking for inspired by this:
and my card looks like this
with this code thanks to your constant support - really appreciated and I also learned a lot to play around and look into the lines you had provided or asked chatgpt what which parameter would mean.
THANKS A LOT
type: vertical-stack
cards:
- type: markdown
content: |
<div style="text-align: left;"><br>
RELATION DER SPEZIFISCHEN STRINGLEISTUNGEN ZUEINANDER - AKTUELLE HĂCHSTLEISTUNG: {{ states('sensor.pv_beste_leistung_eines_string_w_je_kwp') | default(0) }} W / kWp
</div>
card_mod:
style: |
ha-card {
color: white;
box-shadow: none;
margin: -1em 0 -0.5em 0;
padding: 0 1em;
background-color: black;
font-size: 2.1em;
font-weight: 500;
border-radius: 0px;
}
- type: custom:bar-card
columns: 1
decimal: 0
positions:
icon: "off"
name: outside
minmax: "off"
indicator: "off"
direction: right
height: 18px
entities:
- entity: sensor.u1_1_leistung_kwp_relation
name: "U1.1\_"
- entity: sensor.u1_2_leistung_kwp_relation
name: "U1.2\_"
- entity: sensor.u2_1_leistung_kwp_relation
name: "U2.1\_"
- entity: sensor.u2_2_leistung_kwp_relation
name: "U2.2\_"
- entity: sensor.u3_1_leistung_kwp_relation
name: "U3.1\_"
- entity: sensor.u3_2_leistung_kwp_relation
name: "U3.2\_"
- entity: sensor.u4_leistung_kwp_relation
name: "U4\_\_\_\_"
- entity: sensor.u5_leistung_kwp_relation
name: "U5\_\_\_\_"
- entity: sensor.blank
name: " "
- entity: sensor.v1_1_leistung_kwp_relation
name: "V1.1\_"
- entity: sensor.v1_2_leistung_kwp_relation
name: "V1.2\_"
- entity: sensor.v2_1_leistung_kwp_relation
name: "V2.1\_"
- entity: sensor.v2_2_leistung_kwp_relation
name: "V2.2\_"
card_mod:
style: >
ha-card {
background: black !important; /* white = heller / black = dunkler Hintergrund */
color: #FFFFFF; /* #222222 = dunkle Schriftfarbe fĂźr guten Kontrast - #FFFFFF als helle Schriftfarbe*/
--ha-card-header-color: white; /* TITLE COLOR (wird jetzt nur noch von der markdown-Karte genutzt, aber hier belassen fĂźr Konsistenz) */
border-radius: 0px;
}
bar-card-background bar-card-backgroundbar {
background: linear-gradient(90deg, #B22222 0%, #B22222 5%, #CF5B00 30%, #E6BB00 50%, #228B22 100%);
mask-image: repeating-linear-gradient( 90deg, rgba(0, 0, 0, 0.3) 0%, black 2%, rgba(0, 0, 0, 0.3) 4%, transparent 4%, transparent 5%);
border-radius: 0px;
filter: brightness(0.65);
opacity: 0.05; /* weniger sichtbare 0 Segmente */
}
bar-card-background bar-card-currentbar {
background: linear-gradient(90deg, #B22222 0%, #B22222 5%, #CF5B00 30%, #E6BB00 50%, #228B22 100%);
mask-image: repeating-linear-gradient( 90deg, rgba(0, 0, 0, 0.3) 0%, black 2%, rgba(0, 0, 0, 0.3) 4%, transparent 4%, transparent 5%);
clip-path: polygon(0 0, var(--bar-percent) 0, var(--bar-percent) 100%, 0 100%);
border-radius: 0px;
}
bar-card-value {
margin: 20px;
font-size: 1.25rem;
font-weight: 800;
color: #FFFFFF; /* #222222 = dunkle & #FFFFFF = helle SCHRIFTFARBE */
}
bar-card-name {
margin: 20px;
font-size: 1.25rem;
font-weight: 800;
color: #FFFFFF; /* #222222 = dunkle & #FFFFFF = helle SCHRIFTFARBE */
}
#states > bar-card-row:nth-child(9) > bar-card-card >
bar-card-background > bar-card-contentbar > bar-card-value {
display: none; /* HIDE - ENTITY 9 - ICON */
}
#states > bar-card-row:nth-child(9) > bar-card-card >
bar-card-background > bar-card-contentbar > bar-card-name {
display: none; /* HIDE - ENTITY 9 - NAME */
}
#states > bar-card-row:nth-child(9) > bar-card-card > bar-card-iconbar {
display: none; /* HIDE - ENTITY 9 - NAME */
}
#states > bar-card-row:nth-child(9) > bar-card-card >
bar-card-background {
background-color: white; /* CHANGE - ENTITY 9 - BACKGROUND COLOR */
height: 1px !important; /* CHANGE - ENTITY 9 - HEIGHT */
}
#states > bar-card-row:nth-child(9) {
margin-top: 1px; /* CHANGE - ENTITY 10 - MARGIN (AN EVEN GAP) */
}