Maybe this is a solution:
type: custom:stack-in-card
card_mod:
style: |
ha-card {
padding: 20px;
}
mode: horizontal
keep:
background: false
cards:
- type: custom:bar-card
animation:
state: "on"
speed: "2"
name: Nulleinspeisung
width: 100%
height: 50px
min: "0"
max: "-300"
entity_row: true
severity:
- color: rgb(var(--mush-rgb-red))
from: -300
to: -40
- color: rgb(var(--mush-rgb-orange))
from: -39
to: -20
- color: rgb(var(--mush-rgb-green))
from: -19
to: -0.1
- from: 0.1
to: 2100
hide: true
positions:
icon: "off"
indicator: "on"
name: "off"
value: "off"
entities:
- entity: sensor.testsensor
target: -0.1
card_mod:
style: |
ha-card {
background-color: red;
border: 1px dotted;
border-left: 2px solid;
border-color: white;
margin-right: -4px !important;
transform: rotate(180deg);
--bar-card-border-radius: 0px;
--mush-rgb-red: 244, 67, 54;
--mush-rgb-pink: 233, 30, 99;
--mush-rgb-purple: 156, 39, 176;
--mush-rgb-deep-purple: 103, 58, 183;
--mush-rgb-indigo: 63, 81, 181;
--mush-rgb-blue: 33, 150, 243;
--mush-rgb-light-blue: 3, 169, 244;
--mush-rgb-cyan: 0, 188, 212;
--mush-rgb-teal: 0, 150, 136;
--mush-rgb-green: 76, 175, 80;
--mush-rgb-light-green: 139, 195, 74;
--mush-rgb-lime: 205, 220, 57;
--mush-rgb-yellow: 255, 235, 59;
--mush-rgb-amber: 255, 193, 7;
--mush-rgb-orange: 255, 152, 0;
--mush-rgb-deep-orange: 255, 87, 34;
--mush-rgb-brown: 121, 85, 72;
--mush-rgb-grey: 158, 158, 158;
--mush-rgb-blue-grey: 96, 125, 139;
--mush-rgb-black: 0, 0, 0;
--mush-rgb-white: 255, 255, 255;
}
bar-card-backgroundbar {
opacity: 0.0;
filter: brightness(1);
border-radius: 0px;
border: 1px dotted;
border-color: white
}
- type: custom:bar-card
animation:
state: "on"
speed: "2"
name: Nulleinspeisung
width: 100%
height: 50px
min: "0"
max: "300"
entity_row: true
severity:
- color: rgb(var(--mush-rgb-green))
from: 0
to: 19
- color: rgb(var(--mush-rgb-orange))
from: 20
to: 39
- color: rgb(var(--mush-rgb-red))
from: 40
to: 300
- from: 0.1
to: -2100
hide: true
positions:
icon: "off"
indicator: "on"
name: "off"
value: "off"
entities:
- entity: sensor.testsensor
target: -0.1
card_mod:
style: |
ha-card {
background-color: red;
border: 1px dotted;
border-left: 2px solid;
border-color: white;
margin-left: -4px !important;
--bar-card-border-radius: 0px;
--mush-rgb-red: 244, 67, 54;
--mush-rgb-pink: 233, 30, 99;
--mush-rgb-purple: 156, 39, 176;
--mush-rgb-deep-purple: 103, 58, 183;
--mush-rgb-indigo: 63, 81, 181;
--mush-rgb-blue: 33, 150, 243;
--mush-rgb-light-blue: 3, 169, 244;
--mush-rgb-cyan: 0, 188, 212;
--mush-rgb-teal: 0, 150, 136;
--mush-rgb-green: 76, 175, 80;
--mush-rgb-light-green: 139, 195, 74;
--mush-rgb-lime: 205, 220, 57;
--mush-rgb-yellow: 255, 235, 59;
--mush-rgb-amber: 255, 193, 7;
--mush-rgb-orange: 255, 152, 0;
--mush-rgb-deep-orange: 255, 87, 34;
--mush-rgb-brown: 121, 85, 72;
--mush-rgb-grey: 158, 158, 158;
--mush-rgb-blue-grey: 96, 125, 139;
--mush-rgb-black: 0, 0, 0;
--mush-rgb-white: 255, 255, 255;
}
bar-card-backgroundbar {
opacity: 0.0;
filter: brightness(1);
border-radius: 0px;
border: 1px dotted;
border-color: white
}