Bonjour,
Voici mon problème : j’ai une installation de panneaux photovoltaïque sur une maison triphasé.
Je tente de faire un tableau de bord avec mes consommations instantanées :
3 blocs : Conso net / Conso / Production avec à chaque fois le total et les 3 valeurs sur chaque phase.
3 cas :
- j’ai ajouté 3 blocs : ça marche bien mais c’est brouillon, trop de gauge et c’est pas lisible, j’ai donc souhaité mettre un fond de couleur sur chaque bloc Conso Net / Conso / Production avec card_mod: / style: mais ça ne prend pas.
- J’ai tout édité et fait à la main mais là, les éléments ne prennent pas toute la largeur, il sont les uns sous les autres : voir code yaml.
Code
views:
- title: Home
cards:
- type: custom:mod-card
square: false
card_mod:
style: |
ha-card {
border-top: 2px outset #F0F0FF;
border-left: 2px outset #F0F0F0;
border-bottom: 2px inset #F0F0FF;
border-right: 2px inset #F0F0FF;
background-color: rgba(60,80,250,0.05);
}
card:
title: Consommation Net
type: grid
square: false
columns: 2
card_mod:
style: |
card-header {
color: red !important;
background-color: rgba(60,80,250,0.05);
}
cards:
- type: gauge
name: Total
entity: sensor.envoy_122308022894_current_net_power_consumption
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
max: 4000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 1000
color: '#EEFF32'
- from: 2000
color: '#FFA426'
- from: 3000
color: '#FF0037'
min: -1000
- type: vertical-stack
cards:
- type: gauge
name: Phase 1
entity: sensor.envoy_122308022894_current_net_power_consumption_l1
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
max: 3000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 500
color: '#EEFF32'
- from: 1000
color: '#FFA426'
- from: 2000
color: '#FF0037'
min: -500
- type: gauge
name: Phase 2
entity: sensor.envoy_122308022894_current_net_power_consumption_l2
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
max: 3000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 500
color: '#EEFF32'
- from: 1000
color: '#FFA426'
- from: 2000
color: '#FF0037'
min: -500
- type: gauge
name: Phase 3
entity: sensor.envoy_122308022894_current_net_power_consumption_l3
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
max: 3000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 500
color: '#EEFF32'
- from: 1000
color: '#FFA426'
- from: 2000
color: '#FF0037'
min: -500
- type: custom:mod-card
square: false
card_mod:
style: |
ha-card {
border-top: 2px outset #F0F0FF;
border-left: 2px outset #F0F0F0;
border-bottom: 2px inset #F0F0FF;
border-right: 2px inset #F0F0FF;
background-color: rgba(60,80,25,0.05);
}
#card-header {
color: red !important;
background-color: rgba(60,80,25,0.05);
}
card:
type: grid
square: false
columns: 2
title: Consommation
cards:
- type: gauge
name: Total
entity: sensor.envoy_122308022894_current_power_consumption
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 4000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 1000
color: '#EEFF32'
- from: 2000
color: '#FFA426'
- from: 3000
color: '#FF0037'
- type: vertical-stack
cards:
- type: gauge
name: Phase 1
entity: sensor.envoy_122308022894_current_power_consumption_l1
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 3000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 500
color: '#EEFF32'
- from: 1000
color: '#FFA426'
- from: 2000
color: '#FF0037'
- type: gauge
name: Phase 2
entity: sensor.envoy_122308022894_current_power_consumption_l2
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 3000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 500
color: '#EEFF32'
- from: 1000
color: '#FFA426'
- from: 2000
color: '#FF0037'
- type: gauge
name: Phase 3
entity: sensor.envoy_122308022894_current_power_consumption_l3
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 3000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 500
color: '#EEFF32'
- from: 1000
color: '#FFA426'
- from: 2000
color: '#FF0037'
- type: custom:mod-card
square: false
card_mod:
style: |
ha-card {
border-top: 2px outset #F0F0FF;
border-left: 2px outset #F0F0F0;
border-bottom: 2px inset #F0F0FF;
border-right: 2px inset #F0F0FF;
background-color: rgba(60,255,2,0.05);
}
card:
title: Production
square: false
type: grid
columns: 2
card_mod:
style: |
card-header {
color: red !important;
background-color: rgba(60,80,250,0.05);
}
cards:
- type: gauge
name: Total
entity: sensor.envoy_122308022894_current_power_production
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 3300
needle: true
segments:
- from: 0
color: '#FF0037'
- from: 300
color: '#FFA426'
- from: 1100
color: '#EEFF32'
- from: 2200
color: '#47FF4D'
- type: vertical-stack
cards:
- type: gauge
name: Phase 1
entity: sensor.envoy_122308022894_current_power_production_l1
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 1200
needle: true
segments:
- from: 0
color: '#FF0037'
- from: 100
color: '#FFA426'
- from: 400
color: '#EEFF32'
- from: 800
color: '#47FF4D'
- type: gauge
name: Phase 2
entity: sensor.envoy_122308022894_current_power_production_l2
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 1200
needle: true
segments:
- from: 0
color: '#FF0037'
- from: 100
color: '#FFA426'
- from: 400
color: '#EEFF32'
- from: 800
color: '#47FF4D'
- type: gauge
name: Phase 3
entity: sensor.envoy_122308022894_current_power_production_l3
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 900
needle: true
segments:
- from: 0
color: '#FF0037'
- from: 100
color: '#FFA426'
- from: 300
color: '#EEFF32'
- from: 600
color: '#47FF4D'
badges: []
- J’ai fais avec un horizontal-stack mais là, les 3 blocs font ensemble la largeur d’un seul bloc précédent, donc c’est tout petit ! : voir code code yaml
Code
views:
- title: Home
cards:
- type: horizontal-stack
cards:
- type: custom:mod-card
square: false
card_mod:
style: |
ha-card {
border-top: 2px outset #F0F0FF;
border-left: 2px outset #F0F0F0;
border-bottom: 2px inset #F0F0FF;
border-right: 2px inset #F0F0FF;
background-color: rgba(60,80,250,0.05);
}
card:
title: Consommation Net
type: grid
square: false
columns: 2
card_mod:
style: |
card-header {
color: red !important;
background-color: rgba(60,80,250,0.05);
}
cards:
- type: gauge
name: Total
entity: sensor.envoy_122308022894_current_net_power_consumption
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
max: 4000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 1000
color: '#EEFF32'
- from: 2000
color: '#FFA426'
- from: 3000
color: '#FF0037'
min: -1000
- type: vertical-stack
cards:
- type: gauge
name: Phase 1
entity: >-
sensor.envoy_122308022894_current_net_power_consumption_l1
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
max: 3000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 500
color: '#EEFF32'
- from: 1000
color: '#FFA426'
- from: 2000
color: '#FF0037'
min: -500
- type: gauge
name: Phase 2
entity: >-
sensor.envoy_122308022894_current_net_power_consumption_l2
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
max: 3000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 500
color: '#EEFF32'
- from: 1000
color: '#FFA426'
- from: 2000
color: '#FF0037'
min: -500
- type: gauge
name: Phase 3
entity: >-
sensor.envoy_122308022894_current_net_power_consumption_l3
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
max: 3000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 500
color: '#EEFF32'
- from: 1000
color: '#FFA426'
- from: 2000
color: '#FF0037'
min: -500
- type: custom:mod-card
square: false
card_mod:
style: |
ha-card {
border-top: 2px outset #F0F0FF;
border-left: 2px outset #F0F0F0;
border-bottom: 2px inset #F0F0FF;
border-right: 2px inset #F0F0FF;
background-color: rgba(60,80,25,0.05);
}
#card-header {
color: red !important;
background-color: rgba(60,80,25,0.05);
}
card:
type: grid
square: false
columns: 2
title: Consommation
cards:
- type: gauge
name: Total
entity: sensor.envoy_122308022894_current_power_consumption
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 4000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 1000
color: '#EEFF32'
- from: 2000
color: '#FFA426'
- from: 3000
color: '#FF0037'
- type: vertical-stack
cards:
- type: gauge
name: Phase 1
entity: sensor.envoy_122308022894_current_power_consumption_l1
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 3000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 500
color: '#EEFF32'
- from: 1000
color: '#FFA426'
- from: 2000
color: '#FF0037'
- type: gauge
name: Phase 2
entity: sensor.envoy_122308022894_current_power_consumption_l2
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 3000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 500
color: '#EEFF32'
- from: 1000
color: '#FFA426'
- from: 2000
color: '#FF0037'
- type: gauge
name: Phase 3
entity: sensor.envoy_122308022894_current_power_consumption_l3
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 3000
needle: true
segments:
- from: -5000
color: '#EB16FF'
- from: 0
color: '#47FF4D'
- from: 500
color: '#EEFF32'
- from: 1000
color: '#FFA426'
- from: 2000
color: '#FF0037'
- type: custom:mod-card
square: false
card_mod:
style: |
ha-card {
border-top: 2px outset #F0F0FF;
border-left: 2px outset #F0F0F0;
border-bottom: 2px inset #F0F0FF;
border-right: 2px inset #F0F0FF;
background-color: rgba(60,255,2,0.05);
}
card:
title: Production
square: false
type: grid
columns: 2
card_mod:
style: |
card-header {
color: red !important;
background-color: rgba(60,80,250,0.05);
}
cards:
- type: gauge
name: Total
entity: sensor.envoy_122308022894_current_power_production
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 3300
needle: true
segments:
- from: 0
color: '#FF0037'
- from: 300
color: '#FFA426'
- from: 1100
color: '#EEFF32'
- from: 2200
color: '#47FF4D'
- type: vertical-stack
cards:
- type: gauge
name: Phase 1
entity: sensor.envoy_122308022894_current_power_production_l1
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 1200
needle: true
segments:
- from: 0
color: '#FF0037'
- from: 100
color: '#FFA426'
- from: 400
color: '#EEFF32'
- from: 800
color: '#47FF4D'
- type: gauge
name: Phase 2
entity: sensor.envoy_122308022894_current_power_production_l2
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 1200
needle: true
segments:
- from: 0
color: '#FF0037'
- from: 100
color: '#FFA426'
- from: 400
color: '#EEFF32'
- from: 800
color: '#47FF4D'
- type: gauge
name: Phase 3
entity: sensor.envoy_122308022894_current_power_production_l3
card_mod:
style: |
ha-card {
background-color: rgba(60,255,250,0.1);
}
min: 0
max: 900
needle: true
segments:
- from: 0
color: '#FF0037'
- from: 100
color: '#FFA426'
- from: 300
color: '#EEFF32'
- from: 600
color: '#47FF4D'
badges: []