[CARD] Config Template Card pour dynamiser vos dashboards sous Home Assistant FR

Code de démonstration

type: custom:config-template-card
variables:
  LIGHT1_STATE: states['light.sdb_light_white1'].state
  LIGHT2_STATE: states['light.sdb_light_white2'].state
  LIGHT3_STATE: states['light.sdb_light_color'].state
entities:
  - light.sdb_light_white1
  - light.sdb_light_white2
  - light.sdb_light_color
card:
  type: '${LIGHT1_STATE === ''on'' ? ''glance'' : ''entities''}'
  entities:
    - entity: light.sdb_light_white1
    - entity: light.sdb_light_white2
    - entity: light.sdb_light_color

Code pour Apex, ici par de variables car il se trouve dans le dashboard ( 2eme bloc )

type: custom:config-template-card
entities:
  - input_select.apex_graph_span
card:
  type: custom:apexcharts-card
  chart_type: ${(['1h','12h'].includes(GRAPH_SPAN))?'donut':'line';}
  show:
    last_updated: true
  header:
    show: true
    title: Disk
  graph_span: ${GRAPH_SPAN}
  all_series_config:
    stroke_width: 2
    group_by:
      func: avg
      duration: ${(['1h','12h','1d','2d'].includes(GRAPH_SPAN))?'1h':'1d';}
  series:
    - entity: sensor.disk_free
    - entity: sensor.disk_use
config_template_card_vars:
  GRAPH_SPAN: states['input_select.apex_graph_span'].state

Pour utiliser config_template_card_vars, il faut la dernière version de config_template_card qui se trouve dans le git.
Voici les fichiers pour aller plus vite fichier1 et fichier2.
Suivez bien la fichier jusqu’à la fin !

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Faites un petit don : https://fr.tipeee.com/arminastv
Si le contenu vous intéresse, n'hésitez pas à vous abonner à ma chaine et à partager sur tous vos réseaux sociaux. 👍
Facebook
Twitter
YouTube
YouTube
Instagram

Laisser un commentaire