fredrik_persson_

Sensor Status

Apr 24th, 2024
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. - type: "custom:button-card"
  2. view_layout:
  3. grid-area: "fire"
  4. entity: input_boolean.sensors_dropdown
  5. name: Smoke detectors
  6. label: All Online
  7. show_name: true
  8. show_icon: true
  9. show_label: true
  10. show_state: false
  11. variables:
  12. display: >
  13. [[[
  14. if (entity.state == "on"){
  15. return "block";
  16. }else {
  17. return "none";
  18. }
  19. ]]]
  20. styles:
  21. grid:
  22. - grid-template-areas: '"l" "n"'
  23. - grid-template-rows: 1fr 2rem
  24. - row-gap: 2px
  25. card:
  26. - height: 100%
  27. - background: "var(--card-background)"
  28. - border-radius: "var(--border-radius)"
  29. - box-shadow: "var(--box-shadow)"
  30. - padding: 1rem
  31. - overflow: visible
  32. label:
  33. - text-align: left
  34. - font-size: "var(--fs-500)"
  35. - font-family: 'Montserrat'
  36. - font-weight: 600
  37. - justify-self: start
  38. - align-self: end
  39. - color: rgba(var(--contrast-100),1)
  40. - text-transform: capitalize
  41. - text-wrap: wrap
  42. name:
  43. - text-align: left
  44. - font-size: "var(--fs-400)"
  45. - font-family: 'Montserrat'
  46. - font-weight: 500
  47. - justify-self: start
  48. - align-self: center
  49. - color: rgba(var(--contrast-100),1)
  50. img_cell:
  51. - border-radius: 50px
  52. - background: rgba(var(--color-red),1)
  53. - height: 12px
  54. - width: 12px
  55. - right: 24px
  56. - top: -4px
  57. - position: absolute
  58. - display: "[[[ return variables.display ]]]"
  59. - animation: scale 2s ease-in-out infinite
  60. icon:
  61. - opacity: 0
  62. state:
  63. - value: "on" #windows are open
  64. label: Check Status
  65. styles:
  66. label:
  67. - color: rgba(var(--color-red),1)
  68. extra_styles: |
  69. @keyframes scale {
  70. 0% {transform: scale(.9)}
  71. 50% {transform: scale(1.2)}
  72. 100% {transform: scale(.9)}
  73. }
Advertisement
Add Comment
Please, Sign In to add comment