• Stars
    star
    333
  • Rank 126,599 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 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

Customizable Animated Bar card for Home Assistant Lovelace

Project Maintenance

bar-card

Examples

Default

Severity

Entity Row

Direction

Old Layout

Custom CSS

Options

Name Type Default Description
type string Required custom:bar-card
entity string Required Entity State
animation object none Defines animation options. See Animation Options.
attribute string none Displays a specific attribute instead of state value.
color string var(--custom-bar-card-color, var(--primary-color)) Color of the bar.
columns number none Defines the amount of bars to be displayed on a single row when multiple entities are defined.
complementary boolean false Displays complementary value (max - state_value) instead state value.
decimal number none The amount of decimals to be displayed for the value.
direction string right Direction of the bar. right, up
entities array none A list of entities. Accepts individual config options per defined entity.
entity_config boolean false Sets the card to use the configured entity attributes as the card config.
entity_row boolean false Removes the background card for use inside entities card.
height string 40px Defines the height of the bar.
icon string icon Defines the icon to be displayed.
limit_value boolean false Limits value displayed to min and max value.
max number 100 Defines maximum value of the bar.
min number 0 Defines minimum value of the bar.
name string none Defines custom entity name.
positions object none Defines the positions of the card elements. See Positions Options.
severity object none A list of severity values. See Severity Options.
tap_action object none See home assistant documentation.
target number none Defines and enables target marker value.
title string none Adds title header to the card.
unit_of_measurement string attribute Defines the unit of measurement to be displayed.
width string 100% Defines the width of the bar.

Severity Options

Name Type Default Description
from number Required Defines from which value the color should be displayed.
to number Required Defines to which value the color should be displayed.
color string Required Defines the color to be displayed.
icon string none Defines the icon to be displayed.
hide boolean false Hides the bar if conditions are met.

Animation Options

Name Type Default Description
state string off Enables or disables animation. on, off
speed number 5 Defines the speed of the bar animation in seconds.

Positions Options

Name Type Default Description
icon string outside inside, outside, off
indicator string outside inside, outside, off
name string inside inside, outside, off
minmax string off inside, outside, off
value string inside inside, outside, off

Theme Variables

Name Description
bar-card-color Defines the default bar color.
bar-card-border-radius Defines the default border radius of the bar.
bar-card-disabled-color Defines the bar color when state is unavailable.

CSS Elements

See example. (requires card-mod)

Name Description
#states HA states containing all rows.
bar-card-card The root bar of each defined entity containing all elements.
bar-card-background Contains bar and any elements outside of the bar.
bar-card-backgroundbar The background of the bar.
bar-card-currentbar The filled part of the bar.
bar-card-contentbar Contains all elements inside of the bar.
ha-icon Icon element.
bar-card-iconbar Contains ha-icon.
bar-card-name Name element.
bar-card-min Min value element.
bar-card-divider Min/Max divider element.
bar-card-max Max value element.
bar-card-value Value element.
bar-card-animationbar Animated part of the bar.
bar-card-targetbar Target bar element.
bar-card-markerbar Target marker element.
bar-card-indicator Indicator element.

Installation

Prefered method of installation is Home Assistant Community Store.

It's required to load this card as module.

- url: /hacsfiles/bar-card/bar-card.js
  type: module

Examples

Default

Default

entity: sensor.example
title: Default
type: 'custom:bar-card'

Severity

Severity

entity: sensor.example
title: Severity
type: 'custom:bar-card'
severity:
  - color: Red
    from: 0
    to: 25
  - color: Orange
    from: 26
    to: 50
  - color: Green
    from: 51
    to: 100

Entity Row

Entity Row

entities:
  - sensor.example
  - entity: sensor.example
    positions:
      minmax: inside
    entity_row: true
    target: 50
    type: 'custom:bar-card'
  - entity: light.group_bedroom
    name: Example
title: Entity Row
type: entities

Direction

Direction

entities:
  - sensor.example
  - sensor.example
  - sensor.example
title: Direction
direction: up
height: 200px
stack: horizontal
type: 'custom:bar-card'

2.0.0 Default Layout (requires card-mod)

Old Layout

entity: sensor.example
positions:
  icon: 'off'
  indicator: inside
  name: outside
type: 'custom:bar-card'
width: 70%
title: 2.0.0 Default Layout
style: |-
  bar-card-value {
    margin-right: auto;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px #0005;
  }

Custom CSS Layout (requires card-mod)

Custom CSS

entities:
  - entity: sensor.example
positions:
  icon: 'off'
  indicator: 'off'
  minmax: inside
  title: inside
  value: inside
style: |-
  .contentbar-direction-right {
   flex-direction: column;
  }
  .min-direction-right {
    margin: 0px;
    margin-left: 4px;
    margin-right: auto;
    margin-bottom: -20px;
    bottom: 10px;
  }
    bar-card-value {
    margin: 0px;
  }
  bar-card-name {
    margin: 0px;
  }
  bar-card-max {
    margin: 0px;
    margin-left: auto;
    margin-top: -20px;
    top: 10px;
  }
  bar-card-divider {
    display: none;
  }
title: Custom CSS Layout
type: 'custom:bar-card'

Credits

Inspired by Big Number Card by ciotlosm.

Links

Home Assistant Community Topic

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

stack-in-card

๐Ÿ›  group multiple cards into one card without the borders
TypeScript
267
star
5

upcoming-media-card

๐Ÿ“บ A card to display upcoming episodes and movies from services like: Plex, Kodi, Radarr, Sonarr, and Trakt.
JavaScript
260
star
6

surveillance-card

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

boilerplate-card

A community driven blueprint for best practices
TypeScript
225
star
8

dual-gauge-card

Dual gauge custom card for Lovelace in Home Assistant
JavaScript
187
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