Modern Circular Gauge

February 28, 2026 · View on GitHub

release downloads-latest downloads-total stars forum

ko-fi

Modern Circular Gauge

Modern look at the default Home Assistant gauge card

cards

Features

  • Card and badge gauge
  • Attribute support
  • Secondary info under the state with two size options
  • Tertiary info above the state
  • Half gauge style
  • Full gauge style
  • Combined primary and tertiary entity as pie chart
  • Timer and timestamp support
  • Sections support
  • Needle
  • Jinja and JavaScript Template support for min, max, entity, name, label, icon, secondary, tertiary and state_text
  • Color segments with gradient
  • Dual gauge or triple gauge
  • Dual value representing as a dot on the same gauge
  • Small history graph
  • Visual editor with template support

Install

HACS

Modern circular gauge is available in HACS.

Simply click on the button to open the repository in HACS or just search for "Modern Circular Gauge" and download it through the UI.

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Manual

  1. Download modern-circular-gauge.js from latest release

  2. Put modern-circular-gauge.js file into your config/www folder.

  3. Add a reference to modern-circular-gauge.js via two ways:

    • Via UI: SettingsDashboardsMore Options iconResourcesAdd Resource → Set Url as /local/modern-circular-gauge.js → Set Resource type as JavaScript Module. Note: If you do not see the Resources menu, you will need to enable Advanced Mode in your User Profile

    Open your Home Assistant instance and show your dashboard resources.

    • Via YAML: Add following code to lovelace section in your configuration.yaml file
        resources:
            - url: /local/modern-circular-gauge.js
              type: module
      

Options

Card and badge can be configured through visual editor or by yaml. Both Jinja and JavaScript templates are supported on selected options, configurable via yaml or visual editor.

Card options

NameTypeDefaultDescriptionSupports template
typestring'custom:modern-circular-gauge'
entitystringRequiredEntity. May contain templates
attributestringOptionalUse entity attribute instead of state
namestringOptionalCustom title. May contain templates
iconstringOptionalCustom icon. May contain templates
show_entity_picturebooleanfalseShow entity picture instead of icon
icon_entityprimary or secondary or tertiaryprimarySelects which entity to use for icon selection and color segments
icon_sizenumberOptionalIcon size in %
icon_vertical_positionnumberOptionalIcon vertical position in % (50% indicates center)
minnumber or string0Minimum gauge value. May contain templates
maxnumber or string100Maximum gauge value. May contain templates see example
combine_gaugesbooleanOptionalCombines primary and secondary entity into one gauge, useful for comparing two values. Only available in full gauge type. Tertiary entity is not supported
unitstringOptionalCustom unit
unit_superscriptbooleantrueSuperscripted unit
decimalsnumberOptionalAdjusts decimal places
labelstringOptionalLabel under the state, only used when state_size is set to big, see secondary. May contain templates
label_font_sizenumber0.49emLabel font size in px
header_positiontop or bottombottomHeader position
show_statebooleantrueShow entity state
show_unitbooleantrueShow state unit
show_headerbooleantrueShow card header
show_iconbooleantrueShow card icon
show_graphbooleanfalseShow graph above main state
graph_hours_to_shownumber24Hours to show on the graph
graph_points_per_hournumber2How detailed graph should be
show_in_graphbooleantrueShow primary entity on the graph
adaptive_graph_rangebooleanfalseAdapt y-axis range to min and max value of the entity history
show_secondsbooleantrueShow seconds when displaying time based entities
needlebooleanfalse
state_textstringEntity stateDisplayed state override. May contain templates
adaptive_icon_colorbooleanfalseMakes icon color adaptive to current color segment
adaptive_state_colorbooleanfalseMakes state color adaptive to current color segment
adaptive_label_colorbooleanfalseMakes label color adaptive to current color segment
smooth_segmentsbooleanfalseSmooth color segments for primary gauge
start_from_zerobooleanfalseStart gauge from zero instead of min
inverted_modebooleanfalseInverts gauge fill logic and ignores start_from_zero, 0 -> full gauge, 100 -> empty gauge
state_font_sizenumber24Initial state size in px
state_font_familystringOptionalState font family
header_font_sizenumber14Gauge header font size in px
header_offsetnumber0Gauge header vertical offset in px
gauge_typestandard, half, fullstandardGauge style type, standard for 270°, half for 180° and full for 360° style
rotate_gaugeboolean,falseWhen true full gauge is rotated 180° so it starts from the top
gauge_radiusnumber47Gauge radius
gauge_background_styleobjectOptionalGauge background style, see gauge element style object
gauge_foreground_styleobjectOptionalGauge foreground style, see gauge element style object
segmentslistColor segments list, see color segments object
secondaryobject or stringOptionalSecondary info to display under the state, see secondary entity object. May contain templates see example
tertiaryobject or stringOptionalSecondary info to display above the state, see tertiary entity object. May contain templates see example

Badge options

NameTypeDefaultDescriptionSupports template
typestring'custom:modern-circular-gauge-badge'
entitystringRequiredEntity. May contain templates.
attributestringOptionalUse entity attribute instead of state
namestringOptionalCustom title. May contain templates
iconstringEntity iconCustom icon. May contain templates
show_entity_picturebooleanfalseShow entity picture instead of icon
minnumber or string0Minimum gauge value. May contain templates
maxnumber or string100Maximum gauge value. May contain templates
unitstringOptionalCustom unit
decimalsnumberOptionalAdjusts decimal places
show_nameboolfalseShow badge name
show_statebooltrueShow entity state
show_iconbooltrueShow icon
show_unitbooltrueShow unit
show_secondsbooleantrueShow seconds when displaying time based entities
needleboolfalse
start_from_zerobooleanfalseStart gauge from zero instead of min
inverted_modebooleanfalseInverts gauge fill logic and ignores start_from_zero, 0 -> full gauge, 100 -> empty gauge
gauge_background_styleobjectOptionalGauge background style, see gauge element style object
gauge_foreground_styleobjectOptionalGauge foreground style, see gauge element style object
state_textstringEntity stateDisplayed state override. May contain templates
smooth_segmentsbooleanfalseSmooth color segments
segmentslistColor segments list, see color segments object

Color segment object

NameTypeDefaultDescriptionSupports template
fromnumberRequiredStarting value of color segment. May contain templates
colorstringRequiredColor value of color segment. May contain templates
labelstringOptionalColor segment label to display instead of state. May contain templates

Secondary entity object

NameTypeDefaultDescriptionSupports template
entitystringOptionalSecondary entity. May contain templates
attributestringOptionalUse entity attribute instead of state
unitstringOptionalCustom unit
unit_superscriptbooleanfalseSuperscripted unit
show_gaugenone, inner, outernoneDisplay secondary info as dot on main gauge or on inner gauge
minnumberOptionalMinimum inner gauge value. May contain templates
maxnumberOptionalMaximum inner gauge value. May contain templates
decimalsnumberOptionalAdjusts decimal places
labelstringOptionalLabel under the state. May contain templates
label_font_sizenumber0.49emLabel font size in px
state_sizesmall or bigsmallSecondary state size
show_statebooleantrueShow secondary state
show_unitbooleantrueShow secondary unit
show_in_graphbooleanfalseShow secondary entity on the graph
adaptive_graph_rangebooleanfalseAdapt y-axis range to min and max value of the entity history
smooth_segmentsbooleanfalseSmooth color segments for secondary gauge
show_secondsbooleantrueShow seconds when displaying time based entities
start_from_zerobooleanfalseStart gauge from zero instead of min
inverted_modebooleanfalseInverts gauge fill logic and ignores start_from_zero, 0 -> full gauge, 100 -> empty gauge
state_font_sizenumber10 or 24State size in px
state_font_familystringOptionalState font family
state_textstringEntity stateDisplayed state override. May contain templates
gauge_radiusnumber42Gauge radius
gauge_background_styleobjectOptionalGauge background style, see gauge element style object
gauge_foreground_styleobjectOptionalGauge foreground style, see gauge element style object
needlebooleanfalse
adaptive_state_colorbooleanfalseMakes state color adaptive to current color segment based on show_gauge config
adaptive_label_colorbooleanfalseMakes label color adaptive to current color segment based on show_gauge config
segmentslistColor segments list, see color segments object

Tertiary entity object

NameTypeDefaultDescriptionSupports template
entitystringOptionalSecondary entity. May contain templates
attributestringOptionalUse entity attribute instead of state
unitstringOptionalCustom unit
unit_superscriptbooleanfalseSuperscripted unit
decimalsnumberOptionalAdjusts decimal places
show_gaugenone, inner, outernoneDisplay secondary info as dot on main gauge or on inner gauge
minnumberOptionalMinimum inner gauge value. May contain templates
maxnumberOptionalMaximum inner gauge value. May contain templates
labelstringOptionalLabel above the state. May contain templates
label_font_sizenumber0.49emLabel font size in px
show_statebooleantrueShow secondary state
show_unitbooleantrueShow secondary unit
show_in_graphbooleanfalseShow tertiary entity on the graph
adaptive_graph_rangebooleanfalseAdapt y-axis range to min and max value of the entity history
smooth_segmentsbooleanfalseSmooth color segments for tertiary gauge
show_secondsbooleantrueShow seconds when displaying time based entities
start_from_zerobooleanfalseStart gauge from zero instead of min
inverted_modebooleanfalseInverts gauge fill logic and ignores start_from_zero, 0 -> full gauge, 100 -> empty gauge
state_font_sizenumber10State size in px
state_font_familystringOptionalState font family
state_textstringEntity stateDisplayed state override. May contain templates
gauge_radiusnumber37Gauge radius
gauge_background_styleobjectOptionalGauge background style, see gauge element style object
gauge_foreground_styleobjectOptionalGauge foreground style, see gauge element style object
needlebooleanfalse
adaptive_state_colorbooleanfalseMakes state color adaptive to current color segment based on show_gauge config
adaptive_label_colorbooleanfalseMakes label color adaptive to current color segment based on show_gauge config
segmentslistColor segments list, see color segments object

Gauge element style object

NameTypeDefaultDescription
widthnumber6 or 4, 14 for badgeGauge element width
colorstring or adaptiveOptionalGauge element color
opacitynumberOptionalGauge element opacity

Templates

Templates are supported on couple essential config options. Both Jinja and JavaScript templates are supported. The two main differences between them is syntax and the fact that JavaScript templates are processed client side so theoretically JavaScript templates should be faster.

JavaScript templates

JavaScript templates does not use the Home Assistant implementation. In short it's a JavaScript code block performed client side. To use JavaScript templates, encase the code between three square brackets [[[ code ]]].

Under the hood JavaScript templates uses Home Assistant Javascript Templates. While writing templates please consult the proper section about the available variables and methods.

JavaScript template example

type: custom:modern-circular-gauge
entity: sensor.room_temp
unit: °C
name: Temperature
max: "[[[ states('input_number.max_number') ]]]"

Jinja templates

Jinja templates uses the Home Assistant implementation. Templates are processed on the server.

Jinja template example

type: custom:modern-circular-gauge
entity: sensor.room_temp
unit: °C
name: Temperature
max: "{{ states('input_number.max_number') }}"

Examples

Simple gauge

simple_gauge

type: custom:modern-circular-gauge
entity: sensor.power_consumption
max: 1000

Gauge with additional info

simple_gauge_secondary_info

type: custom:modern-circular-gauge
entity: sensor.power_consumption
secondary:
  entity: sensor.voltage
max: 1000

Gauge with templated additional info and segments

gauge_templates

type: custom:modern-circular-gauge
entity: sensor.room_temp
unit: °C
name: Temperature
secondary: >-
  {% if is_state("binary_sensor.room_temp_rising", "on") %} Rising {% elif
  is_state("binary_sensor.room_temp_falling", "on") %} Falling {% endif %}
max: "{{states('input_number.max_number')}}"
min: 10
header_position: bottom
needle: true
segments:
  - from: 13
    color:
      - 11
      - 182
      - 239
  - from: 19
    color:
      - 43
      - 255
      - 0
  - from: 24
    color:
      - 252
      - 161
      - 3

Gauge with bigger secondary and labels

labels

type: custom:modern-circular-gauge
entity: sensor.power_consumption
label: Power
max: 1000
tap_action:
  action: none
secondary:
  entity: sensor.voltage
  state_size: big
  label: Voltage
header_position: bottom
name: Power plug

Dual gauge

dual_gauge

type: custom:modern-circular-gauge
name: Dual gauge
min: 10
needle: false
secondary:
  entity: sensor.target_room_temp
  unit: °C
  show_gauge: inner
  min: 10
  max: 30
max: 30
entity: sensor.room_temp
unit: °C

Templated icon

templated icon

type: custom:modern-circular-gauge
entity: sensor.room_temp
unit: °C
name: Temperature
icon: >-
  {% if is_state("binary_sensor.room_temp_rising", "on")
  %}mdi:thermometer-chevron-up{% elif is_state("binary_sensor.room_temp_falling",
  "on") %}mdi:thermometer-chevron-down{% endif %}
max: 30
min: 10
needle: true
smooth_segments: true
adaptive_icon_color: true
segments:
  - from: 13
    color:
      - 11
      - 182
      - 239
  - from: 19
    color:
      - 43
      - 255
      - 0
  - from: 24
    color:
      - 252
      - 161
      - 3

Gradient background and foreground

brave_xfJk28FEFZ

type: custom:modern-circular-gauge
entity: sensor.room_temp
unit: °C
name: Temperature
gauge_foreground_style:
  color: adaptive
gauge_background_style:
  width: 2
  color: adaptive
max: 30
min: 10
smooth_segments: true
adaptive_icon_color: true
segments:
  - from: 13
    color:
      - 11
      - 182
      - 239
  - from: 19
    color:
      - 43
      - 255
      - 0
  - from: 24
    color:
      - 252
      - 161
      - 3
  - color:
      - 255
      - 0
      - 0
    from: 30

Remaining timer

timer

type: custom:modern-circular-gauge
entity: timer.example_timer
needle: true
name: Timer
gauge_background_style:
  color: aqua
  opacity: 0.2
icon: mdi:clock

Development

  1. Clone this repository into your config/www folder using git:
$ git clone https://github.com/selvalt7/modern-circular-gauge.git
  1. Add a reference to the card as shown here

Instructions

Requires nodejs & npm.

  1. Move into the modern-circular-gauge repo, checkout the dev branch & install dependencies:
$ cd modern-circular-gauge && git checkout dev && npm install
  1. Make changes to the source code.

  2. Build the source by running:

$ npm run build

The new modern-circular-gauge.js will be build in dist folder

  1. Refresh your browser to see changes

    Note: Make sure to disable browser cache