Created
September 18, 2022 17:23
-
-
Save anderser/31361d7b363cc90d37c96d2d5168e366 to your computer and use it in GitHub Desktop.
Count lights on Home Assistant mushroom card
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type: custom:mushroom-template-card | |
primary: >- | |
{% if (states.light | selectattr('state', 'eq', 'on') | list | count |float) > | |
0 %} | |
{{ states.light | selectattr('state', 'eq', 'on') | list | count }} lys på | |
{% else %} | |
Ingen lys på | |
{%endif%} | |
secondary: '' | |
icon: mdi:lightbulb | |
layout: vertical | |
icon_color: >- | |
{% if (states.light | selectattr('state', 'eq', 'on') | list | count |float) > | |
0 %} | |
yellow | |
{% else %} | |
grey | |
{%endif%} | |
badge_icon: '' | |
fill_container: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment