• Stars
    star
    158
  • Rank 237,131 (Top 5 %)
  • Language
    TypeScript
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

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

Repository Details

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

canvas-gauge-card

Build

This card is basically deprecated and do not expect maintainence.

Development

I recommend use vscode devcontainers. do

npm install
npm run build

Inside container you can build, start HA using vscode tasks.

This card allows you to use the awesome gauges at https://canvas-gauges.com/ in your lovelace GUI. This is still a very early and untested alpha version. Tested only on chrome and safari browsers.

If you want to support the developer, please support the lib devs of the canvas-gauges.

Screens

Here is a some different screens from my own setup. But the possibilites to make your own look and feel are great.

Usage

Download through HACS (recommended) or ...

Download the file canvas-gauge-card.js from the latest release to your home assistant config. Add a module link to the canvas-gauge-card.js file. The link needs to be the same as where you put it. Example:

resources:
  - url: /local/custom_cards/canvas-gauge-card.js
    type: module

Configure the card properties.

Skip nameproperty if you dont want the name with the shadow area to show.

Use the javascript names of properties from the examples at https://canvas-gauges.com/documentation/examples/. Click on an example that you like, check the JS version and copy the properties to the lovelace yaml file. Just remove the ',' after copy from site.

Example 1, simple half gauge

ui-lovelace.yaml:

Notice the differences in card_height and gauge/height to get correct half size for full circle, set both to same.

- type: custom:canvas-gauge-card
  entity: sensor.processor_use
  card_height: 125
  gauge:
    type: "radial-gauge"
    title: Processor (%)
    width: 220
    height: 220
    borderShadowWidth: 0
    borderOuterWidth: 0
    borderMiddleWidth: 0
    borderInnerWidth: 0
    minValue: 0
    maxValue: 100
    startAngle: 30
    ticksAngle: 180
    valueBox: false
    majorTicks:
      ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"]
    minorTicks: 2
    strokeTicks: true
    highlights: [{ "from": 80, "to": 100, "color": "rgba(200, 50, 50, .75)" }]
    borders: false

Example 2, simple half gauge with shadow text

ui-lovelace.yaml:

- type: custom:canvas-gauge-card
  entity: sensor.processor_use
  name: Processor (%)
  card_height: 145
  shadow_height: 15%
  font_size: 1em
  gauge:
    type: "radial-gauge"
    width: 220
    height: 220
    borderShadowWidth: 0
    borderOuterWidth: 0
    borderMiddleWidth: 0
    borderInnerWidth: 0
    minValue: 0
    maxValue: 100
    startAngle: 90
    ticksAngle: 180
    valueBox: false
    majorTicks:
      ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"]
    minorTicks: 2
    strokeTicks: true
    highlights: [{ "from": 80, "to": 100, "color": "rgba(200, 50, 50, .75)" }]
    borders: false

Example 3, simple full gauge with shadow text

ui-lovelace.yaml:

- type: custom:canvas-gauge-card
  entity: sensor.processor_use
  name: Processor (%)
  card_height: 210
  shadow_height: 12%
  font_size: 1em
  gauge:
    type: "radial-gauge"
    width: 220
    height: 220
    borderShadowWidth: 0
    borderOuterWidth: 0
    borderMiddleWidth: 0
    borderInnerWidth: 0
    minValue: 0
    maxValue: 100
    startAngle: 40
    ticksAngle: 280
    valueBox: false
    units: "%"
    majorTicks:
      ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"]
    minorTicks: 2
    strokeTicks: true
    highlights: [{ "from": 80, "to": 100, "color": "rgba(200, 50, 50, .75)" }]
    borders: false

Example 4, 4 gauges in a row in a horizontal-stack

This example shows gauges with or without text. This text are placed below the actual gauge this time.

No text version

---
- type: horizontal-stack
  cards:
    - type: custom:canvas-gauge-card
      entity: sensor.load_1m
      card_height: 62
      background_color: "#FFF"
      gauge:
        type: "radial-gauge"
        borderShadowWidth: 0
        borderOuterWidth: 0
        borderMiddleWidth: 0
        borderInnerWidth: 0
        width: 110
        height: 110
        minValue: 0
        maxValue: 100
        startAngle: 90
        ticksAngle: 180
        valueBox: false
        majorTicks:
          ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"]
        minorTicks: 2
        strokeTicks: true
        highlights:
          [{ "from": 80, "to": 100, "color": "rgba(200, 50, 50, .75)" }]
        colorPlate: "#ddd"
        borders: false
        needleType: "arrow"
        needleWidth: 2
        needleCircleSize: 7
        needleCircleOuter: true
        needleCircleInner: false
        animationDuration: 1500
        animationRule: "linear"

With text version

---
- type: horizontal-stack
  cards:
    - type: custom:canvas-gauge-card
      entity: sensor.processor_use
      card_height: 62
      name: "Processor use"
      shadow_height: "25%"
      font_size: 0.9em
      shadow_bottom: "20"
      gauge:
        type: "radial-gauge"
        width: 110
        height: 110
        borderShadowWidth: 0
        borderOuterWidth: 0
        borderMiddleWidth: 0
        borderInnerWidth: 0
        minValue: 0
        maxValue: 100
        startAngle: 90
        ticksAngle: 180
        valueBox: false
        majorTicks:
          ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"]
        minorTicks: 2
        strokeTicks: true
        highlights:
          [{ "from": 80, "to": 100, "color": "rgba(200, 50, 50, .75)" }]
        colorPlate: "#ddd"
        borders: false
        needleType: "arrow"
        needleWidth: 2
        needleCircleSize: 7
        needleCircleOuter: true
        needleCircleInner: false
        animationDuration: 1500
        animationRule: "linear"

Properties

Some of the properties that could be set. italic is not mandatory.

Property Description
entity your sensor
name shows the name in shadow remove to hide it
type "radial-gauge" or "linear-gauge"
dropshadow true to show dropshadow, false to hide
width width of the gauge
height height of the gauge
background_color sets gauge background color, transparent default if not set
card_height the actual height of the card, set to smaller value than gauge height if using a half guage. Not use if using a full circle gauge.
font_size size of name, leave out it will be dynamic
shadow_height xx% of total height is shadow height
shadow_bottom how far below the gauge in pixels the shadow should apear

For a complete documentation of available properties, please see https://canvas-gauges.com/documentation/user-guide/configuration

Repos

Credits

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

dual-gauge-card

Dual gauge custom card for Lovelace in Home Assistant
JavaScript
187
star
10

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
11

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
12

circle-sensor-card

A custom component for displaying sensor values as cards or elements
JavaScript
166
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