Profile
Back to NewsBack
GitHub Trending 11 min
Reader Mode
benjamin-dcs/gauge-card-pro: Build beautiful Gauge cards using 🌈 gradients and 🛠️ templates

benjamin-dcs/gauge-card-pro: Build beautiful Gauge cards using 🌈 gradients and 🛠️ templates

18 hours ago

Gauge Card Pro

Build beautiful Gauge cards using 🌈 gradients and 🛠️ templates!

[!NOTE]
Need help with your configuration? Checkout my official Gauge Card Pro Assistant!

Description

Inspired by the idea to be able to recreate the Home Assistant native Energy Gauge Cards I created Gauge Card Pro. Built on top of the Home Assistant Gauge card, but with many more features and beautiful look-and-feel!

  • 🌈 Native gradient support for segments
  • ✌️ Two gauges in one
  • 🛠️ Use templates for the majority of the fields
  • ↔ Ability to start severity gauges from the center
  • ✨ Additional icon indicators next to the gauge
  • 🪛 Several styling options
  • 🎨 Every element in the card can have its colour defined. This can be a single colour or two colours for light- or darkmode. Of course, allows templating!
  • 👬 Set value and value_text independently
  • 👀 Two labels underneath the gauge
  • 🎨 Automatic color interpolation for severity gauges
  • 😶‍🌫️ Native ability to hide the background
image

Support This Project

If you find Gauge Card Pro useful, consider supporting its development:

Buy Me a Coffee</a> GitHub Sponsors</a>

Table of contents

- Min/Max Indicator Configuration variables - Inner Gauge Configuration variables - Setpoint Configuration variables - Titles Configuration variables - Title Configuration variables - Value-Texts Configuration variables - Value-Text Configuration variables - Icon Configuration variables - Icon Template object - Features Configuration variables - Shapes Configuration variables - Custom styling options - Fixed single value - Single template value - Light/Dark Mode fixed values - Light/Dark Mode template values - Fixed list with from - Fixed list with pos - Template list - Install via HACS (recommended) - Manual - Translations

Configuration variables

[!IMPORTANT]
When using the Visual Editor to clear/empty one of the following fields, there is some yaml-code left which prevents the default values from working:
> - primary
- primary_unit
- secondary
- secondary_unit
> Delete the line entirely from your yaml-code to restore the default functionality for these fields

| Name | Type | Default | Description | Templatable | | :-------------------- | :-------------------------------------------------------------------- | :-------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | | type | string | | custom:gauge-card-pro | | | header | string | | Header of the card | | | entity | string | Optional | Entity for main-gauge value, templates, actions and features (e.g.: {{ states(entity) }}) | | | entity2 | string | Optional | Entity for inner-gauge value, and templates (e.g.: {{ states(entity2) }}) | | | layout | string | default | Layout of the gauge. Valid values are default and equal. | | | needle_style | string | default | Needle style to use. Valid values are default and ha. | | | inner | inner object | | Configuration for the inner gauge. Use inner: {} to use all defaults for the inner gauge | | | attribute | string | Optional | Attribute of entity to use for main-gauge value | | | min | number | 0 | Minimum value for graph | ✔️ (only templatable in code-editor/yaml) | | max | number | 100 | Maximum value for graph | ✔️ (only templatable in code-editor/yaml) | | needle | boolean | false | Show the gauge as a needle gauge | | | needle_color | string or map1 | var(--primary-text-color) | Color of the needle | ✔️ | | segments | list2 | Optional | List of colors and their corresponding start values | ✔️ | | severity_centered | boolean | Optional | Severity gauge (requires disabled needle) start at the center | | | severity_color_mode | string | basic | Sets the mode to determine/render the color of the value of a severity gauge. | | | | | | • basic: Color determined based on segments | | | | | | • interpolation: Color determined based on segments, interpolated between segment positions | | | | | | • gradient: Show part of the gradient-arc as value | | | gradient | boolean | false | Shows segments as a gradient (requires needle) | | | gradient_background | boolean | false | Shows the background as a gradient for severity gauge (requires disabled needle) | | | gradient_resolution | string or number | auto | Level of detail for the gradient. Must be auto or a number indicating the amount of segments to create | | | min_indicator | min/max indicator object | | Configuration of the min indicator | | | max_indicator | min/max indicator object | | Configuration of the max indicator | | | setpoint | setpoint object | | Configuration for the setpoint needle | | | round | string | off | Rounds the ends of the gauge. Valid values are off, full, medium and small | | | titles | titles object | | Configuration for the titles beneath the gauge | | | value_texts | value_texts object | | Configuration for the value texts inside the gauge | | | icons | icons object | | Configuration for the icons | | | hide_background | boolean | false | Hides the background and border of the card | | | shapes | shapes object | | Configuration of the shapes several elements | | | value | template | state of entity | Value for graph | ✔️ (only available in code-editor/yaml) | | animation_speed | string | normal | Animation speed of value elements. Valid values are normal, fast and off | | | entity_id | string or list | Optional | Only reacts to the state changes of these entities. This can be used if the automatic analysis fails to find all relevant entities | | | ACTIONS | | | | | | tap_action | action | more-info | Home assistant action to perform on tap. See official documentation for more info | | | hold_action | action | none | Home assistant action to perform on hold. See official documentation for more info | | | double_tap_action | action | none | Home assistant action to perform on double_tap. See official documentation for more info | | | FEATURES | | | | | | feature_entity | string | | Entity used for features and (optional) HVAC icons. If not set entity will be used | | | features | features object | | Configuration of the additional features | |

Inner Gauge Configuration variables

| Name | Type | Default | Description | Templatable | | :-------------------- | :-------------------------------------------------------------------- | :-------------------------- | :--------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | | attribute | string | Optional | Attribute of entity2 to use for inner-gauge value | | | min | number | min of main gauge | Minimum value for graph | ✔️ (only templatable in code-editor/yaml) | | max | number | max of main gauge | Maximum value for graph | ✔️ (only templatable in code-editor/yaml) | | mode | string | severity | Sets the mode of the inner gauge | | | | | | • severity: Shows the inner gauge as a rotating single color | | | | | | • static: Shows all the segments without any further indications | | | | | | • needle: Shows all the segments with a needle | | | | | | • on_main: Shows a needle on the main-gauge. min and/or max of the inner-gauge can still be used | | | needle_color | string or map1 | var(--primary-text-color) | Color of the needle | ✔️ | | segments | list2 | Optional | List of colors and their corresponding start values | ✔️ | | severity_centered | boolean | Optional | Severity gauge (requires disabled needle) start at the center | | | severity_color_mode | string | basic | Sets the mode to determine/render the color of the value of a severity gauge. | | | | | | • basic: Color determined based on segments | | | | | | • interpolation: Color determined based on segments, interpolated between segment positions | | | | | | • gradient: Show part of the gradient-arc as value | | | gradient | boolean | false | Shows segments as a gradient | | | gradient_background | boolean | false | Shows the background as a gradient for severity gauge (requires disabled needle) | | | gradient_resolution | string or number | auto | Level of detail for the gradient. Must be auto or a number indicating the amount of segments to create | | | min_indicator | min/max indicator object | | Configuration of the min indicator | | | max_indicator | min/max indicator object | | Configuration of the max indicator | | | setpoint | setpoint object | | Configuration for the setpoint needle | | | value | template | state of entity2 | Value for graph | ✔️ (only available in code-editor/yaml) | | round | string | off | Rounds the ends of the gauge. Valid values are off, full and small |

Min/Max Indicator Configuration variables

| Name | Type | Default | Description | Templatable | | :------------ | :--------------------------------------------- | :------------------- | :--------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | | type | string | Required | attribute, entity, number or template | | | value | value corresponding to the type | Required | Value of the min or max indicator | | | | | | • attribute: attribute of entity (main-gauge) or entity2 (inner-gauge) | | | | | | • entity: Entity_id | | | | | | • number: Fixed number | | | | | | • template: Template that returns a number | ✔️ | | color | string or map1 | rgb(255, 255, 255) | Color of the min or max indicator | | | opacity | number | 0.8 | Opacity of the min or max indicator | | | label | boolean | false | Enables a label indicating the value (main gauge only) | | | label_color | string | #111111 | Color of the label | | | precision | number | Optional | Amount of decimals to round the label to | |

Setpoint Configuration variables

| Name | Type | Default | Description | Templatable | | :---------- | :--------------------------------------------- | :------------------- | :--------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | | type | string | Required | attribute, entity, number or template | | | value | value corresponding to the type | Required | Value of the needle | | | | | | • attribute: attribute of entity (main-gauge) or entity2 (inner-gauge) | | | | | | • entity: Entity_id | | | | | | • number: Fixed number | | | | | | • template: Template that returns a number | ✔️ | | color | string or map1 | var(--error-color) | Color of the needle | ✔️ | | label | boolean | false | Enables a label indicating the value (main gauge only) | | | precision | number | Optional | Amount of decimals to round the label to | |

Titles Configuration variables

| Name | Type | Default | | :---------- | :--------------------------------------------- | :------- | | primary | title object | Optional | | secondary | title object | Optional |

Title Configuration variables

| Name | Type | Default | Description | Templatable | | :---------- | :--------------------------------------------- | :--------------------------------------- | :---------- | :-------------------------------------------------------------------------- | | value | string | Optional | Text value | ✔️ | | color | string or map1 | var(--primary-text-color) | Color | ✔️ | | font_size | string | 15px for primary, 14px for secondary | Font-size | ✔️ |

Value-Texts Configuration variables

| Name | Type | Default | | :---------- | :------------------------------------------------------- | :------- | | primary | value-text object | Optional | | secondary | value-text object | Optional |

Value-Text Configuration variables

| Name | Type | Default | Description | Templatable | | :-------------------- | :------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------ | :------------------------------------------------------------ | :-------------------------------------------------------------------------- | | value | string | value or state of entity for primary, inner.value or state of entity2 for secondary | Text. Use "" to overwrite the default | ✔️ | | color | string or map1 | var(--primary-text-color) | Color | ✔️ | | unit_of_measurement | string | unit of measurement of entity for primary or entity2 for secondary | Unit of measurement. Use "" to overwrite the default | ✔️ | | unit_before_value | boolean | false | Place unit of measurement in front of value | | | font_size_reduction | number [0-15] | 0 | Value by which the value-text is reduced (only for primary) | ✔️ (only templatable in code-editor/yaml) | | tap_action | Home Assistant Tap action | | | | | hold_action | Home Assistant Hold action | | | | | double_tap_action | Home Assistant Double tap action | | | |

[!NOTE]
> - Both primary and secondary value-texts can be an icon. Icons are activated for texts formatted as: icon(...). For example: icon(mdi:gauge). Icons cannot be combined with text.
- Use primary: "" and/or secondary: "" to overwrite/disable the entire value_text (including unit)
- Use primary_unit: "" and/or secondary_unit: "" to overwrite/disable the entity unit
- No unit is added for non-numeric value_texts.

Icons Configuration variables

| Name | Type | Default | | :------ | :-------------------------------------------- | :------- | | left | icon object | Optional | | right | icon object | Optional |

Icon Configuration variables

| Name | Type | Default | Description | Templatable | | :------------------ | :------------------------------------------------------------------------------------------------------ | :-------------------------- | :------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------- | | type | string | Required | battery, hvac-mode, swing-mode, or template | | | value | string | Optional/Required | value corresponding to the type | | | | | | • battery: Battery entity_id (required) | ✔️ | | | | | • hvac-mode: Climate entity_id (optional, otherwise feature_entity is used) | | | | | | • swing-mode: Climate entity_id (optional, otherwise feature_entity is used) | | | | | | • template: Template that returns an Icon Template object (required | ✔️ | | state | string | Optional | Only available for battery: sensor indicating the charging state of the battery (valid states for charging are charging and on) | | | threshold | number | Optional | Only available for battery: threshold above which the icon is not displayed | | | hide_label | boolean | Optional | Only available for battery: hides the label | | | label_color | string or map1 | var(--primary-text-color) | Color of the label | ✔️ | | tap_action | Home Assistant Tap action | | | | | hold_action | Home Assistant Hold action | | | | | double_tap_action | Home Assistant Double tap action | | | |

Icon Template object

| Name | Type | Default | Description | | :------ | :----- | :------- | :------------------------------- | | icon | string | Required | Icon | | color | string | Optional | Color of the icon | | label | string | Optional | Label displayed beneath the icon |

##### Example

icons:
  left | right:
    type: template
    value: |
      {{
        { 
          "icon": "mdi:battery",
          "color": "blue",
          "label": (states('sensor.my_sensor') | int * 100) | string + "%"
        }
      }}

Features Configuration variables

Overview Feature

| Name | Type | Default | Description | | :--------- | :------ | :------ | :----------------------------------------------------------- | | type | string | | overview | | separate | boolean | false | Shows the overview page on a separate dedicated controls-row |

Temperature Control Feature

| Name | Type | Default | Description | | :----- | :----- | :------ | :------------------- | | type | string | | adjust-temperature |

Climate Fan Mode Feature

| Name | Type | Default | Description | | :---------- | :----- | :------- | :-------------------------------------- | | type | string | | climate-fan-modes | | fan_modes | list | Optional | List of Fan Modes available in the card |

Climate HVAC Mode Feature

| Name | Type | Default | Description | | :----------- | :----- | :------- | :--------------------------------------- | | type | string | | climate-hvac-modes | | hvac_modes | list | Optional | List of HVAC Modes available in the card |

Climate Preset Mode Feature

| Name | Type | Default | Description | | :------------- | :----- | :------- | :----------------------------------------- | | type | string | | climate-preset-modes | | preset_modes | list | Optional | List of Preset Modes available in the card |

Climate Swing Mode Feature

| Name | Type | Default | Description | | :------------ | :----- | :------- | :---------------------------------------- | | type | string | | climate-swing-modes | | swing_modes | list | Optional | List of Swing Modes available in the card |

Custom Feature

Renders one row of your own buttons. Only one custom feature per card is used. Unlike the climate features it doesn't need a (climate) feature_entity, so it also works on non-climate cards.

| Name | Type | Default | Description | | :---------------- | :----- | :-------------------- | :-------------------------------------------------------------------------------- | | type | string | | custom | | page_icon | string | mdi:tune | Icon of this page, shown on the page-button and on the overview | | page_icon_color | string | var(--purple-color) | Color of the page-icon | | controls | list | | List of control objects. Max. 5 controls fit in a controls-row |

##### Control object

| Name | Type | Default | Description | | :---------------- | :----- | :------------------------ | :-------------------------------------------------------------------------------------------------------------- | | icon | string | | Icon of the button, e.g. mdi:plus | | action | string | | Action to perform as ., e.g. light.turn_on. | | entity | string | feature_entity/entity | Entity to perform the action on | | data | object | Optional | Action data. entity_id

... (README truncated for length)

Chat with me