I created a template sensor to count what lights are on and also get a list of the lights that are on
- name: "Lights On"
unique_id: ui_template_lights_on
unit_of_measurement: entities
state: >
{% if state_attr('sensor.lights_on','entity_id') != none %}
{{ state_attr('sensor.lights_on','entity_id') | count }}
{% else %}
{{ 0 }}
{% endif %}
attributes:
entity_id: >
{{
states.light | selectattr('state', 'eq', 'on')
| rejectattr('attributes.entity_id', 'defined')
| map(attribute='name') | list
}}
Now i want to display this in a lovelace card. i was trying to use the entity card to list the entities that are on, but the output doesn’t look that nice. is there a way to justify the entities within the entity card, or do i need to search for a custom card to display the attribute in a nicer way