Advertisement
Guest User

Untitled

a guest
Jun 9th, 2025
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.96 KB | None | 0 0
  1. type: custom:button-card
  2. entity: sensor.temp_livingroom
  3. triggers_update: all
  4. aspect_ratio: 2.13/1
  5. styles:
  6. grid:
  7. - grid-template-areas: "\"icon corner\" \"n n\""
  8. - grid-template-columns: 1fr 1fr 1fr
  9. - grid-template-rows: 1fr 2fr
  10. card:
  11. - background: linear-gradient(#555599,#444488,#333377)
  12. - font-weight: bold
  13. - filter: drop-shadow(0 0 1px black)
  14. - text-shadow: 0 0 2px black
  15. - opacity: |
  16. [[[
  17. if (!entity?.state || ['unavailable', 'unknown', ''].includes(entity.state))
  18. return '50%'
  19. else return '100%'
  20. ]]]
  21. - text-transform: capitalize
  22. - font-size: 11px
  23. - padding: 5%
  24. name:
  25. - z-index: 1
  26. - pointer-events: none
  27. - filter: drop-shadow(0 0 1px black)
  28. - place-self: end start
  29. - font-size: 14px
  30. - overflow: visible
  31. - margin-bottom: "-3px"
  32. img_cell:
  33. - justify-content: start
  34. - scale: 1.5
  35. - padding: 10%
  36. icon:
  37. - filter: drop-shadow(0 0 1px black)
  38. - padding-left: 10%
  39. - padding-top: 10%
  40. custom_fields:
  41. icon:
  42. - z-index: 1
  43. - pointer-events: none
  44. - padding-top: 1em
  45. - width: 2em
  46. - filter: |
  47. [[[
  48. if (!entity?.state || ['unavailable', 'unknown', ''].includes(entity.state))
  49. return 'drop-shadow(0 0 1px black) grayscale(100%)'
  50. else return 'drop-shadow(0 0 1px black) grayscale(0%)'
  51. ]]]
  52. corner:
  53. - z-index: 2
  54. - pointer-events: none
  55. - position: absolute
  56. - overflow: visible
  57. - filter: drop-shadow(0 0 1px black)
  58. - background: rgb(0,0,0,25%)
  59. - padding-top: 2%
  60. - padding-bottom: 2%
  61. - padding-left: 4%
  62. - padding-right: 4%
  63. - border-radius: 5px
  64. - border-style: solid
  65. - border-color: black
  66. - border-width: 1px
  67. - font-size: 12px
  68. - right: 5%
  69. - top: 10%
  70. corner2:
  71. - z-index: 2
  72. - pointer-events: none
  73. - position: absolute
  74. - overflow: visible
  75. - filter: drop-shadow(0 0 1px black)
  76. - background: rgb(0,0,0,25%)
  77. - padding-top: 2%
  78. - padding-bottom: 2%
  79. - padding-left: 4%
  80. - padding-right: 4%
  81. - border-radius: 5px
  82. - border-style: solid
  83. - border-color: black
  84. - border-width: 1px
  85. - font-size: 12px
  86. - right: 5%
  87. - top: 50%
  88. addon_batt:
  89. - z-index: -3
  90. - pointer-events: none
  91. - position: absolute
  92. - overflow: visible
  93. - filter: drop-shadow(0 0 10px black)
  94. - font-size: 0
  95. - transform: scale(0.5)
  96. - top: 40%
  97. - left: 70%
  98. addon_graph:
  99. - z-index: "-10"
  100. - pointer-events: none
  101. - position: absolute
  102. - overflow: visible
  103. - "--card-background-color": rgba(0, 0, 0, 0.0)
  104. - "--ha-card-border-width": 0px
  105. - bottom: 0%
  106. - left: 0%
  107. - width: 100%
  108. - filter: drop-shadow(0 0 1px black)
  109. custom_fields:
  110. addon_graph:
  111. card:
  112. type: custom:mini-graph-card
  113. color_thresholds:
  114. - color: "#0000ff"
  115. value: 1
  116. - color: "#00ffff"
  117. value: 24
  118. - color: "#00ff00"
  119. value: 26
  120. - color: "#ffa500"
  121. value: 28
  122. - color: "#ff0000"
  123. value: 30
  124. hours_to_show: |
  125. [[[
  126. return states['input_select.lovelace_history_graph'].state
  127. ]]]
  128. line_width: 5
  129. points_per_hour: |
  130. [[[
  131. return states['input_number.lovelace_history_graph_points'].state
  132. ]]]
  133. show:
  134. fill: true
  135. name: false
  136. icon: false
  137. state: false
  138. points: false
  139. legend: false
  140. labels: false
  141. avergage: false
  142. labels_secondary: false
  143. loading_indicator: false
  144. entities: |
  145. [[[
  146. if (entity && entity.state && !['unavailable', 'unknown', ''].includes(entity.state))
  147. return [entity.entity_id]
  148. ]]]
  149.  
  150.  
  151. addon_batt:
  152. card:
  153. colors:
  154. gradient: true
  155. steps:
  156. - "#ff0000"
  157. - "#ffff00"
  158. - "#008000"
  159. type: custom:battery-state-entity
  160. entity: |
  161. [[[
  162. return entity.entity_id.replace("binary_sensor", "sensor").concat("_battery")
  163. ]]]
  164. corner: |
  165. [[[
  166. if (!entity?.state || ['unavailable', 'unknown', ''].includes(entity.state)) return;
  167. else return Math.round(entity.state) + " °C"
  168. ]]]
  169. icon: |
  170. [[[
  171. let ac_low = states['input_number.ac_low'].state
  172. let ac_high = states['input_number.ac_high'].state
  173. if (entity.state>ac_high) return `
  174. <svg viewBox="0 0 50 50">
  175. <path fill="white" d="M35.1 36.95C35.1 43.05 30.16 48 24.05 48C22.75 48 21.5 47.78 20.34 47.36C17.22 46.25 14.75 43.78 13.63 40.66C13.22 39.5 13 38.25 13 36.95C13 32.93 15.14 29.41 18.35 27.48V5.7C18.35 2.57 20.92 0 24.05 0C24.98 0 25.85 0.22 26.63 0.63C27.71 1.18 28.58 2.06 29.13 3.13C29.53 3.9 29.75 4.78 29.75 5.7V27.48C32.96 29.41 35.1 32.93 35.1 36.95Z"/>
  176. <path fill="red" d="M27.64 5.7V15.35V28.67L28.66 29.29C31.37 30.92 32.99 33.79 32.99 36.95C32.99 41.88 28.98 45.89 24.05 45.89C19.12 45.89 15.11 41.88 15.11 36.95C15.11 33.79 16.73 30.92 19.44 29.29L20.46 28.67V5.7C20.46 3.72 22.07 2.11 24.05 2.11C25.76 2.11 27.2 3.32 27.56 4.93C27.61 5.18 27.64 5.44 27.64 5.7Z"/>
  177. </svg>`
  178. else if (entity.state>ac_low&&entity.state<=ac_high) return `
  179. <svg viewBox="0 0 50 50">
  180. <path fill="white" d="M35.1 36.95C35.1 43.05 30.16 48 24.05 48C22.75 48 21.5 47.78 20.34 47.36C17.22 46.25 14.75 43.78 13.63 40.66C13.22 39.5 13 38.25 13 36.95C13 32.93 15.14 29.41 18.35 27.48V5.7C18.35 2.57 20.92 0 24.05 0C24.98 0 25.85 0.22 26.63 0.63C27.71 1.18 28.58 2.06 29.13 3.13C29.53 3.9 29.75 4.78 29.75 5.7V27.48C32.96 29.41 35.1 32.93 35.1 36.95Z"/>
  181. <path fill="green" d="M27.64 5.7V15.35V28.67L28.66 29.29C31.37 30.92 32.99 33.79 32.99 36.95C32.99 41.88 28.98 45.89 24.05 45.89C19.12 45.89 15.11 41.88 15.11 36.95C15.11 33.79 16.73 30.92 19.44 29.29L20.46 28.67V5.7C20.46 3.72 22.07 2.11 24.05 2.11C25.76 2.11 27.2 3.32 27.56 4.93C27.61 5.18 27.64 5.44 27.64 5.7Z"/>
  182. </svg>`
  183. else if (entity.state>0&&entity.state<=ac_low) return `
  184. <svg viewBox="0 0 50 50">
  185. <path fill="white" d="M35.1 36.95C35.1 43.05 30.16 48 24.05 48C22.75 48 21.5 47.78 20.34 47.36C17.22 46.25 14.75 43.78 13.63 40.66C13.22 39.5 13 38.25 13 36.95C13 32.93 15.14 29.41 18.35 27.48V5.7C18.35 2.57 20.92 0 24.05 0C24.98 0 25.85 0.22 26.63 0.63C27.71 1.18 28.58 2.06 29.13 3.13C29.53 3.9 29.75 4.78 29.75 5.7V27.48C32.96 29.41 35.1 32.93 35.1 36.95Z"/>
  186. <path fill="blue" d="M27.64 5.7V15.35V28.67L28.66 29.29C31.37 30.92 32.99 33.79 32.99 36.95C32.99 41.88 28.98 45.89 24.05 45.89C19.12 45.89 15.11 41.88 15.11 36.95C15.11 33.79 16.73 30.92 19.44 29.29L20.46 28.67V5.7C20.46 3.72 22.07 2.11 24.05 2.11C25.76 2.11 27.2 3.32 27.56 4.93C27.61 5.18 27.64 5.44 27.64 5.7Z"/>
  187. </svg>`
  188. ]]]
  189.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement