Advertisement
fablav

vacuum_card_map

Apr 26th, 2024 (edited)
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 10.28 KB | Software | 0 0
  1. type: custom:local-conditional-card
  2. id: vacuum_map
  3. default: hide
  4. card:
  5.   type: custom:mod-card
  6.   card_mod:
  7.     style: |
  8.      ha-card {
  9.         height: 630px;
  10.         border: 5px solid var(--sidebar);
  11.         box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.36);5
  12.       }
  13.   card:
  14.     type: vertical-stack
  15.     cards:
  16.       - type: custom:button-card
  17.         entity: vacuum.vacky
  18.         show_name: false
  19.         show_entity_picture: true
  20.         entity_picture: /local/ic/vacuum.svg
  21.         custom_fields:
  22.           button:
  23.             card:
  24.               type: custom:mushroom-chips-card
  25.               chips:
  26.                 - type: template
  27.                   tap_action:
  28.                     action: fire-dom-event
  29.                     local_conditional_card:
  30.                       action: set
  31.                       ids:
  32.                         - vacuum: show
  33.                         - vacuum_map: hide
  34.                   icon: mdi:floor-plan
  35.                   icon_color: white
  36.                   primary: Marker
  37.               card_mod:
  38.                 style:
  39.                   mushroom-template-chip:nth-child(1)$:
  40.                     mushroom-chip$: |
  41.                      ha-card {
  42.                         padding: 5px !important;
  43.                         border-radius: 100px !important;
  44.                         --chip-background: rgba(223,130,108, 1) !important;
  45.                       }
  46.                       ha-card:active {
  47.                         transform: translateY(1.5px);
  48.                         transition: 0s;
  49.                         box-shadow: 0 0.5px 2px 0 rgba(0, 0, 0, 0.16);
  50.                       }
  51.                     .: |
  52.                      ha-state-icon {
  53.                         animation: boing 3s ease infinite;
  54.                         transform-origin: 50% 90%;
  55.                        
  56.                       }
  57.                       @keyframes boing {
  58.                         0% { transform: scale3d(1, 1, 1); }
  59.                         7% { transform: translateY(-4px) scale3d(0.75, 1.25, 1); }
  60.                         10% { transform: scale3d(1.25, 0.75, 1); }
  61.                         12% { transform: translateY(-2px) scale3d(0.85, 1.15, 1); }
  62.                         16% { transform: scale3d(1.05, 0.95, 1); }
  63.                         19% { transform: scale3d(0.95, 1.05, 1); }
  64.                         25% { transform: scale3d(1, 1, 1); }
  65.                       }
  66.         styles:
  67.           custom_fields:
  68.             button:
  69.               - position: absolute
  70.               - top: 20px
  71.               - right: 30px
  72.               - background: none
  73.             styles:
  74.               icon:
  75.                 - height: 10px
  76.           card:
  77.             - border-radius: 20px
  78.             - height: 240px
  79.             - margin-top: '-1px'
  80.             - margin-right: 1px
  81.           icon:
  82.             - height: 140px
  83.             - width: 140px
  84.             - margin-top: '-50px'
  85.             - filter: brightness(0.9)
  86.         state:
  87.           - operator: default
  88.             styles:
  89.               icon:
  90.                 - animation: cleaning 5s linear infinite
  91.               card:
  92.                 - background: var(--sidebar)
  93.           - value: returning
  94.             styles:
  95.               icon:
  96.                 - animation: returning 2s linear infinite
  97.               card:
  98.                 - background: var(--sidebar)
  99.           - value: paused
  100.             styles:
  101.               icon:
  102.                 - opacity: 100%
  103.               card:
  104.                 - background: var(--contrast2)
  105.           - value: docked
  106.             styles:
  107.               icon:
  108.                 - opacity: 50%
  109.               card:
  110.                 - background: transparent
  111.         extra_styles: |
  112.          @keyframes cleaning {
  113.             0% {
  114.               transform: rotate(0) translate(0);
  115.             }
  116.             5% {
  117.               transform: rotate(0) translate(0, -10px);
  118.             }
  119.             10% {
  120.               transform: rotate(0) translate(0, 5px);
  121.             }
  122.             15% {
  123.               transform: rotate(0) translate(0);
  124.             }
  125.             /* Turn left */
  126.             20% {
  127.               transform: rotate(30deg) translate(0);
  128.             }
  129.             25% {
  130.               transform: rotate(30deg) translate(0, -10px);
  131.             }
  132.             30% {
  133.               transform: rotate(30deg) translate(0, 5px);
  134.             }
  135.             35% {
  136.               transform: rotate(30deg) translate(0);
  137.             }
  138.             40% {
  139.               transform: rotate(0) translate(0);
  140.             }
  141.             /* Turn right */
  142.             45% {
  143.               transform: rotate(-30deg) translate(0);
  144.             }
  145.             50% {
  146.               transform: rotate(-30deg) translate(0, -10px);
  147.             }
  148.             55% {
  149.               transform: rotate(-30deg) translate(0, 5px);
  150.             }
  151.             60% {
  152.               transform: rotate(-30deg) translate(0);
  153.             }
  154.             70% {
  155.               transform: rotate(0deg) translate(0);
  156.             }
  157.             /* Staying still */
  158.             100% {
  159.               transform: rotate(0deg);
  160.             }
  161.           }  
  162.           @keyframes returning {
  163.             0% {
  164.               transform: rotate(0);
  165.             }
  166.             25% {
  167.               transform: rotate(10deg);
  168.             }
  169.             50% {
  170.               transform: rotate(0);
  171.             }
  172.             75% {
  173.               transform: rotate(-10deg);
  174.             }
  175.             100% {
  176.               transform: rotate(0);
  177.             }
  178.           }
  179.       - type: custom:xiaomi-vacuum-map-card
  180.         map_source:
  181.           camera: camera.xiaomi_cloud_map_extractor
  182.         calibration_source:
  183.           camera: true
  184.         entity: vacuum.vacky
  185.         vacuum_platform: tykarol/viomi-vacuum-v8
  186.         map_modes:
  187.           - template: vacuum_clean_segment
  188.             name: Camere
  189.             predefined_selections:
  190.               - id: '10'
  191.                 icon:
  192.                   name: mdi:bed-outline
  193.                   x: 2.5500000000000003
  194.                   'y': -7.675000000000001
  195.                 label:
  196.                   text: Cameretta
  197.                   x: 2.5500000000000003
  198.                   'y': -7.675000000000001
  199.                   offset_y: 35
  200.                 outline:
  201.                  - - 0.65
  202.                     - -8.5
  203.                   - - 4.45
  204.                     - -8.5
  205.                   - - 4.45
  206.                     - -6.85
  207.                   - - 0.65
  208.                     - -6.85
  209.               - id: '11'
  210.                 icon:
  211.                   name: mdi:bed-king-outline
  212.                   x: 2.7250000000000005
  213.                   'y': -4.975
  214.                 label:
  215.                   text: Camera
  216.                   x: 2.7250000000000005
  217.                   'y': -4.975
  218.                   offset_y: 35
  219.                 outline:
  220.                  - - 0.8
  221.                     - -6.8
  222.                   - - 4.65
  223.                     - -6.8
  224.                   - - 4.65
  225.                     - -3.15
  226.                   - - 0.8
  227.                     - -3.15
  228.               - id: '12'
  229.                 icon:
  230.                   name: hue:room-kitchen
  231.                   x: 2.5749999999999997
  232.                   'y': 1.725
  233.                 label:
  234.                   text: Cucina
  235.                   x: 2.5749999999999997
  236.                   'y': 1.725
  237.                   offset_y: 35
  238.                 outline:
  239.                  - - -0.15
  240.                     - 0.75
  241.                   - - 5.3
  242.                     - 0.75
  243.                   - - 5.3
  244.                     - 2.7
  245.                   - - -0.15
  246.                     - 2.7
  247.               - id: '13'
  248.                 icon:
  249.                   name: hue:room-living
  250.                   x: 2.4749999999999996
  251.                   'y': -1.2249999999999999
  252.                 label:
  253.                   text: Soggiorno
  254.                   x: 2.4749999999999996
  255.                   'y': -1.2249999999999999
  256.                   offset_y: 35
  257.                 outline:
  258.                  - - -0.4
  259.                     - -3.35
  260.                   - - 5.35
  261.                     - -3.35
  262.                   - - 5.35
  263.                     - 0.9
  264.                   - - -0.4
  265.                     - 0.9
  266.               - id: '14'
  267.                 icon:
  268.                   name: hue:room-hallway
  269.                   x: 6.775
  270.                   'y': -0.300000000000001
  271.                 label:
  272.                   text: Ingresso
  273.                   x: 7.075
  274.                   'y': -1.600000000000001
  275.                   offset_y: 35
  276.                 outline:
  277.                  - - 5.35
  278.                     - -3
  279.                   - - 7.6
  280.                     - -3
  281.                   - - 7.6
  282.                     - 1.6
  283.                   - - 5.35
  284.                     - 1.6
  285.               - id: '15'
  286.                 icon:
  287.                   name: hue:room-computer
  288.                   x: 3.1
  289.                   'y': -10.05
  290.                 label:
  291.                   text: Studio
  292.                   x: 3.1
  293.                   'y': -10.05
  294.                   offset_y: 35
  295.                 outline:
  296.                  - - 0.75
  297.                     - -11
  298.                   - - 5.45
  299.                     - -11
  300.                   - - 5.45
  301.                     - -9.1
  302.                   - - 0.75
  303.                     - -9.1
  304.               - id: '16'
  305.                 icon:
  306.                   name: mdi:broom
  307.                   x: 6.125000000000001
  308.                   'y': -6.175
  309.                 label:
  310.                   text: Corridoio
  311.                   x: 6.325000000000001
  312.                   'y': -7.175
  313.                   offset_y: 35
  314.                 outline:
  315.                  - - 4.4
  316.                     - -9.35
  317.                   - - 7.45
  318.                     - -9.35
  319.                   - - 7.45
  320.                     - -3
  321.                   - - 4.4
  322.                     - -3
  323.           - template: vacuum_clean_zone
  324.             name: Pulizia a zone
  325.           - template: vacuum_clean_point
  326.             namw: Punti
  327.         map_locked: true
  328.         tiles: []
  329.         card_mod:
  330.           style: |
  331.            ha-card {
  332.               #height: 335px;
  333.               margin-top: -65px;
  334.               background: transparent !important ;
  335.               border: none !important;
  336.               border-radius: 20px !important;
  337.             }
  338.  
Tags: ha vacuum
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement