Skip to content
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.
Branch: master
Clone or download
Latest commit 1fb0507 Oct 31, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist Moved image to main directory Oct 29, 2019
LICENSE Initial commit Oct 29, 2019
README.md Updated README Oct 31, 2019
hacs.json Added documentation Oct 29, 2019
info.md Updated info.md Oct 29, 2019
s1.gif Moved image to main directory Oct 29, 2019

README.md

Lovelace Local Conditional card

hacs_badge Community Forum buymeacoffee_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 3 new services that can be used ONLY from UI:

  • local_conditional_card.show - shows specified card
  • local_conditional_card.hide - hides specified card
  • local_conditional_card.toggle - shows or hides specified card

Each of these services requires a parameter id that have to correspond to a existing card.

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:
          id: sun1
        type: call-service
      - action_name: Show
        icon: 'mdi:power'
        name: Sun1
        service: local_conditional_card.show
        service_data:
          id: sun1
        type: call-service
      - action_name: Hide
        icon: 'mdi:power'
        name: Sun1
        service: local_conditional_card.hide
        service_data:
          id: sun1
        type: call-service
      - action_name: Toggle
        icon: 'mdi:power'
        name: Sun2
        service: local_conditional_card.toggle
        service_data:
          id: sun2
        type: call-service
      - action_name: Show
        icon: 'mdi:power'
        name: Sun2
        service: local_conditional_card.show
        service_data:
          id: sun2
        type: call-service
      - action_name: Hide
        icon: 'mdi:power'
        name: Sun2
        service: local_conditional_card.hide
        service_data:
          id: 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

You can’t perform that action at this time.