Git Product home page Git Product logo

home-assistant-lovelace-local-conditional-card's Introduction

Lovelace Local Conditional card

hacs_badge Community Forum buymeacoffee_badge paypalme_badge

This card can show and hide a specific card on current device while not affecting other windows. It does not require any integration to run.

Configuration options

Key Type Required Default Description
id string true - Identifier of a card, used in service calls. Must be unique!
card card true - Configuration of a nested card
default string false hide Default card behaviour. Possible values: [show, hide].

Services

This card adds 4 new services that can be used ONLY from UI:

  • local_conditional_card.show - shows specified cards
  • local_conditional_card.hide - hides specified cards
  • local_conditional_card.toggle - changes visibility of specified cards
  • local_conditional_card.set - sets visibility of specified cards

Each of these services requires a parameter ids that should contain a list:

service: local_conditional_card.show:
service_data:
  ids:
    - id_1
    - id_2
service: local_conditional_card.hide:
service_data:
  ids:
    - id_1
    - id_2
service: local_conditional_card.toggle:
service_data:
  ids:
    - id_1
    - id_2
service: local_conditional_card.set:
service_data:
  ids:
    - id_1: true
    - id_2: false

Example configuration

Example

views:
- name: Example
  cards:
  - type: 'custom:local-conditional-card'
    default: show
    id: sun1
    card:
      entities:
        - sun.sun
      title: Sun 1
      type: entities
  - type: 'custom:local-conditional-card'
    id: sun2
    card:
      entities:
        - sun.sun
      title: Sun 2
      type: entities
  - title: Click test
    type: entities
    entities:
      - action_name: Toggle
        icon: 'mdi:power'
        name: Sun1
        service: local_conditional_card.toggle
        service_data:
          ids:
            - sun1
        type: call-service
      - action_name: Show
        icon: 'mdi:power'
        name: Sun1
        service: local_conditional_card.show
        service_data:
          ids:
            - sun1
        type: call-service
      - action_name: Hide
        icon: 'mdi:power'
        name: Sun1
        service: local_conditional_card.hide
        service_data:
          ids:
            - sun1
        type: call-service
      - action_name: Hide All
        icon: 'mdi:power'
        name: Suns
        service: local_conditional_card.hide
        service_data:
          ids:
            - sun1
            - sun2
        type: call-service
      - action_name: Toggle
        icon: 'mdi:power'
        name: Sun2
        service: local_conditional_card.toggle
        service_data:
          ids:
            - sun2
        type: call-service
      - action_name: Show
        icon: 'mdi:power'
        name: Sun2
        service: local_conditional_card.show
        service_data:
          ids:
            - sun2
        type: call-service
      - action_name: Hide
        icon: 'mdi:power'
        name: Sun2
        service: local_conditional_card.hide
        service_data:
          ids:
            - sun2
        type: call-service

Manual Installation

  1. Download local-conditional-card.js to /www/custom_lovelace/local_conditional_card directory:
    mkdir -p www/custom_lovelace/local_conditional_card
    cd www/custom_lovelace/local_conditional_card/
    wget https://github.com/PiotrMachowski/Home-Assistant-Lovelace-Local-Conditional-card/raw/master/dist/local-conditional-card.js
  2. Add card to resources in ui-lovelace.yaml or in raw editor if you are using frontend UI editor:
    resources:
      - url: /local/custom_lovelace/local_conditional_card/local-conditional-card.js
        type: module

Buy Me A Coffee

home-assistant-lovelace-local-conditional-card's People

Contributors

alexanderphoenix avatar piotrmachowski avatar

Forkers

mancavemedia

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.