johannwilken

Person Card

Oct 19th, 2022
1,224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.27 KB | None | 0 0
  1. type: custom:stack-in-card
  2. mode: vertical
  3. cards:
  4.   - type: custom:mushroom-person-card
  5.     entity: person.johannwilken
  6.     use_entity_picture: true
  7.     hide_name: true
  8.     layout: vertical
  9.   - type: custom:mushroom-chips-card
  10.     style: |
  11.      ha-card {
  12.         --chip-box-shadow: none;
  13.         --chip-background: none;
  14.         --chip-spacing: 0;
  15.       }
  16.     alignment: center
  17.     chips:
  18.       - type: template
  19.         entity: binary_sensor.jw_s21_is_charging
  20.         icon: |-
  21.           {% set state=states(entity) %}
  22.           {% if state=='on' %}
  23.           mdi:power-plug-outline
  24.           {% elif state=='off' %}
  25.           mdi:power-plug-off-outline
  26.           {% else %}
  27.           mdi:power-plug-off-outline-off
  28.           {% endif %}
  29.         tap_action:
  30.           action: more-info
  31.         icon_color: |-
  32.           {% set state=states(entity) %}
  33.           {% if state=='on' %}
  34.           red
  35.           {% elif state=='off' %}
  36.           green
  37.           {% else %}
  38.           gray
  39.           {% endif %}
  40.         style: |
  41.          ha-card {
  42.             {% if states('binary_sensor.jw_s21_is_charging') == 'on' %}
  43.             animation: blink 0.9s linear infinite;
  44.             }
  45.             @keyframes blink {
  46.               50% {opacity: 0;}
  47.               }
Advertisement
Add Comment
Please, Sign In to add comment