Untitled

 avatar
unknown
yaml
a year ago
1.7 kB
16
Indexable
# un fichier cover.yaml qui contient tous mes volets dans le dossier include à la racine
cover:
  - platform: group
    name: "Tous les volets"
    entities:
      - cover.volet_chambre_rue
      - cover.volet_jardin
      - cover.volet_roulant_salon
      
# dans ma carte lovelace :
type: custom:mushroom-template-card
primary: Volets
card_mod:
  style: |
    ha-card {
      background-color: #0f1f39;
    }
    ha-card.fill-container {
        height: 105px !important;
    }
secondary: |
  {% set all = expand(entity)| list -%}
  {% set ND1 = all | selectattr('state','eq','open')|list|count%}
  {% set D1 = all | selectattr('state','eq','closed')|list|count%}
  Ouverts : {{ND1}} 
  Fermés : {{D1}}
icon: |
  {% if is_state(entity, 'open') %} 
    mdi:window-shutter-open
  {% else %}
    mdi:window-shutter
  {% endif %}
icon_color: |
  {% if is_state(entity,'open') %}
    light-blue
  {% else %}
    green
  {% endif %}
badge_icon: |-
  {% set all = expand(entity)| list -%} 
  {% set open1 = all | selectattr('state','eq','open')|list|count%}
  {% if open1 <= 9 %}
    mdi:numeric-{{open1}}
  {% elif open1 >= 10 %}
    mdi:numeric-9-plus
  {% else %}
    none
  {% endif %}
badge_color: |
  {% set all = expand(entity)| list -%} 
  {% set open1 = all | selectattr('state','eq','open')|list|count%}
  {% if open1 == 0 %}
    green
  {% else %}
    orange
  {% endif %}
entity: cover.tous_les_volets
layout: horizontal
hold_action:
  action: navigate
  navigation_path: /lovelace-smartphone/volets
double_tap_action:
  action: more-info
multiline_secondary: true
tap_action:
  action: navigate
  navigation_path: /lovelace-smartphone/volets
fill_container: true

Editor is loading...
Leave a Comment