Advertisement
johannwilken

Active Cycle Days Card and other Configs

Jul 1st, 2022
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.52 KB | None | 0 0
  1. Input_boolean for each day of the week:
  2. ----------------------------------------
  3.  
  4. input_boolean.irrigation_monday
  5. input_boolean.irrigation_tuesday
  6. input_boolean.irrigation_wednesday
  7. input_boolean.irrigation_thursday
  8. input_boolean.irrigation_friday
  9. input_boolean.irrigation_saturday
  10. input_boolean.irrigation_sunday
  11.  
  12. Binary_sensor to check if Input_booleans are on:
  13. ------------------------------------------------
  14.  
  15. ####Irrigation Active Days####
  16. - platform: template
  17. sensors:
  18. irrigation_day_active:
  19. friendly_name: Irrigation Day Active
  20. value_template: >-
  21. {{ ( is_state('input_boolean.irrigation_monday', 'on') and now().weekday() == 0 )
  22. or ( is_state('input_boolean.irrigation_tuesday', 'on') and now().weekday() == 1 )
  23. or ( is_state('input_boolean.irrigation_wednesday', 'on') and now().weekday() == 2 )
  24. or ( is_state('input_boolean.irrigation_thursday', 'on') and now().weekday() == 3 )
  25. or ( is_state('input_boolean.irrigation_friday', 'on') and now().weekday() == 4 )
  26. or ( is_state('input_boolean.irrigation_saturday', 'on') and now().weekday() == 5 )
  27. or ( is_state('input_boolean.irrigation_sunday', 'on') and now().weekday() == 6 ) }}
  28.  
  29.  
  30. Card: Config
  31. ------------
  32. Cards Used:
  33. ----------
  34. custom:stack-in-card
  35. custom:mushroom-template-card
  36. custom:mushroom-chips-card
  37.  
  38. Active Cycle Days Full config:
  39. ------------------------------
  40.  
  41. type: custom:stack-in-card
  42. mode: vertical
  43. cards:
  44. - type: custom:mushroom-template-card
  45. primary: Cycle Active Days
  46. secondary: '{{ states(''binary_sensor.irrigation_day_active'') }}'
  47. icon: mdi:calendar-today-outline
  48. layout: horizontal
  49. multiline_secondary: false
  50. tap_action:
  51. action: null
  52. icon_color: green
  53. style: |
  54. :host([dark-mode]) {
  55. background: rgba(var(--rgb-primary-background-color), 0.2);
  56. }
  57. :host {
  58. background: rgba(var(--rgb-primary-text-color), 0.025);
  59. }
  60. - type: custom:mushroom-chips-card
  61. style: |
  62. ha-card {
  63. --chip-box-shadow: none;
  64. --chip-background: none;
  65. --chip-spacing: 0;
  66. }
  67. alignment: center
  68. chips:
  69. - type: template
  70. entity: input_boolean.irrigation_monday
  71. icon: |-
  72. {% set state=states(entity) %}
  73. {% if state=='on' %}
  74. mdi:alpha-m-circle-outline
  75. {% elif state=='off' %}
  76. mdi:alpha-m-circle-outline
  77. {% else %}
  78. mdi:alpha-m-circle-outline
  79. {% endif %}
  80. tap_action:
  81. action: toggle
  82. icon_color: |-
  83. {% set state=states(entity) %}
  84. {% if state=='on' %}
  85. blue
  86. {% elif state=='off' %}
  87. white
  88. {% else %}
  89. red
  90. {% endif %}
  91. - type: template
  92. entity: input_boolean.irrigation_tuesday
  93. icon: |-
  94. {% set state=states(entity) %}
  95. {% if state=='on' %}
  96. mdi:alpha-t-circle-outline
  97. {% elif state=='off' %}
  98. mdi:alpha-t-circle-outline
  99. {% else %}
  100. mdi:alpha-t-circle-outline
  101. {% endif %}
  102. tap_action:
  103. action: toggle
  104. icon_color: |-
  105. {% set state=states(entity) %}
  106. {% if state=='on' %}
  107. blue
  108. {% elif state=='off' %}
  109. white
  110. {% else %}
  111. red
  112. {% endif %}
  113. - type: template
  114. entity: input_boolean.irrigation_wednesday
  115. icon: |-
  116. {% set state=states(entity) %}
  117. {% if state=='on' %}
  118. mdi:alpha-w-circle-outline
  119. {% elif state=='off' %}
  120. mdi:alpha-w-circle-outline
  121. {% else %}
  122. mdi:alpha-w-circle-outline
  123. {% endif %}
  124. tap_action:
  125. action: toggle
  126. icon_color: |-
  127. {% set state=states(entity) %}
  128. {% if state=='on' %}
  129. blue
  130. {% elif state=='off' %}
  131. white
  132. {% else %}
  133. red
  134. {% endif %}
  135. - type: template
  136. entity: input_boolean.irrigation_thursday
  137. icon: |-
  138. {% set state=states(entity) %}
  139. {% if state=='on' %}
  140. mdi:alpha-t-circle-outline
  141. {% elif state=='off' %}
  142. mdi:alpha-t-circle-outline
  143. {% else %}
  144. mdi:alpha-t-circle-outline
  145. {% endif %}
  146. tap_action:
  147. action: toggle
  148. icon_color: |-
  149. {% set state=states(entity) %}
  150. {% if state=='on' %}
  151. blue
  152. {% elif state=='off' %}
  153. white
  154. {% else %}
  155. red
  156. {% endif %}
  157. - type: template
  158. entity: input_boolean.irrigation_friday
  159. icon: |-
  160. {% set state=states(entity) %}
  161. {% if state=='on' %}
  162. mdi:alpha-f-circle-outline
  163. {% elif state=='off' %}
  164. mdi:alpha-f-circle-outline
  165. {% else %}
  166. mdi:alpha-f-circle-outline
  167. {% endif %}
  168. tap_action:
  169. action: toggle
  170. icon_color: |-
  171. {% set state=states(entity) %}
  172. {% if state=='on' %}
  173. blue
  174. {% elif state=='off' %}
  175. white
  176. {% else %}
  177. red
  178. {% endif %}
  179. - type: template
  180. entity: input_boolean.irrigation_saturday
  181. icon: |-
  182. {% set state=states(entity) %}
  183. {% if state=='on' %}
  184. mdi:alpha-s-circle-outline
  185. {% elif state=='off' %}
  186. mdi:alpha-s-circle-outline
  187. {% else %}
  188. mdi:alpha-s-circle-outline
  189. {% endif %}
  190. tap_action:
  191. action: toggle
  192. icon_color: |-
  193. {% set state=states(entity) %}
  194. {% if state=='on' %}
  195. blue
  196. {% elif state=='off' %}
  197. white
  198. {% else %}
  199. red
  200. {% endif %}
  201. - type: template
  202. entity: input_boolean.irrigation_sunday
  203. icon: |-
  204. {% set state=states(entity) %}
  205. {% if state=='on' %}
  206. mdi:alpha-s-circle-outline
  207. {% elif state=='off' %}
  208. mdi:alpha-s-circle-outline
  209. {% else %}
  210. mdi:alpha-s-circle-outline
  211. {% endif %}
  212. tap_action:
  213. action: toggle
  214. icon_color: |-
  215. {% set state=states(entity) %}
  216. {% if state=='on' %}
  217. blue
  218. {% elif state=='off' %}
  219. white
  220. {% else %}
  221. red
  222. {% endif %}
  223.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement