Advertisement
Wykop

Muchomorek

Dec 18th, 2022
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. type: custom:stack-in-card
  2. mode: horizontal
  3. cards:
  4. - type: custom:mushroom-person-card
  5. entity: person.person
  6. use_entity_picture: true
  7. hide_name: false
  8. layout: default
  9. tap_action:
  10. action: fire-dom-event
  11. browser_mod:
  12. command: popup
  13. deviceID: this
  14. title: Person
  15. card:
  16. type: custom:mod-card
  17. style: |
  18. ha-card {
  19. padding-right: 15px;
  20. padding-left: 15px;
  21. padding-bottom: 15px;
  22. }
  23. card:
  24. type: vertical-stack
  25. cards:
  26. - type: horizontal-stack
  27. cards:
  28. - type: entity
  29. entities:
  30. - entity: device_tracker.person_10
  31. aspect_ratio: '2'
  32. use_entity_picture: true
  33. - type: custom:mushroom-chips-card
  34. style: |
  35. ha-card {
  36. --chip-box-shadow: none;
  37. --chip-background: none;
  38. --chip-spacing: none;
  39. --chip-height: 66px
  40. }
  41. chips:
  42. - type: template
  43. icon_color: |2-
  44. {% set state=states('sensor.sm_g975f_battery_state') %}
  45. {% if state=='Charging' %}
  46. green
  47. {% elif state=='Not Charging' %}
  48. black
  49. {% endif %}
  50. entity: sensor.sm_g975f_battery_state
  51. content: '{{ states(entity) }}'
  52. icon: mdi:power-plug
  53. tap_action:
  54. action: more-info
  55. - type: template
  56. entity: sensor.sm_g975f_battery_level
  57. content: '{{ states(entity) }} %'
  58. icon: |2
  59. {% set bl = states('sensor.sm_g975f_battery_level') | int %}
  60. {% if bl < 10 %} mdi:battery-outline
  61. {% elif bl < 20 %} mdi:battery-10
  62. {% elif bl < 30 %} mdi:battery-20
  63. {% elif bl < 40 %} mdi:battery-30
  64. {% elif bl < 50 %} mdi:battery-40
  65. {% elif bl < 60 %} mdi:battery-50
  66. {% elif bl < 70 %} mdi:battery-60
  67. {% elif bl < 80 %} mdi:battery-70
  68. {% elif bl < 90 %} mdi:battery-80
  69. {% elif bl < 100 %} mdi:battery-90
  70. {% elif bl == 100 %} mdi:battery
  71. {% else %} mdi:battery-unknown
  72. {% endif %}
  73. icon_color: |2-
  74. {% set bl = states('sensor.sm_g975f_battery_level') | int %}
  75. {% if bl < 10 %} red
  76. {% elif bl < 20 %} red
  77. {% elif bl < 30 %} red
  78. {% elif bl < 40 %} orange
  79. {% elif bl < 50 %} orange
  80. {% elif bl < 60 %} green
  81. {% elif bl < 70 %} green
  82. {% elif bl < 80 %} green
  83. {% elif bl < 90 %} green
  84. {% elif bl < 100 %} green
  85. {% elif bl == 100 %} green
  86. {% else %} grey
  87. {% endif %}
  88. tap_action:
  89. action: more-info
  90. - type: entity
  91. icon_color: yellow
  92. entity: sensor.kroki_person_dzien
  93.  
  94. alignment: left
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement