Open Milinator opened 8 months ago
i too have been trying to get this work
There might be another way to do this, but I have been using the template filter to return a list of objects instead of just a list of entity IDs.
Here is an example:
type: custom:auto-entities
card:
type: entities
filter:
template: |
{% set ns = namespace(list=[]) %}
{% for light in states.light %}
{% if light.state == "on" %}
{% set ns.list = ns.list +
[
{
'type': 'custom:multiple-entity-row',
'entity': light.entity_id,
'name': light.attributes.friendly_name,
'state_color': true,
'show_state': false,
'entities': [
{
'entity': light.entity_id,
'name': 'Lights',
'toggle': true
},
{
'entity': light.entity_id,
'attribute': 'brightness',
'name': 'Brightness'
}
]
}
]
%}
{% endif %}
{% endfor %}
{{ ns.list }}
Hey there,
I've been trying to sort the following entity list (originally using multiple-entity-row): `type: entities entities:
icon: mdi:delete-empty show_state: false type: custom:multiple-entity-row name: Schwarze Tonne secondary_info: last-changed entities:
icon: mdi:paper-roll show_state: false type: custom:multiple-entity-row name: Papiermüll secondary_info: last-changed entities:
icon: mdi:delete-variant show_state: false type: custom:multiple-entity-row name: Gelber Sack secondary_info: last-changed entities:
icon: mdi:bottle-soda show_state: false type: custom:multiple-entity-row name: Altglas secondary_info: last-changed entities:
icon: mdi:food-apple show_state: false type: custom:multiple-entity-row name: Biomüll secondary_info: last-changed entities:
But I'm not sure if it even is possible? Could someone help me out? I want to sort it by the attribute "remaining", but I just can't get it to work.
Best regards,
Milan