Advertisement
pqpxoxa

HA - Phone Cards

Feb 27th, 2021
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.59 KB | None | 0 0
  1. cards:
  2. - color_type: blank-card
  3. icon: 'mdi:led-strip-variant'
  4. name: Floor
  5. styles:
  6. card:
  7. - width: 25px
  8. type: 'custom:button-card'
  9. - type: 'custom:button-card'
  10. entity: sensor.pixel_4_xl_battery_level
  11. entity_picture: /local/google_pixel_4xl.png
  12. show_entity_picture: true
  13. aspect_ratio: 1/1
  14. name: Pixel 4XL
  15. styles:
  16. card:
  17. - background-color: '#2b374e'
  18. - border-radius: 10%
  19. - padding: 7%
  20. - color: ivory
  21. - font-size: 10px
  22. - text-shadow: 0px 0px 5px black
  23. - text-transform: capitalize
  24. grid:
  25. - grid-template-areas: '"i temp" "n n" "cpu cpu" "ram ram" "sd sd"'
  26. - grid-template-columns: 1fr 1fr
  27. - grid-template-rows: 1fr min-content min-content min-content min-content
  28. name:
  29. - font-weight: bold
  30. - font-size: 15px
  31. - color: white
  32. - align-self: middle
  33. - justify-self: start
  34. - padding-bottom: 6px
  35. img_cell:
  36. - justify-content: start
  37. - align-items: start
  38. - margin: none
  39. icon:
  40. - width: 70%
  41. custom_fields:
  42. temp:
  43. - align-self: start
  44. - justify-self: end
  45. - font-size: 13px
  46. cpu:
  47. - padding-bottom: 2px
  48. - align-self: middle
  49. - justify-self: start
  50. - font-size: 11px
  51. - '--text-color-sensor': >-
  52. [[[ if (states['binary_sensor.pixel_4_xl_bluetooth_state'].state
  53. !== 'on') return "red"; ]]]
  54. ram:
  55. - padding-bottom: 2px
  56. - align-self: middle
  57. - justify-self: start
  58. - font-size: 11px
  59. - '--text-color-sensor': >-
  60. [[[ if (states["binary_sensor.pixel_4_xl_wifi_state"].state !==
  61. 'on') return "red"; ]]]
  62. sd:
  63. - align-self: middle
  64. - padding-bottom: 2px
  65. - justify-self: start
  66. - font-size: 11px
  67. - '--text-color-sensor': >-
  68. [[[ if (states['sensor.pixelcharging'].state == 'Not Charging')
  69. return "red"; ]]]
  70. custom_fields:
  71. temp: |
  72. [[[
  73. return `<ha-icon
  74. icon="mdi:battery-high"
  75. style="width: 22px; height: 22px; color: white;">
  76. </ha-icon><span>${entity.state}%</span>`
  77. ]]]
  78. cpu: |
  79. [[[
  80. return `<ha-icon
  81. icon="mdi:bluetooth"
  82. style="width: 20px; height: 20px; color: white;">
  83. </ha-icon><span> Bluetooth: <span style="color: var(--text-color-sensor);">${states['binary_sensor.pixel_4_xl_bluetooth_state'].state}</span></span>`
  84. ]]]
  85. ram: |
  86. [[[
  87. return `<ha-icon
  88. icon="mdi:wifi"
  89. style="width: 20px; height: 20px; color: white;">
  90. </ha-icon><span> WiFi: <span style="color: var(--text-color-sensor);">${states['binary_sensor.pixel_4_xl_wifi_state'].state}</span></span>`
  91. ]]]
  92. sd: |
  93. [[[
  94. return `<ha-icon
  95. icon="mdi:battery-charging"
  96. style="width: 20px; height: 20px; color: white;">
  97. </ha-icon><span> Charging: <span style="color: var(--text-color-sensor);">${states['sensor.pixelcharging'].state}</span></span>`
  98. ]]]
  99. - type: 'custom:button-card'
  100. entity: sensor.iphone_battery_level
  101. entity_picture: /local/iphone.png
  102. show_entity_picture: true
  103. aspect_ratio: 1/1
  104. name: iPhone 7
  105. styles:
  106. card:
  107. - background-color: '#2b374e'
  108. - border-radius: 10%
  109. - padding: 7%
  110. - color: ivory
  111. - font-size: 10px
  112. - text-shadow: 0px 0px 5px black
  113. - text-transform: capitalize
  114. grid:
  115. - grid-template-areas: '"i temp" "n n" "cpu cpu" "ram ram" "sd sd"'
  116. - grid-template-columns: 1fr 1fr
  117. - grid-template-rows: 1fr min-content min-content min-content min-content
  118. name:
  119. - font-weight: bold
  120. - font-size: 15px
  121. - color: white
  122. - align-self: middle
  123. - justify-self: start
  124. - padding-bottom: 6px
  125. img_cell:
  126. - justify-content: start
  127. - align-items: start
  128. - margin: none
  129. icon:
  130. - width: 70%
  131. custom_fields:
  132. temp:
  133. - align-self: start
  134. - justify-self: end
  135. - font-size: 13px
  136. cpu:
  137. - padding-bottom: 2px
  138. - align-self: middle
  139. - justify-self: start
  140. - font-size: 11px
  141. - '--text-color-sensor': >-
  142. [[[ if (states['binary_sensor.pixel_4_xl_bluetooth_state'].state
  143. !== 'on') return "red"; ]]]
  144. ram:
  145. - padding-bottom: 2px
  146. - align-self: middle
  147. - justify-self: start
  148. - font-size: 11px
  149. - '--text-color-sensor': >-
  150. [[[ if (states["sensor.iphonewifi"].state !== 'on') return "red";
  151. ]]]
  152. sd:
  153. - align-self: middle
  154. - padding-bottom: 2px
  155. - justify-self: start
  156. - font-size: 11px
  157. - '--text-color-sensor': >-
  158. [[[ if (states['sensor.iphone_battery_state'].state !== 'ac')
  159. return "red"; ]]]
  160. custom_fields:
  161. temp: |
  162. [[[
  163. return `<ha-icon
  164. icon="mdi:battery-high"
  165. style="width: 22px; height: 22px; color: white;">
  166. </ha-icon><span>${entity.state}%</span>`
  167. ]]]
  168. cpu: |
  169. [[[
  170. return `<ha-icon
  171. icon="mdi:bluetooth"
  172. style="width: 20px; height: 20px; color: white;">
  173. </ha-icon><span> Bluetooth: <span style="color: var(--text-color-sensor);">${states['binary_sensor.pixel_4_xl_bluetooth_state'].state}</span></span>`
  174. ]]]
  175. ram: |
  176. [[[
  177. return `<ha-icon
  178. icon="mdi:wifi"
  179. style="width: 20px; height: 20px; color: white;">
  180. </ha-icon><span> WiFi: <span style="color: var(--text-color-sensor);">${states['sensor.iphonewifi'].state}</span></span>`
  181. ]]]
  182. sd: |
  183. [[[
  184. return `<ha-icon
  185. icon="mdi:battery-charging"
  186. style="width: 20px; height: 20px; color: white;">
  187. </ha-icon><span> Charging: <span style="color: var(--text-color-sensor);">${states['sensor.iphone_battery_state'].state}</span></span>`
  188. ]]]
  189. - color_type: blank-card
  190. icon: 'mdi:led-strip-variant'
  191. name: Floor
  192. styles:
  193. card:
  194. - width: 25px
  195. type: 'custom:button-card'
  196. type: horizontal-stack
  197.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement