d_sellers1

Hichiro's custom garage card v0.2

Jun 13th, 2024
777
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.90 KB | None | 0 0
  1. type: custom:button-card
  2. variables:
  3.   garage_door_entity: cover.hall_window
  4.   garage_light_entity: input_boolean.tester
  5.   garage_automation_entity: input_boolean.tester
  6.   garage_timer_entity: timer.tester
  7. entity: '[[[ return variables.garage_door_entity ]]]'
  8. name: Garage
  9. show_label: true
  10. state:
  11.   - value: open
  12.     icon: mdi:garage-open-variant
  13.     color: red
  14.     label: "[[[ return (states[variables.garage_door_entity].attributes.current_position == 100) ? 'Open' : `${states[variables.garage_door_entity].attributes.current_position}% Open` ]]]"
  15.   - value: closed
  16.     icon: mdi:garage-variant-lock
  17.     color: green
  18.     label: Closed
  19.   - value: opening
  20.     icon: mdi:archive-arrow-up
  21.     color: khaki
  22.     label: Opening
  23.     styles:
  24.       label:
  25.         - animation: blink 2s ease infinite
  26.   - value: closing
  27.     icon: mdi:archive-arrow-down
  28.     color: khaki
  29.     label: Closing
  30.     styles:
  31.       label:
  32.         - animation: blink 2s ease infinite
  33. styles:
  34.   card:
  35.     - background: transparent
  36.   custom_fields:
  37.     automatic:
  38.       - top: 10%
  39.       - left: 5%
  40.       - position: absolute
  41.       - color: khaki
  42.     light:
  43.       - bottom: 10%
  44.       - left: 5%
  45.       - position: absolute
  46.     fifty:
  47.       - top: 35%
  48.       - right: 5%
  49.       - position: absolute
  50.     twenty-five:
  51.       - top: 10%
  52.       - right: 5%
  53.       - position: absolute
  54.     timer-bar-card:
  55.       - align-self: left
  56.       - justify-self: left
  57.       - position: absolute
  58.       - width: 100%
  59.       - left: 0%
  60.       - bottom: '-16px'
  61.       - opacity: 75%
  62. tap_action:
  63.   action: toggle
  64. custom_fields:
  65.   automatic:
  66.     card:
  67.       type: custom:button-card
  68.       entity: '[[[ return variables.garage_automation_entity ]]]'
  69.       show_icon: false
  70.       show_name: false
  71.       show_label: true
  72.       state:
  73.         - value: 'on'
  74.           color: khaki
  75.           label: Auto ON
  76.           styles:
  77.             card:
  78.               - border-color: yellow
  79.         - value: 'off'
  80.           color: gray
  81.           label: Auto OFF
  82.       styles:
  83.         card:
  84.           - height: 50px
  85.           - width: auto
  86.           - padding: 10px
  87.   light:
  88.     card:
  89.       type: custom:button-card
  90.       entity: '[[[ return variables.garage_light_entity ]]]'
  91.       show_name: false
  92.       state:
  93.         - value: 'on'
  94.           icon: mdi:lightbulb-on-outline
  95.           color: khaki
  96.           styles:
  97.             card:
  98.               - border-color: yellow
  99.         - value: 'off'
  100.           icon: mdi:lightbulb
  101.           color: gray
  102.       styles:
  103.         card:
  104.           - height: 50px
  105.           - width: 50px
  106.   fifty:
  107.     card:
  108.       type: custom:button-card
  109.       name: 50%
  110.       styles:
  111.         card:
  112.           - height: 50px
  113.           - width: 50px
  114.       tap_action:
  115.         action: call-service
  116.         service: cover.set_cover_position
  117.         service_data:
  118.           entity_id: '[[[ return variables.garage_door_entity ]]]'
  119.           position: 50
  120.   twenty-five:
  121.     card:
  122.       type: custom:button-card
  123.       name: 25%
  124.       styles:
  125.         card:
  126.           - height: 50px
  127.           - width: 50px
  128.       tap_action:
  129.         action: call-service
  130.         service: cover.set_cover_position
  131.         service_data:
  132.           entity_id: '[[[ return variables.garage_door_entity ]]]'
  133.           position: 25
  134.   timer-bar-card:
  135.     card:
  136.       type: custom:timer-bar-card
  137.       entity: '[[[ return variables.garage_timer_entity ]]]'
  138.       translations:
  139.         idle: "\_"
  140.       layout: full_row
  141.       invert: true
  142.       bar_background: none
  143.       bar_height: 6px
  144.       bar_radius: 5px
  145.       text_width: 0px
  146.       sync_issues: fix
  147.       tap_action:
  148.         action: none
  149.       modifications:
  150.         - remaining: 100%
  151.           bar_foreground: lime
  152.         - remaining: 75%
  153.           bar_foreground: orange
  154.         - remaining: 50%
  155.           bar_foreground: yellow
  156.         - remaining: 25%
  157.           bar_foreground: red
  158.  
Advertisement
Add Comment
Please, Sign In to add comment