Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type: custom:layout-card
- layout_type: custom:grid-layout
- layout_options:
- width: 100
- layout:
- grid-template-columns: 40% 60%
- grid-template-rows: auto
- cards:
- - type: custom:mushroom-template-card
- entity: light.living_room_lights
- primary: >-
- {%- set count_of_lights_on = states.light
- | selectattr('entity_id', 'in', area_entities('Living Room'))
- | rejectattr('entity_id', 'in', integration_entities('group'))
- | selectattr('state' , 'eq' , 'on')
- | sort(attribute='name')
- | map(attribute = 'entity_id')
- | list | count
- -%}
- {%- set count_of_lights = states.light
- | selectattr('entity_id', 'in', area_entities('Living Room'))
- | rejectattr('entity_id', 'in', integration_entities('group'))
- | selectattr('state' , 'in' , ['on','off'])
- | sort(attribute='name')
- | map(attribute = 'entity_id')
- | list | count
- -%}
- {% if (count_of_lights_on == 0) %}All off
- {% elif (count_of_lights == count_of_lights_on) %}All On
- {% elif (count_of_lights_on != count_of_lights) %}{{count_of_lights_on}} of {{count_of_lights}} lights on
- {% endif %}
- icon: mdi:power
- icon_color: "{% if is_state(entity, 'on') %} amber {% else %} disabled {% endif %}"
- icon_tap_action:
- action: toggle
- icon_hold_action:
- action: more-info
- card_mod:
- style: |
- ha-card {
- border: none;
- background: none;
- height: 75px !important;
- }
- - type: custom:auto-entities
- card:
- type: custom:layout-card
- layout_type: custom:grid-layout
- layout_options:
- width: 100
- layout:
- grid-template-columns: 200px 200px 200px
- grid-template-rows: auto
- card_param: cards
- filter:
- include:
- - options:
- type: custom:mushroom-entity-card
- entity_id: this.entity_id
- layout: horizontal
- secondary_info: none
- tap_action:
- action: toggle
- hold_action:
- action: more-info
- domain: light
- area: Living Room
- exclude:
- - state: unavailable
- - integration: group
Advertisement
Add Comment
Please, Sign In to add comment