Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type: custom:mushroom-template-card
- entity: sensor.your_entity
- primary: |-
- {% set state = states(entity) %}
- {% set level = state_attr(entity, 'level') %}
- {% if state | int == 0 %}
- Geen
- {% elif level == 'low' %}
- Laag
- {% elif level == 'moderate' %}
- Gemiddeld
- {% elif level == 'high' %}
- Hoog
- {% elif level == 'very_high' %}
- Zeer hoog
- {% endif %}
- secondary: |+
- {{ states(entity, with_unit=True) }}
- icon: mdi:tree
- badge_icon: |-
- {% set level = state_attr(entity, 'level') %}
- {% if level == 'very_high' %}
- mdi:exclamation-thick
- {% endif %}
- badge_color: deep-orange
- icon_color: |-
- {% set state = states(entity) %}
- {% set level = state_attr(entity, 'level') %}
- {% if state | int == 0 %}
- disabled
- {% elif level == 'low' %}
- green
- {% elif level == 'moderate' %}
- orange
- {% elif level == 'high' %}
- red
- {% elif level == 'very_high' %}
- red
- {% endif %}
- fill_container: false
- tap_action:
- action: none
- hold_action:
- action: more-info
- double_tap_action:
- action: none
- layout: vertical
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement