All Projects → custom-cards → decluttering-card

custom-cards / decluttering-card

Licence: MIT License
🧹 Declutter your lovelace configuration with the help of this card

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to decluttering-card

purifier-card
Air Purifier card for Home Assistant Lovelace UI
Stars: ✭ 155 (-16.67%)
Mutual labels:  home-assistant, homeassistant, lovelace, custom-cards
entur-card
Home Assistant Lovelace card card for the Entur public transport component.
Stars: ✭ 38 (-79.57%)
Mutual labels:  home-assistant, homeassistant, lovelace
Home Assistantconfig
🏠 Home Assistant configuration & Documentation for my Smart House. Write-ups, videos, part lists, and links throughout. Be sure to ⭐ it. Updated FREQUENTLY!
Stars: ✭ 3,687 (+1882.26%)
Mutual labels:  home-assistant, homeassistant, lovelace
hass-shutter-card
Shutter card for Home Assistant Lovelace UI
Stars: ✭ 151 (-18.82%)
Mutual labels:  home-assistant, lovelace, custom-cards
bootstrap-grid-card
Bootstrap grid in Lovelace UI
Stars: ✭ 25 (-86.56%)
Mutual labels:  homeassistant, lovelace, custom-cards
MeteoalarmCard
Meteoalarm, Météo-France and DWD severe weather warnings card for Home Assistant Lovelace UI ⛈️
Stars: ✭ 48 (-74.19%)
Mutual labels:  homeassistant, lovelace, custom-cards
lovelace-valetudo-map-card
Draws the map available from a Xiaomi Vacuum cleaner flashed with Valetudo in a Home Assistant Lovelace card
Stars: ✭ 149 (-19.89%)
Mutual labels:  home-assistant, homeassistant, lovelace
pymusiccast
Group MusicCast Speakers with Home Assistant
Stars: ✭ 34 (-81.72%)
Mutual labels:  home-assistant, homeassistant, lovelace
HomeAssistant-Config
Here is my current Home Assistant config. Hope this helps who needs it!!
Stars: ✭ 87 (-53.23%)
Mutual labels:  home-assistant, homeassistant
ha-config-ataraxis
My Home Assistant Configs. If you like what you see, please ⭐️my repo. It would encourage me a lot 🤘
Stars: ✭ 146 (-21.51%)
Mutual labels:  home-assistant, homeassistant
iocage-homeassistant
Home Assistant Core - TrueNAS CORE Community Plugin
Stars: ✭ 61 (-67.2%)
Mutual labels:  home-assistant, homeassistant
home-assistant-config
Ma configuration Home Assistant commentée en anglais et en français | My Home Assistant config with French and English comments.
Stars: ✭ 29 (-84.41%)
Mutual labels:  home-assistant, homeassistant
hass-livebox-component
Livebox Component for Home assistant
Stars: ✭ 24 (-87.1%)
Mutual labels:  home-assistant, homeassistant
homeassistant node
Home Assistant Node.js library
Stars: ✭ 40 (-78.49%)
Mutual labels:  home-assistant, homeassistant
content-card-linky
cardLinky comptatible with sensor apiEnedis
Stars: ✭ 48 (-74.19%)
Mutual labels:  homeassistant, lovelace
custom-component-store
📦 Manage your custom_components for Home Assistant
Stars: ✭ 12 (-93.55%)
Mutual labels:  home-assistant, homeassistant
HADailySensor
Sensor for Home Assistant that gets reset at midnight
Stars: ✭ 20 (-89.25%)
Mutual labels:  home-assistant, homeassistant
lovelace-soft-ui
💫 Simple and clean Lovelace configuration
Stars: ✭ 807 (+333.87%)
Mutual labels:  home-assistant, lovelace
slider-button-card
A button card with integrated slider
Stars: ✭ 319 (+71.51%)
Mutual labels:  homeassistant, lovelace
hhnl.HomeAssistantNet
No description or website provided.
Stars: ✭ 31 (-83.33%)
Mutual labels:  home-assistant, homeassistant

Decluttering Card

📝 Reuse multiple times the same card configuration with variables to declutter your config.

GitHub Release GitHub Activity custom_updater License

Project Maintenance

Discord Community Forum

Github

This card is for Lovelace on Home Assistant.

We all use multiple times the same block of configuration across our lovelace configuration and we don't want to change the same things in a hundred places across our configuration each time we want to modify something.

decluttering-card to the rescue!! This card allows you to reuse multiple times the same configuration in your lovelace configuration to avoid repetition and supports variables and default values.

Configuration

Defining your templates

First, you need to define your templates.

The templates are defined in an object at the root of your lovelace configuration. This object needs to be named decluttering_templates.

This object needs to contains your templates declaration, each template has a name and can contain variables. A variable needs to be enclosed in double square brackets [[variable_name]]. It will later be replaced by a real value when you instanciate a card which uses this template. If a variable is alone on it's line, enclose it in single quotes: '[[variable_name]]'.

You can also define default values for your variables in the default object.

For a card:

decluttering_templates:
  <template_name>
    default:  # This is optional
      - <variable_name>: <variable_value>
      - <variable_name>: <variable_value>
      [...]
    card:  # This is where you put your card config (it can be a card embedding other cards)
      type: custom:my-super-card
      [...]

For a Picture-Element:

decluttering_templates:
  <template_name>
    default:  # This is optional
      - <variable_name>: <variable_value>
      - <variable_name>: <variable_value>
      [...]
    element:  # This is where you put your element config
      type: icon
      [...]

Example in your lovelace-ui.yaml:

resources:
  - url: /local/decluttering-card.js
    type: module

decluttering_templates:
  my_first_template:     # This is the name of a template
    default:
      - icon: fire
    card:
      type: custom:button-card
      name: '[[name]]'
      icon: 'mdi:[[icon]]'

  my_second_template:    # This is the name of another template
    card:
      type: custom:vertical-stack-in-card
      cards:
        - type: horizontal-stack
          cards:
            - type: custom:button-card
              entity: '[[entity_1]]'
            - type: custom:button-card
              entity: '[[entity_2]]'

Using the card

Name Type Requirement Description
type string Required custom:decluttering-card
template object Required The template to use from decluttering_templates
variables list Optional List of variables and their value to replace in the template

Example which references the previous templates:

- type: custom:decluttering-card
  template: my_first_template
  variables:
    - name: Test Button
    - icon: arrow-up

- type: custom:decluttering-card
  template: my_first_template
  variables: Default Icon Button

- type: custom:decluttering-card
  template: my_second_template
  variables:
    - entity_1: switch.my_switch
    - entity_2: light.my_light

Installation

Step 1

Save decluttering-card to <config directory>/www/decluttering-card.js on your Home Assistant instanse.

Example:

wget https://raw.githubusercontent.com/custom-cards/decluttering-card/master/dist/decluttering-card.js
mv decluttering-card.js /config/www/

Step 2

Link decluttering-card inside your ui-lovelace.yaml or Raw Editor in the UI Editor

resources:
  - url: /local/decluttering-card.js
    type: module

Step 3

Add a custom element in your ui-lovelace.yaml or in the UI Editor as a Manual Card

Troubleshooting

See this guide: Troubleshooting

Developers

Fork and then clone the repo to your local machine. From the cloned directory run

npm install && npm run build

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].