• Stars
    star
    187
  • Rank 206,464 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dual gauge custom card for Lovelace in Home Assistant

Dual gauge card

Two gauges in one, built mostly with CSS.

MIT license hacs_badge

dual-gauge-card-screenshot

Heavily inspired by ciotlosm's gauge-card, but completly written from scratch.

Installation

Use HACS (recommended) or download dual-gauge-card.js and place it in your www directory.

In your ui-lovelace.yaml add this:

  - url: /community_plugin/dual-gauge-card/dual-gauge-card.js
    type: js

If you don't use HACS please change the url accordingly.

Config

Name Type Default Description
title string Common title
min int 0 minimum value
max int 100 maximum value
colors object color config (optional)
background_color string background color of the gauges
shadeInner bool true shade (darken) colors of the inner gauge by 25%
cardwidth int 300 width of the card in pixels (see below)
outer object config for the outer gauge
inner object config for the inner gauge

gauge config

Both gauges have the same attributes:

Name Type Default Description
entity string entity id
attribute string use this attribute of the entity instead of its state (optional)
label string label for this gauges value (optional)
unit object unit to add to the value (optional)
min int minimum value
max int maximum value
colors object color config (optional)

cardwidth

You may use the config value cardwidth to set the overall width of the card as an absolute value in pixels. All elements of the gauge are sized relative to this so that the gauge scales to this, but the card is not responsive for now, i.e. it doesn't resize automatically.

color config

Colors can be configured as list of pairs of each a color and a minimum value.

If a gauges value is greater than or equal to one of those minimum values, the according color is used for that gauge. If no color is found, the last color in the list is used as a fallback. To use a single color regardless of the value just use a single list entry with any value to always trigger the fallback.

By default, colors for the inner gauge are shaded by 25% (see option shadeInner).

The list is automatically sorted so you don't need to do that in your config - but I recommend it anyways.

common config vs. individual config

Colors, as well as the min and max values, may be configured once for both gauges or individually for each gauge. Individual values override common values.

Example

The example on the screenshot is configured like this:

- type: custom:dual-gauge-card
  title: Living room
  min: -20
  max: 40
  outer:
    entity: climate.living_room
    attribute: current_temperature
    label: "Current"
    unit: "°C"
  inner:
    entity: climate.living_room
    label: "Target"
    attribute: temperature
    unit: "°C"
  colors:
    - color: "var(--label-badge-red)"
      value: 27.5
    - color: "var(--label-badge-green)"
      value: 25
    - color: "var(--label-badge-yellow)"
      value: 18
    - color: "var(--label-badge-blue)"
      value: 0
    - color: "var(--paper-blue-400)"
      value: -40

In this example, the outer gauge has individual min and max values and uses default colors, whereas the inner gauge has individual colors and uses the common min and max values.

- type: custom:dual-gauge-card
  title: Living room
  min: -20
  max: 40
  outer:
    entity: climate.living_room
    attribute: current_temperature
    label: "Current"
    unit: "°C"
    min: -30
    max: 50
  inner:
    entity: climate.living_room
    label: "Target"
    attribute: temperature
    unit: "°C"
    colors:
      - color: "var(--label-badge-green)"
        value: 25
      - color: "var(--label-badge-yellow)"
        value: 18
      - color: "var(--label-badge-blue)"
        value: 0

More Repositories

1

button-card

❇️ Lovelace button-card for home assistant
JavaScript
1,890
star
2

spotify-card

Spotify playlist card for Home Assistant card
TypeScript
379
star
3

decluttering-card

🧹 Declutter your lovelace configuration with the help of this card
TypeScript
360
star
4

bar-card

Customizable Animated Bar card for Home Assistant Lovelace
TypeScript
333
star
5

stack-in-card

🛠 group multiple cards into one card without the borders
TypeScript
267
star
6

upcoming-media-card

📺 A card to display upcoming episodes and movies from services like: Plex, Kodi, Radarr, Sonarr, and Trakt.
JavaScript
260
star
7

surveillance-card

A custom component for displaying camera feeds in the style of a surveillance system.
JavaScript
244
star
8

boilerplate-card

A community driven blueprint for best practices
TypeScript
225
star
9

flex-table-card

Highly Flexible Lovelace Card - arbitrary contents/columns/rows, regex matched, perfect to show appdaemon created content and anything breaking out of the entity_id + attributes concept
JavaScript
184
star
10

secondaryinfo-entity-row

Custom entity row for HomeAssistant, providing additional types of data to be displayed in the secondary info area of the Lovelace Entities card
JavaScript
169
star
11

circle-sensor-card

A custom component for displaying sensor values as cards or elements
JavaScript
166
star
12

canvas-gauge-card

The card makes it possible to use gauges from https://canvas-gauges.com/
TypeScript
158
star
13

tracker-card

A card to track custom cards and custom component updates.
JavaScript
110
star
14

bignumber-card

JavaScript
110
star
15

button-entity-row

Adds buttons to call services to entity cards
JavaScript
103
star
16

check-button-card

Check Button Card is a button that tracks when it is last pressed, for the Home Assistant Lovelace front-end using MQTT auto discovery.
TypeScript
103
star
17

information

88
star
18

entity-attributes-card

Entity Attributes
JavaScript
64
star
19

group-element

A group element for picture-elements with dynamic toggle capability
JavaScript
60
star
20

light-entity-row

Entity row for lights with sliders for adjusting different values based on features
JavaScript
55
star
21

custom-card-helpers

Custom Card Helper Functions/Types for Developers
TypeScript
48
star
22

gauge-card

JavaScript
44
star
23

monster-card

⚠️ DEPRECATED - MOVE TO AUTO-ENTITIES
JavaScript
35
star
24

unused-card

All your unused entities in a list
TypeScript
32
star
25

plan-coordinates

JavaScript
28
star
26

rmv-card

Custom card for the RMV component.
JavaScript
27
star
27

group-card

JavaScript
23
star
28

state-attribute-element

Give you the specified attribute of an entity
JavaScript
22
star
29

favicon-counter

Show a notification count badge.
JavaScript
19
star
30

text-element

An element that can be used to show static text on the `picture-elements` card
JavaScript
19
star
31

cover-element

JavaScript
17
star
32

camera-card

📺 Camera Card for Lovelace
JavaScript
17
star
33

ext-weblink

Adds ext weblink with icon to picture-elements or entity cards
JavaScript
16
star
34

state-element

Give you the option to prefix the state-label with a formated string.
JavaScript
16
star
35

nintendo-wishlist-card

Displays a card showing Nintendo Switch games that are on sale from your wish list.
JavaScript
15
star
36

timer-card

⏲ Lovelace Timer Card
TypeScript
11
star
37

home-setter

JavaScript
10
star
38

pc-card

💵 Personal Capital Card
JavaScript
8
star
39

text-action-element

JavaScript
7
star
40

username-element

Show the current logged in user.
JavaScript
7
star
41

beer-card

This card give you a list of your wishlist items.
JavaScript
3
star