fredrik_persson_

Smart Home Toggle

Apr 24th, 2024
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. - type: "custom:button-card"
  2. view_layout:
  3. grid-area: "r6a"
  4. entity: input_boolean.dummy_toggle2
  5. name: Changes control<br>of the house.
  6. label: Home mode
  7. show_name: false
  8. show_icon: true
  9. show_label: true
  10. show_state: false
  11. tap_action:
  12. action: toggle
  13. state:
  14. - value: "off"
  15. icon: mdi:toggle-switch-off-outline
  16. - value: "on"
  17. icon: mdi:toggle-switch-outline
  18. styles:
  19. grid:
  20. - grid-template-areas: '"state ." "n ." "l i"'
  21. - grid-template-rows: 1fr min-content 2rem
  22. - grid-template-columns: 60% 40%
  23. - row-gap: 8px
  24. card:
  25. - height: 100%
  26. - background: "var(--card-background)"
  27. - border-radius: "var(--border-radius)"
  28. - box-shadow: "var(--box-shadow)"
  29. - padding: 1rem
  30. - background-size: 200%
  31. - overflow: hidden
  32. - animation:
  33. - card 1s ease
  34. name:
  35. - color: rgba(var(--contrast-100),1)
  36. - text-align: left
  37. - font-size: "var(--fs-400)"
  38. - font-family: Montserrat
  39. - font-weight: 600
  40. - justify-self: start
  41. - align-self: center
  42. - overflow: visible
  43. label:
  44. - color: rgba(var(--contrast-100),1)
  45. - text-align: left
  46. - font-size: "var(--fs-400)"
  47. - font-family: Montserrat
  48. - font-weight: 600
  49. - justify-self: start
  50. - align-self: center
  51. img_cell:
  52. - justify-content: end
  53. - overflow: hidden
  54. icon:
  55. - justify-self: end
  56. - align-self: center
  57. - color: rgba(var(--contrast-100),1)
  58. - width: "var(--button-small)"
  59. - padding: 0 0 0 0
  60. - overflow: hidden
  61. custom_fields:
  62. state:
  63. - color: rgba(var(--color-dark-blue),1)
  64. - text-align: left
  65. - font-size: "var(--fs-800-resp)"
  66. - font-family: Montserrat
  67. - line-height: "var(--fs-800-resp)"
  68. - font-weight: 800
  69. - justify-self: start
  70. - align-self: start
  71. - overflow: visible
  72. img:
  73. - display: none
  74. - position: absolute
  75. - width: 15em
  76. - right: -60%
  77. - top: -50%
  78. - color: rgba(var(--contrast-100),.03)
  79. - overflow: hidden
  80. - animation:
  81. - rotating 36s linear infinite reverse
  82. extra_styles: |
  83. @keyframes gradient {
  84. 0% {
  85. background-position: 0% 50%;
  86. }
  87. 50% {
  88. background-position: 100% 0%;
  89. }
  90. 100% {
  91. background-position: 0% 50%;
  92. }
  93. }
  94. custom_fields:
  95. state: >
  96. [[[
  97. if (states['input_boolean.dummy_toggle2'].state == "off")
  98. return '<span style="opacity:0.25">Smart</span><br><span>Dumb</span>';
  99.  
  100. return '<span>Smart</span><br><span style="opacity:0.25">Dumb</span>';
  101. ]]]
  102. img: |
  103. <ha-icon icon="mdi:cog-outline"></ha-icon>
Advertisement
Add Comment
Please, Sign In to add comment