Advertisement
johannwilken

Rooms Card

Aug 8th, 2022
1,105
-1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 7.16 KB | None | 0 1
  1. type: custom:stack-in-card
  2. mode: vertical
  3. cards:
  4.   - type: custom:mushroom-template-card
  5.     primary: Master Bedroom
  6.     secondary: >-
  7.       {{(states('sensor.master_bedroom_temperature')) }} °C | {{
  8.       (states('sensor.master_bedroom_humidity')) }} %
  9.     icon: mdi:bed
  10.     layout: horizontal
  11.     multiline_secondary: false
  12.     tap_action:
  13.       action: navigate
  14.       navigation_path: mb
  15.     icon_color: deep-purple
  16.     hold_action:
  17.       action: none
  18.     double_tap_action:
  19.       action: none
  20.     style: |
  21.      :host([dark-mode]) {
  22.         background: rgba(var(--rgb-primary-background-color), 0.2);
  23.       }
  24.       :host {
  25.         background: rgba(var(--rgb-primary-text-color), 0.025);
  26.       }
  27.   - type: custom:mushroom-chips-card
  28.     style: |
  29.      ha-card {
  30.         --chip-box-shadow: none;
  31.         --chip-background: none;
  32.         --chip-spacing: 0;
  33.       }
  34.     alignment: center
  35.     chips:
  36.       - type: template
  37.         entity: binary_sensor.master_bedroom_motion
  38.         icon: |-
  39.           {% set state=states(entity) %}
  40.           {% if state=='on' %}
  41.           mdi:motion-sensor
  42.           {% elif state=='off' %}
  43.           mdi:motion-sensor-off
  44.           {% else %}
  45.           mdi:motion-sensor-off
  46.           {% endif %}
  47.         tap_action:
  48.           action: more-info
  49.         icon_color: |-
  50.           {% set state=states(entity) %}
  51.           {% if state=='on' %}
  52.           red
  53.           {% elif state=='off' %}
  54.           green
  55.           {% else %}
  56.           gray
  57.           {% endif %}
  58.         style: |
  59.          ha-card {
  60.             {% if states('binary_sensor.master_bedroom_motion') == 'on' %}
  61.             animation: blink 0.9s linear infinite;
  62.             }
  63.             @keyframes blink {
  64.               50% {opacity: 0;}
  65.               }
  66.             {%- else -%}
  67.             box-shadow: 0px 0px;
  68.             {%- endif %}
  69.           ha-card {
  70.             box-shadow: 0px 0px;
  71.       - type: template
  72.         entity: light.master_bedroom_light
  73.         icon: |-
  74.           {% set state=states(entity) %}
  75.           {% if state=='on' %}
  76.           mdi:lightbulb-on-outline
  77.           {% elif state=='off' %}
  78.           mdi:lightbulb-off-outline
  79.           {% else %}
  80.           mdi-lightbulb-outline
  81.           {% endif %}
  82.         tap_action:
  83.           action: toggle
  84.         hold_action:
  85.           action: more-info
  86.         icon_color: |-
  87.           {% set state=states(entity) %}
  88.           {% if state=='on' %}
  89.           yellow
  90.           {% elif state=='off' %}
  91.           white
  92.           {% else %}
  93.           gray
  94.           {% endif %}
  95.         style: |
  96.          ha-card {
  97.             {% if states('light.master_bedroom_light') == 'on' %}
  98.             animation: blink 0.9s linear infinite;
  99.             }
  100.             @keyframes blink {
  101.               50% {opacity: 0;}
  102.               }
  103.             {%- else -%}
  104.             box-shadow: 0px 0px;
  105.             {%- endif %}
  106.           ha-card {
  107.             box-shadow: 0px 0px;
  108.       - type: template
  109.         entity: light.master_bedroom_bedlamps
  110.         icon: |-
  111.           {% set state=states(entity) %}
  112.           {% if state=='on' %}
  113.           mdi:lamp
  114.           {% elif state=='off' %}
  115.           mdi:lamp
  116.           {% else %}
  117.           mdi:lamp
  118.           {% endif %}
  119.         tap_action:
  120.           action: call-service
  121.           service: script.popup_master_bedroom_bed_lights
  122.         hold_action:
  123.           action: more-info
  124.         icon_color: |-
  125.           {% set state=states(entity) %}
  126.           {% if state=='on' %}
  127.           pink
  128.           {% elif state=='off' %}
  129.           white
  130.           {% else %}
  131.           gray
  132.           {% endif %}
  133.         style: |
  134.          ha-card {
  135.             {% if states('light.master_bedroom_bedlamps') == 'on' %}
  136.             animation: blink 0.9s linear infinite;
  137.             }
  138.             @keyframes blink {
  139.               50% {opacity: 0;}
  140.               }
  141.             {%- else -%}
  142.             box-shadow: 0px 0px;
  143.             {%- endif %}
  144.           ha-card {
  145.             box-shadow: 0px 0px;
  146.       - type: template
  147.         entity: fan.master_bedroom_fan
  148.         icon: |-
  149.           {% set state=states(entity) %}
  150.           {% if state=='on' %}
  151.           mdi:fan
  152.           {% elif state=='off' %}
  153.           mdi:fan
  154.           {% else %}
  155.           mdi:fan-alert
  156.           {% endif %}
  157.         tap_action:
  158.           action: more-info
  159.         icon_color: |-
  160.           {% set state=states(entity) %}
  161.           {% if state=='on' %}
  162.           blue
  163.           {% elif state=='off' %}
  164.           white
  165.           {% else %}
  166.           gray
  167.           {% endif %}
  168.         style: |
  169.          @keyframes rotation {
  170.             0% {
  171.               transform: rotate(0deg);
  172.             }
  173.             100% {
  174.               transform: rotate(360deg);
  175.             }
  176.           }
  177.           ha-card {
  178.             box-shadow: 0px 0px;
  179.             animation: rotation linear infinite;
  180.             {% if states('fan.master_bedroom_fan') == 'on' %}
  181.              animation-duration: 3s;
  182.             {%- else -%}
  183.             {%- endif %}
  184.             template
  185.       - type: template
  186.         entity: switch.master_bedroom_tv_hisense
  187.         icon: |-
  188.           {% set state=states(entity) %}
  189.           {% if state=='on' %}
  190.           mdi:television-classic
  191.           {% elif state=='off' %}
  192.           mdi:television-classic-off
  193.           {% else %}
  194.           mdi:tv
  195.           {% endif %}
  196.         tap_action:
  197.           action: more-info
  198.         icon_color: |-
  199.           {% set state=states(entity) %}
  200.           {% if state=='on' %}
  201.           purple
  202.           {% elif state=='off' %}
  203.           white
  204.           {% else %}
  205.           gray
  206.           {% endif %}
  207.       - type: template
  208.         entity: media_player.master_bedroom_speaker
  209.         icon: |-
  210.           {% set state=states(entity) %}
  211.           {% if state=='playing' %}
  212.           mdi:google-home
  213.           {% elif state=='off' %}
  214.           mdi:google-home
  215.           {% else %}
  216.           mdi:google-home
  217.           {% endif %}
  218.         tap_action:
  219.           action: more-info
  220.         icon_color: |-
  221.           {% set state=states(entity) %}
  222.           {% if state=='playing' %}
  223.           purple
  224.           {% elif state=='off' %}
  225.           white
  226.           {% else %}
  227.           gray
  228.           {% endif %}
  229.       - type: template
  230.         entity: switch.basic
  231.         icon: |-
  232.           {% set state=states(entity) %}
  233.           {% if state=='on' %}
  234.           mdi:toothbrush-electric
  235.           {% elif state=='off' %}
  236.           mdi:toothbrush-electric
  237.           {% else %}
  238.           mdi:toothbrush-electric
  239.           {% endif %}
  240.         tap_action:
  241.           action: more-info
  242.         icon_color: |-
  243.           {% set state=states(entity) %}
  244.           {% if state=='on' %}
  245.           purple
  246.           {% elif state=='off' %}
  247.           white
  248.           {% else %}
  249.           gray
  250.           {% endif %}
  251. style: |
  252.  ha-card {
  253.     height: 102px;
  254.     {% if is_state('light.master_bedroom_light', 'on') %}
  255.        background: rgba(255, 152, 0, 0.1);
  256.     {% endif %}
  257.     {% if is_state('light.master_bedroom_bedlamps', 'on') %}
  258.        background: rgba(255, 152, 0, 0.1);
  259.     {% endif %}
  260.   }
  261.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement