I made a yaml config to visualize the production of a grid of PV panels:
Credits to @Mariusthvdb for helping with the css
To get per-panel optimizer data from my solaredge inverter I used the unofficial integration of SolarEdge Optimizers Data. Unfortunately the data is only available through webscraping.
The YAML config for the card is:
type: custom:stack-in-card
title: Solar panels power [W]
mode: vertical
cards:
- type: horizontal-stack
cards:
- type: custom:button-card
template: pv_panel
entity: sensor.power_1_1_12
name: 1.1.12
- type: custom:button-card
template: pv_panel
entity: sensor.power_1_1_9
name: 1.1.9
- type: custom:button-card
template: pv_panel
entity: sensor.power_1_1_11
name: 1.1.11
- type: custom:button-card
template: pv_panel
entity: sensor.power_1_1_10
name: 1.1.10
- type: horizontal-stack
cards:
- type: custom:button-card
template: pv_panel
entity: sensor.power_1_1_1
name: 1.1.1
- type: custom:button-card
template: pv_panel
entity: sensor.power_1_1_4
name: 1.1.4
- type: custom:button-card
template: pv_panel
entity: sensor.power_1_1_5
name: 1.1.5
- type: custom:button-card
template: pv_panel
entity: sensor.power_1_1_3
name: 1.1.3
- type: horizontal-stack
cards:
- type: custom:button-card
template: pv_panel
entity: sensor.power_1_1_2
name: 1.1.2
- type: custom:button-card
template: pv_panel
entity: sensor.power_1_1_8
name: 1.1.8
- type: custom:button-card
template: pv_panel
entity: sensor.power_1_1_6
name: 1.1.6
- type: custom:button-card
template: pv_panel
entity: sensor.power_1_1_7
name: 1.1.7
With the button-card template being:
button_card_templates:
pv_panel:
aspect_ratio: 200/120
show_entity_picture: true
show_icon: false
show_state: true
styles:
name:
- font-weight: bold
card:
- '--keep-background': 'true'
- border-radius: 5%
- text-shadow: 0px 0px 5px black
- padding: '-10%'
- background-image: |
[[[ return `url("/local/images/solarpanel_simple.png")`; ]]]
- background-size: cover
- background-repeat: no-repeat
- color: white
- text-transform: uppercase
- font-weight: bold
- background-color: rgb(255,235,171)
- filter: |
[[[
return "brightness("+Math.min(100*(Math.round(Number(entity.state)) / 250 + 0.2), 100) + "%)"
]]]
state_display: |
[[[
return Math.round(Number(entity.state))+" W"
]]]
The solar panel was made in paint, using an example image:
You should put this image in config/www/images/solarpanel_simple.png
for this to work.
(or any other location, but you will have to adapt this line in the button-card template: url("/local/images/solarpanel_simple.png")
to reflect the change)
The card is pretty basic at this point, but it should be fairly easy to adapt the button-card template as it is very customizable.