Advertisement
windos2k

Kleenex Mushroom template card

Mar 17th, 2025
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.07 KB | None | 0 0
  1. type: custom:mushroom-template-card
  2. entity: sensor.your_entity
  3. primary: |-
  4.   {% set state = states(entity) %}
  5.   {% set level = state_attr(entity, 'level') %}
  6.  
  7.   {% if state | int == 0 %}
  8.   Geen
  9.   {% elif  level == 'low' %}
  10.   Laag
  11.   {% elif  level == 'moderate' %}
  12.   Gemiddeld
  13.   {% elif  level == 'high' %}
  14.   Hoog
  15.   {% elif  level == 'very_high' %}
  16.   Zeer hoog
  17.   {% endif %}
  18. secondary: |+
  19.   {{ states(entity, with_unit=True) }}
  20.  
  21. icon: mdi:tree
  22. badge_icon: |-
  23.   {% set level = state_attr(entity, 'level') %}
  24.  
  25.   {% if  level == 'very_high' %}
  26.   mdi:exclamation-thick
  27.   {% endif %}
  28. badge_color: deep-orange
  29. icon_color: |-
  30.   {% set state = states(entity) %}
  31.   {% set level = state_attr(entity, 'level') %}
  32.  
  33.   {% if state | int == 0 %}
  34.   disabled
  35.   {% elif  level == 'low' %}
  36.   green
  37.   {% elif  level == 'moderate' %}
  38.   orange
  39.   {% elif  level == 'high' %}
  40.   red
  41.   {% elif  level == 'very_high' %}
  42.   red
  43.   {% endif %}
  44. fill_container: false
  45. tap_action:
  46.   action: none
  47. hold_action:
  48.   action: more-info
  49. double_tap_action:
  50.   action: none
  51. layout: vertical
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement