Advertisement
p33j4y

HA: Rosita Jetson card

Feb 25th, 2020
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 6.96 KB | None | 0 0
  1. BUTTON CARD TEMPLATE:
  2. #################### nagłówki
  3. header:
  4.   styles:
  5.     card:
  6.     - padding: 5px 15px
  7.     - background-color: var(--paper-item-icon-color)
  8.     - margin: 0px auto 0px auto
  9.     name:
  10.     - text-transform: uppercase
  11.     - color: var(--primary-background-color)
  12.     - justify-self: start
  13.     - font-weight: bold
  14.     - font-size: 1.2em
  15. default_vertical:
  16.   hold_action:
  17.     action: more-info
  18.   styles:
  19.   - size: 40%
  20.     icon:
  21.     - color: auto
  22.     name:
  23.     - padding-top: 15px
  24.     - letter-spacing: 0px
  25.     state:
  26.     - value: "off"
  27.       background-color: rgb(0, 0, 0)
  28. default_icon:
  29.   template: default_vertical
  30.   show_name: false
  31.   styles:
  32.     icon:
  33.     - color: var(--state-icon-color)
  34.  
  35. LOVELACE VIEW:
  36. #################### odkurzacz
  37. - type: vertical-stack
  38.   cards:
  39.   - type: custom:button-card
  40.     style: &round_card |
  41.      ha-card {
  42.         border-radius: 12px !important;
  43.         ### warunek przygotowany pod zmianę themsa na czarny gdy zajdzie słońce - ale na razie nie jest używany
  44.         box-shadow:
  45.           {% if is_state('sun.sun', 'below_horizon') %}
  46.             0px 0px 5px 1px rgba(0,0,0,0.25);
  47.           {% else %}
  48.             0px 0px 5px 1px rgba(0,0,0,0.25);
  49.           {% endif %}
  50.       }
  51.       ha-card div.no-header {
  52.         padding-top: 2px !important;
  53.       }
  54.       ha-card div.no-header div.entity {
  55.         margin-bottom: 2px !important;
  56.         font-size: 0.9em !important;
  57.       }
  58.     template: header
  59.     name: Rosita Jetson
  60.   #################### status
  61.   - type: horizontal-stack
  62.     cards:
  63.     - attribute: battery_level
  64.       name: "\U0001f50b"
  65.       type: custom:circle-sensor-card
  66.       entity: vacuum.1_lvn_rosita
  67.       max: 100
  68.       min: 0
  69.       units: "%"
  70.       stroke_width: 10
  71.       color_stops:
  72.         20: '#DF4C1E'
  73.         70: '#f4b400'
  74.         100: '#0DA035'
  75.     - attribute: main_brush_left
  76.       name: "\U0001f300"
  77.       type: custom:circle-sensor-card
  78.       entity: vacuum.1_lvn_rosita
  79.       max: 300
  80.       min: 0
  81.       units: "h"
  82.       stroke_width: 10
  83.       color_stops:
  84.         7: '#DF4C1E'
  85.         60: '#f4b400'
  86.         100: '#0DA035'
  87.         295: '#039be5'
  88.     - attribute: side_brush_left
  89.       name: "\U0001f9f9"
  90.       type: custom:circle-sensor-card
  91.       entity: vacuum.1_lvn_rosita
  92.       max: 300
  93.       min: 0
  94.       units: "h"
  95.       stroke_width: 10
  96.       color_stops:
  97.         7: '#DF4C1E'
  98.         60: '#f4b400'
  99.         100: '#0DA035'
  100.         295: '#039be5'
  101.     - attribute: filter_left
  102.       name: "\U0001f637"
  103.       type: custom:circle-sensor-card
  104.       entity: vacuum.1_lvn_rosita
  105.       max: 150
  106.       min: 0
  107.       units: "h"
  108.       stroke_width: 10
  109.       color_stops:
  110.         7: '#DF4C1E'
  111.         50: '#f4b400'
  112.         100: '#0DA035'
  113.         150: '#039be5'
  114.     - attribute: sensor_dirty_left
  115.       name: "\U0001f6bf"
  116.       type: custom:circle-sensor-card
  117.       entity: vacuum.1_lvn_rosita
  118.       max: 30
  119.       min: 0
  120.       units: "h"
  121.       stroke_width: 10
  122.       color_stops:
  123.         5: '#DF4C1E'
  124.         10: '#f4b400'
  125.         20: '#0DA035'
  126.         30: '#039be5'
  127.   #################### pilot
  128.   - type: horizontal-stack
  129.     cards:
  130.     - name: Start
  131.       type: custom:button-card
  132.       style: *round_card
  133.       template: default_icon
  134.       entity: vacuum.1_lvn_rosita
  135.       color_type: icon
  136.       icon: mdi:play
  137.       styles:
  138.         icon:
  139.         - color: >
  140.            [[[
  141.               var temps = `${entity.state}`;
  142.               return (temps == 'cleaning') ? 'var(--state-icon-active-color)' : 'var(--state-icon-color)';
  143.             ]]]
  144.       tap_action:
  145.         action: call-service
  146.         service: vacuum.start
  147.         service_data:
  148.           entity_id: vacuum.1_lvn_rosita
  149.     - name: Punktowe
  150.       type: custom:button-card
  151.       style: *round_card
  152.       template: default_icon
  153.       entity: vacuum.1_lvn_rosita
  154.       color_type: icon
  155.       icon: mdi:bullseye
  156.       styles:
  157.         icon:
  158.         - color: >
  159.            [[[
  160.               var temps = `${entity.state}`;
  161.               return (temps == 'spot') ? 'var(--state-icon-active-color)' : 'var(--state-icon-color)';
  162.             ]]]
  163.       tap_action:
  164.         action: call-service
  165.         service: vacuum.clean_spot
  166.         service_data:
  167.           entity_id: vacuum.1_lvn_rosita
  168.     - name: Przerwa
  169.       type: custom:button-card
  170.       style: *round_card
  171.       template: default_icon
  172.       entity: vacuum.1_lvn_rosita
  173.       color_type: icon
  174.       icon: mdi:pause
  175.       tap_action:
  176.         action: call-service
  177.         service: vacuum.pause
  178.         service_data:
  179.           entity_id: vacuum.1_lvn_rosita
  180.       styles:
  181.         icon:
  182.         - color: >
  183.            [[[
  184.               var temps = `${entity.state}`;
  185.               return (temps == 'paused') ? 'var(--state-icon-active-color)' : 'var(--state-icon-color)';
  186.             ]]]
  187.     - name: Stop
  188.       type: custom:button-card
  189.       style: *round_card
  190.       template: default_icon
  191.       entity: vacuum.1_lvn_rosita
  192.       color_type: icon
  193.       icon: mdi:stop
  194.       tap_action:
  195.         action: call-service
  196.         service: vacuum.stop
  197.         service_data:
  198.           entity_id: vacuum.1_lvn_rosita
  199.     - name: Dokuj
  200.       type: custom:button-card
  201.       style: *round_card
  202.       template: default_icon
  203.       entity: vacuum.1_lvn_rosita
  204.       color_type: icon
  205.       icon: mdi:home
  206.       styles:
  207.         icon:
  208.         - color: >
  209.            [[[
  210.               var temps = `${entity.state}`;
  211.               return (temps == 'returning') ? 'var(--state-icon-active-color)' : 'var(--state-icon-color)';
  212.             ]]]
  213.       tap_action:
  214.         action: call-service
  215.         service: vacuum.return_to_base
  216.         service_data:
  217.           entity_id: vacuum.1_lvn_rosita
  218.     - name: Valetudo
  219.       type: custom:button-card
  220.       style: *round_card
  221.       template: default_icon
  222.       entity: vacuum.1_lvn_rosita
  223.       color_type: icon
  224.       icon: mdi:remote
  225.       styles:
  226.         icon:
  227.         - color: >
  228.            [[[
  229.               var temps = `${entity.state}`;
  230.               return (temps == 'docked') ? 'var(--state-icon-color)' : 'var(--state-icon-active-color)';
  231.             ]]]
  232.       tap_action:
  233.         action: url
  234.         url_path: !secret rosita_url
  235.   #################### mapka
  236.   - type: custom:xiaomi-vacuum-map-card
  237.     style: *round_card
  238.     entity: vacuum.1_lvn_rosita
  239.     map_image: '/local/vacuum_maps/vacuum_map_0_v202001262333.png'
  240.     language: pl
  241.     calibration_points:
  242.     - vacuum:
  243.        # baza
  244.         x: 25610
  245.         y: 25877
  246.       map:
  247.         x: 212
  248.         y: 114
  249.     - vacuum:
  250.        # rosita w kuchni
  251.         x: 31289
  252.         y: 24544
  253.       map:
  254.         x: 659
  255.         y: 220
  256.     - vacuum:
  257.        # rosita pod schodami
  258.         x: 29844
  259.         y: 22261
  260.       map:
  261.         x: 545
  262.         y: 396
  263.     zones:
  264.    - [[29534,25169,32819,24201,1]] # Kuchnia
  265.     - [[31801,23576,33493,22291,1]] # Korytarz
  266.     - [[24827,21513,27060,20321,1]] # Taras
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement