Selber gebastelt. Guck mal hier: Template Sensor für PV Eigenverbrauch - #10 von Rene83
Habe den Code aber nochmal optimiert, daher hier noch mal…
type: custom:layout-card
layout_type: custom:grid-layout
layout:
grid-template-columns: 0.7fr 1.3fr 1.3fr 0.7fr
grid-template-rows: auto
grid-template-areas: |
"area-1 area-2 area-3 area-4"
margin: '-4px -4px 0px -4px'
cards:
- type: custom:mushroom-person-card
entity: person.roberto_cravallo
icon_type: entity-picture
layout: vertical
fill_container: true
card_mod:
style: |
{% if is_state('switch.steckdose_elippsentrainer', 'on') %}
ha-card {
--ha-card-border-radius: 10px;
--ha-card-border-color: #990000;
--ha-card-border-width: 2px;
--card-mod-icon-color: white;
{% endif %}
view_layout:
grid-area: area-1
- type: custom:flex-horseshoe-card
entities:
- entity: sensor.sunny_boy_grid_power
decimals: 0
icon: mdi:solar-power-variant
name: Solaranlage
area: Solarstrom
- entity: sensor.sma_strom_eigenverbrauch_prozent
decimals: 0
name: Eigenverbrauch
- entity: sensor.sma_strom_autarkie_prozent
decimals: 0
name: Autargie
show:
scale_tickmarks: true
horseshoe_style: lineargradient
layout:
hlines:
- id: 0
xpos: 50
ypos: 41
length: 70
styles:
- stroke: var(--primary-text-color);
- stroke-width: 2;
- opacity: 0.5;
- stroke-linecap: round;
color: '#FFF6E3'
vlines:
- id: 0
xpos: 50
ypos: 56
length: 20
styles:
- stroke: var(--primary-text-color);
- opacity: 0.5;
- stroke-width: 2;
- stroke-linecap: round;
states:
- id: 0
entity_index: 0
xpos: 50
ypos: 36
styles:
- font-size: 2.8em;
- id: 1
entity_index: 1
xpos: 48
ypos: 56
styles:
- font-size: 2.2em;
- text-anchor: end;
- font-style: normal;
- opacity: 0.7;
- id: 2
entity_index: 2
xpos: 52
ypos: 56
styles:
- font-size: 2.2em;
- text-anchor: start;
- font-style: normal;
- opacity: 0.7;
names:
- id: 0
entity_index: 0
xpos: 50
ypos: 94
styles:
- font-size: 1.5em;
- text-transform: capitalize;
- id: 1
entity_index: 1
xpos: 46
ypos: 62
styles:
- font-size: 0.6em;
- text-anchor: end;
- opacity: 0.5;
- text-transform: capitalize;
- id: 2
entity_index: 2
xpos: 54
ypos: 62
styles:
- font-size: 0.6em;
- text-anchor: start;
- opacity: 0.5;
- text-transform: capitalize;
areas:
- id: 0
entity_index: 0
xpos: 50
ypos: 76
styles:
- font-size: 1.0em;
- opacity: 0.4;
horseshoe_state:
color: '#43a047'
horseshoe_scale:
min: 0
max: 5000
color: '#2e7031'
width: 2
color_stops:
'1000': '#43a047'
'2000': '#32CD32'
'3100': '#ADFF2F'
view_layout:
grid-area: area-2
- type: custom:flex-horseshoe-card
entities:
- entity: sensor.sunny_boy_metering_power_absorbed
decimals: 0
icon: mdi:solar-power-variant
name: Netzbezug
area: Strom
- entity: sensor.sunny_boy_metering_current_consumption
decimals: 0
name: Verbrauch
- entity: sensor.sunny_boy_metering_power_supplied
decimals: 0
name: Überschuss
show:
scale_tickmarks: true
horseshoe_style: lineargradient
layout:
hlines:
- id: 0
xpos: 50
ypos: 41
length: 70
styles:
- stroke: var(--primary-text-color);
- stroke-width: 2;
- opacity: 0.5;
- stroke-linecap: round;
color: '#FFF6E3'
vlines:
- id: 0
xpos: 50
ypos: 56
length: 20
styles:
- stroke: var(--primary-text-color);
- opacity: 0.5;
- stroke-width: 2;
- stroke-linecap: round;
states:
- id: 0
entity_index: 0
xpos: 50
ypos: 36
styles:
- font-size: 2.8em;
- id: 1
entity_index: 1
xpos: 48
ypos: 56
styles:
- font-size: 2.2em;
- text-anchor: end;
- font-style: normal;
- opacity: 0.7;
- id: 2
entity_index: 2
xpos: 52
ypos: 56
styles:
- font-size: 2.2em;
- text-anchor: start;
- font-style: normal;
- opacity: 0.7;
names:
- id: 0
entity_index: 0
xpos: 50
ypos: 94
styles:
- font-size: 1.5em;
- text-transform: capitalize;
- id: 1
entity_index: 1
xpos: 46
ypos: 62
styles:
- font-size: 0.6em;
- text-anchor: end;
- opacity: 0.5;
- text-transform: capitalize;
- id: 2
entity_index: 2
xpos: 54
ypos: 62
styles:
- font-size: 0.6em;
- text-anchor: start;
- opacity: 0.5;
- text-transform: capitalize;
areas:
- id: 0
entity_index: 0
xpos: 50
ypos: 76
styles:
- font-size: 1.0em;
- opacity: 0.4;
horseshoe_state:
color: '#db4437'
horseshoe_scale:
min: 0
max: 7000
color: '#990000'
width: 2
color_stops:
'0': '#db4437'
'90': '#db4437'
view_layout:
grid-area: area-3
- type: custom:mushroom-person-card
entity: person.sylvia
icon_type: entity-picture
layout: vertical
fill_container: true
card_mod:
style: |
{% if is_state('switch.steckdose_elippsentrainer', 'on') %}
ha-card {
--ha-card-border-radius: 10px;
--ha-card-border-color: #990000;
--ha-card-border-width: 2px;
--card-mod-icon-color: white;
{% endif %}
view_layout:
grid-area: area-4