



The main idea of this card is to show the energy consumption of your devices as a percentage of the main entity (your entity for tracking whole house consumption).
My electricity meter is a Sagemcom XT211, I made a custom ESPHome component to read data from it (or any other DLMS/COSEM PUSH meter using RS485).
The card is designed to resemble the Home Assistant Energy panel style. The auto color option will use the colors in the same order as the energy panel.
energy-line-gaugeenergy-line-gauge folder inside your config/www folder and place the files in thereui-lovelace-card.yaml
```yaml
resources:``
Or alternatively set it up via the UI:Configuration -> Lovelace Dashboards -> Resources (TAB)`
For more guidance check out the docs.Version 2.0 added a Visual Editor to make the configuration easier.
You can find the Card in your Card Selector or by scrolling down to the bottom of the Card Selector and selecting Manual Card.
Then you can paste the following code into the Card Editor:
type: 'custom:energy-line-gauge'
Some features are not yet available in the Visual Editor. For example the ability to set min and max to be an entity or color auto.
type: 'custom:energy-line-gauge'
entity: sensor.glow_power_consumption
title: Power Consumption
subtitle: Glow
title_position: top-left
title_text_size: 2
title_text_style: shadow-light
title_text_color: gray
subtitle_text_color: black
min: 0
max: sensor.glow_power_consumption
precision: 0
unit: W
cutoff: 5
offset: 1d
sorting: value-desc
position: left
text_size: 2.5
text_style: weight-bold
text_color: auto
line_height: 3
corner: 'square'
state_content_separator: '|'
line_separator: true
line_separator_width: 'each010'
line_text_color: auto
color: "#00aafa"
color_bg:
- 40
- 40
- 40
line_text_position: 'bottom-right'
line_text_size: 1.5
line_text_style: shadow-medium
line_text_overflow: fade
overflow_direction: right
tap_action:
action: more-info
entity: sensor.glow_power_consumption
hold_action:
action: none
double_tap_action:
action: none
legend_hide: false
legend_all: false
legend_position: bottom-center
legend_alignment: center
legend_indicator: icon-fallback
legend_text_size: 1
legend_text_style: italic
legend_text_color: gray
show_delta: false
delta_position: bottom-center
untracked_legend: true
untracked_legend_label: Untracked
untracked_legend_icon: mdi:flash
untracked_legend_indicator: icon-fallback
untracked_state_content:
- name
- state
untracked_line_state_content:
- percentage
suppress_warnings: false
statistics: false
statistics_day_offset: 1
statistics_period: 'hour'
statistics_function: 'mean'
severity: true
severity_levels:
- from: 50
color: red
- from: 100
color: yellow
- form: 200
color: green
severity_blend: false
entities:
- entity: sensor.plug_0_power
name: Plug 0
icon: mdi:flash
color: "auto"
cutoff: 5
unit: W
multiplier: 1
precision: 0
state_content:
- name
- state
- percentage
line_state_content:
- percentage
legend_indicator: '-'
- entity: sensor.plug_1_power
attribute: device_class
name: Plug 1
color:
- 244
- 189
- 74
There are a lot of settings you can customize your sensors with:
| Setting | type | default | example | description |
|---|---|---|---|---|
entity |
entityID | !required | sensor.power | You can specify the entity_id here as well. |
attribute |
string | none | battery_voltage | Replace the state with the value of this entity attribute. Does not work when using statistics. |
title |
string | none | Power Consumption | The title of the Card (font_size: 2rem). Supports templating. |
subtitle |
string | none | Glow | Text in gray below the title (font_size: 1rem). Supports templating. |
title_position |
PositionType | top-left |
left | Position of the title see examples |
title_text_size |
number | 2 |
1.5 | Font size of the title, subtitle is 2x smaller. |
title_text_style |
TextStyleType | none | ['italic'] | Text style of the Title ans Subtitle see examples and hierarchy |
title_text_color |
ColorType | var(--primary-text-color) |
gray | Text color of title. |
subtitle_text_color |
ColorType | var(--secondary-text-color) |
black | Text color of subtitle. |
min |
number or entityID | 0 |
100 | The minimum value of the gauge. Can be an entity_id. |
max |
number or entityID | entity | sensor.power | The maximum value of the gauge. Can be an entity_id. |
precision |
number | 0 |
2 | The number of decimals to display. |
unit |
string | none | W | This string will be appended to the end of the value. Supports templating. |
cutoff |
number | 0 |
10 | Any entity with a value below or equal to this will not be displayed or counted. |
offset |
string | none | 1d | Offset state into the past see more. |
sorting |
SortingType | none | alpha-asc | Sort the line and legend entities see more. |
line_height |
number | 3 |
2 |
$ claude mcp add energy-line-gauge \
-- python -m otcore.mcp_server <graph>