Advertisement
Guest User

docker_auto_entities_custom_button_grid

a guest
Jul 22nd, 2021
1,187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.34 KB | None | 0 0
  1. type: custom:auto-entities
  2. card:
  3.   type: grid
  4. card_param: cards
  5. filter:
  6.   include:
  7.     - entity_id: sensor.docker_*_state
  8.       options:
  9.         custom_fields:
  10.           cpu: |
  11.            [[[
  12.               return `<ha-icon
  13.                 icon="mdi:chip"
  14.                 style="width: 20px; height: 20px; color: #B58E31;">
  15.                 </ha-icon><span> CPU: <span style=color: var(--text-color-sensor);>${states['sensor.docker_homeassistant_cpu'].state}%</span></span>`
  16.             ]]]
  17.           state: |
  18.            [[[
  19.               return `<ha-icon
  20.                 icon="mdi:power"
  21.                 style="width: 20px; height: 20px; color: #B58E31;">
  22.                 </ha-icon><span> State: <span style=color: var(--text-color-sensor);>${states['sensor.docker_homeassistant_state'].state}</span></span>`
  23.             ]]]
  24.           mem: |
  25.            [[[
  26.               return `<ha-icon
  27.                 icon="mdi:chip"
  28.                 style="width: 20px; height: 20px; color: #B58E31;">
  29.                 </ha-icon><span> RAM: <span style=color: var(--text-color-sensor);>${states['sensor.docker_homeassistant_memory'].state} MB</span></span>`
  30.             ]]]
  31.           up: |
  32.            [[[
  33.               return `<ha-icon
  34.                 icon="mdi:power"
  35.                 style="width: 20px; height: 20px; color: #B58E31;">
  36.                 </ha-icon><span> <span style=color: var(--text-color-sensor);>${states['sensor.docker_homeassistant_status'].state}</span></span>`
  37.             ]]]
  38.         show_entity_picture: true
  39.         show_state: false
  40.         size: 70px
  41.         state:
  42.           - entity_picture: /local/images/docker_2.png
  43.             styles:
  44.               entity_picture:
  45.                 - filter: grayscale(90%)
  46.             operator: default
  47.           - entity_picture: /local/images/docker_2.png
  48.             value: running
  49.         styles:
  50.           custom_fields:
  51.             cpu:
  52.               - padding-bottom: 0px
  53.               - align-self: start
  54.               - padding-left: 2px
  55.               - font-size: 12px
  56.               - justify-self: start
  57.             up:
  58.               - padding-bottom: 0px
  59.               - align-self: start
  60.               - padding-left: 2px
  61.               - font-size: 12px
  62.               - justify-self: start
  63.             mem:
  64.               - padding-bottom: 0px
  65.               - align-self: start
  66.               - padding-left: 2px
  67.               - font-size: 12px
  68.               - justify-self: start
  69.             state:
  70.               - padding-bottom: 0px
  71.               - align-self: start
  72.               - padding-left: 2px
  73.               - font-size: 12px
  74.               - justify-self: start
  75.           grid:
  76.             - grid-template-areas: '"i i" "n n" "state state" "up up" "cpu cpu" "mem mem"'
  77.             - grid-template-columns: 1fr 1fr
  78.             - grid-template-rows: 1fr min-content min-content min-content min-content
  79.           name:
  80.             - font-weight: bold
  81.             - font-size: 16px
  82.             - color: rgb(18,154,190)
  83.             - align-self: middle
  84.             - justify-self: middle
  85.             - padding-bottom: 4px
  86.           card:
  87.             - height: 165px
  88.         tap_action:
  89.           action: call-service
  90.           service: switch.toggle
  91.           service_data:
  92.             entity_id: switch.docker_homeassistant
  93.         type: custom:button-card
  94.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement