Advertisement
Guest User

HaCasa Vacuum Card

a guest
May 9th, 2025
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 6.05 KB | None | 0 0
  1. hc_vacuum_card:
  2.   variables:
  3.     icon: mdi:robot-vacuum
  4.     action_1:
  5.       icon: mdi:vacuum
  6.       on_action: vacuum.send_command
  7.     action_2:
  8.       icon: mdi:water-plus
  9.       on_action: vacuum.send_command
  10.     action_3:
  11.       icon: fapro:kitchen-set
  12.       on_action: vacuum.send_command
  13.   show_label: true
  14.   label: |
  15.    [[[
  16.       const state = states[entity.entity_id].state;
  17.       return state.charAt(0).toUpperCase() + state.slice(1);
  18.     ]]]
  19.   name: |
  20.     [[[ return 'Battery: ' + states[entity.entity_id].attributes.battery_level + '%' ]]]
  21.   show_icon: true
  22.   icon: "[[[ return variables.icon ]]]"
  23.   styles:
  24.     grid:
  25.       - grid-template-areas: |
  26.          'i room_buttons buttons'
  27.           'i room_buttons buttons'
  28.           'i room_buttons buttons'
  29.       - grid-template-columns: 1fr auto auto
  30.       - grid-template-rows: min-content min-content min-content
  31.     card:
  32.       - overflow: hidden
  33.       - padding: 20px
  34.       - pointer-events: none
  35.     name:
  36.       - grid-area: i
  37.       - justify-self: start
  38.       - align-self: start
  39.       - opacity: 0.8
  40.       - font-size: 12px
  41.       - font-family: montserrat
  42.       - font-weight: 400
  43.       - z-index: 2
  44.     label:
  45.       - grid-area: i
  46.       - padding-top: 12px
  47.       - justify-self: start
  48.       - align-self: start
  49.       - font-weight: 700
  50.       - font-family: montserrat
  51.       - z-index: 2
  52.       - padding-top: 20px
  53.     img_cell:
  54.       - position: absolute
  55.       - top: 40%
  56.       - right: 40%
  57.       - overflow: visible
  58.     icon:
  59.       - position: absolute
  60.       - overflow: visible
  61.     custom_fields:
  62.   tap_action: none
  63.   custom_fields:
  64.     room_buttons:
  65.       card:
  66.         type: custom:button-card
  67.         styles:
  68.           grid:
  69.             - grid-template-areas: |
  70.                'room1'
  71.                 'room2'
  72.                 'room3'
  73.             - row-gap: 0.3rem
  74.           card:
  75.             - padding: 10px
  76.             - border-radius: 45px
  77.             - background-color: var(--background)
  78.             - z-index: 2
  79.             - height: 165px
  80.             - width: 125px
  81.             - position: absolute
  82.             - right: -65px
  83.             - bottom: -82px
  84.             - pointer-events: none
  85.         custom_fields:
  86.           room1:
  87.             card:
  88.               type: custom:button-card
  89.               icon: "[[[ return variables.action_1.icon ]]]"
  90.               styles:
  91.                 icon:
  92.                   - width: 25px
  93.                   - height: 25px
  94.                   - position: relative
  95.                   - right: 30px
  96.                 card:
  97.                   - padding: 10px
  98.                   - border-radius: 500px
  99.                   - background: none
  100.                   - box-shadow: none
  101.                   - pointer-events: auto
  102.               tap_action:
  103.                 action: call-service
  104.                 service: button.press
  105.                 target:
  106.                   entity_id: button.q8_max_vacuum_only
  107.           room2:
  108.             card:
  109.               type: custom:button-card
  110.               icon: "[[[ return variables.action_2.icon ]]]"
  111.               styles:
  112.                 icon:
  113.                   - width: 25px
  114.                   - height: 25px
  115.                   - position: relative
  116.                   - right: 30px
  117.                 card:
  118.                   - padding: 10px
  119.                   - border-radius: 500px
  120.                   - background: none
  121.                   - box-shadow: none
  122.                   - pointer-events: auto
  123.               tap_action:
  124.                 action: call-service
  125.                 service: button.press
  126.                 target:
  127.                   entity_id: button.q8_max_full_cleaning
  128.           room3:
  129.             card:
  130.               type: custom:button-card
  131.               icon: "[[[ return variables.action_3.icon ]]]"
  132.               styles:
  133.                 icon:
  134.                   - width: 25px
  135.                   - height: 25px
  136.                   - position: relative
  137.                   - right: 30px
  138.                 card:
  139.                   - padding: 10px
  140.                   - border-radius: 500px
  141.                   - background: none
  142.                   - box-shadow: none
  143.                   - pointer-events: auto
  144.               tap_action:
  145.                 action: call-service
  146.                 service: button.press
  147.                 target:
  148.                   entity_id: button.q8_max_after_meals
  149.     buttons:
  150.       card:
  151.         type: custom:button-card
  152.         styles:
  153.           grid:
  154.             - grid-template-areas: |
  155.                'item_1'
  156.                 'item_2'
  157.                 'item_3'
  158.             - row-gap: 0.3rem
  159.           card:
  160.             - padding: 10px
  161.             - border-radius: 50px
  162.             - background-color: var(--contrast-10)
  163.             - z-index: 3
  164.         custom_fields:
  165.           item_1:
  166.             card:
  167.               type: custom:button-card
  168.               icon: mdi:home
  169.               styles: &icon_style
  170.                 icon:
  171.                   - width: 25px
  172.                 card:
  173.                   - padding: 10px
  174.                   - border-radius: 500px
  175.                   - background: none
  176.                   - box-shadow: none
  177.                   - pointer-events: auto
  178.               tap_action:
  179.                 action: perform-action
  180.                 perform_action: vacuum.return_to_base
  181.                 target:
  182.                   entity_id: '[[[ return entity.entity_id ]]]'
  183.           item_2:
  184.             card:
  185.               type: custom:button-card
  186.               icon: mdi:pause
  187.               styles: *icon_style
  188.               tap_action:
  189.                 action: perform-action
  190.                 perform_action: vacuum.pause
  191.                 target:
  192.                   entity_id: '[[[ return entity.entity_id ]]]'
  193.           item_3:
  194.             card:
  195.               type: custom:button-card
  196.               icon: mdi:play
  197.               styles: *icon_style
  198.               tap_action:
  199.                 action: perform-action
  200.                 perform_action: vacuum.start
  201.                 target:
  202.                   entity_id: '[[[ return entity.entity_id ]]]'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement