Solar gauge card for Home Assistant
The goal is to display Solar production and its distribution to home, grid or battery in gauge style.
This card is direclty available in HACS (Home Assistant Community Store). HACS is a third party community store and is not included in Home Assistant out of the box. To install this:
- Go to HACS
- Click on
Frontend - Search for
Solar gauge card - Install via UI
Manual Install
-
Download and copy
solar-gague-card.jsfrom the latest release into yourconfig/wwwdirectory. -
Add the resource reference as decribed below.
If you configure Dashboards via YAML, add a reference to solar-gague-card.js inside your configuration.yaml:
resources:
- url: /local/solar-gague-card.js
type: moduleElse, if you prefer the graphical editor, use the menu to add the resource:
- Make sure, advanced mode is enabled in your user profile (click on your user name to get there)
- Navigate to Settings -> Dashboards
- Click three dot icon
- Select Resources
- Hit (+ ADD RESOURCE) icon
- Enter URL
/local/solar-gague-card.jsand select type "JavaScript Module". (Use/hacsfiles/solar-gague-card/solar-gague-card.jsand select "JavaScript Module" for HACS install if HACS didn't do it already)
We recommend looking at the Example usage section to understand the basics to configure this card. (also) pay attention to the required options mentioned below.
| Name | Type | Default | Since | Description |
|---|---|---|---|---|
| type (required) | string | v0.0.1 | custom:solar-gauge-card |
|
| solarPower (required) | Object | v0.0.1 | Solar Power entity | |
| homeConsumption (required) | Object | v0.0.1 | Home consumption entity | |
| gridPower (required) | Object | v0.0.1 | Grid Power entity | |
| batteryPower | Object | v0.0.1 | Battery Power entity | |
| battery | BatteryObject |
v0.0.1 | Battery entity | |
| gaugeWidth | Number | 20 | v0.0.1 | Set the width of the gauge. Min = 5, max = 20. Gauge width is dynamically calculated based on Total Production value |
Total Production Value = Solar Power + Battery Power + Grid Out Power
Grid/Battery Power could be setup in one sensor (sensor.grid/battery_power) having positive and negative value, representing consumption from grid/battery or feeding to grid/battery. Eventually, grid/battery power could be setup with 2 sensors: sensor.grid/battery_power_out (consumption from grid/battery) and sensor.grid/battery_power_in (feeding grid/battery). If all sensors are setup, then out and in sensors are ignored.
| Name | Type | Default | Since | Description |
|---|---|---|---|---|
| capacity | BatteryCapacityObject | v0.0.1 | Battery capacity | |
| temperature | Object | v0.0.1 | Battery temperature |
| Name | Type | Default | Since | Description |
|---|---|---|---|---|
| entity (required) | string | v0.0.1 | Battery entity | |
| precision | Number | 0 | v0.0.2 | Number of decimal places on entity value |
type: custom:solar-gauge-card
solarPower:
entity: sensor.solar_power
homeConsumption:
entity: sensor.home_consumption
gridPower:
entity: sensor.grid_powertype: custom:solar-gauge-card
solarPower:
entity: sensor.solar_power
homeConsumption:
entity: sensor.home_consumption
gridPower:
entity: sensor.grid_power
out:
entity: sensor.grid_power_out
in:
entity: sensor.grid_power_in
batteryPower:
entity: sensor.battery_power
out:
entity: sensor.battery_power_out
in:
entity: sensor.battery_power_in
battery:
capacity:
entity: sensor.battery_capacity
precision: 2
temperature:
entity: sensor.battery_temperature
gaugeWidth: 15card_mod:
style: |
ha-card {
margin-bottom: -28px;
}
#gauge-circle-solar {
stroke: orange;
}
#battery-cell-full {
stroke: red;
}