Open kylepyke opened 1 year ago
No code posted = no advices(( Also, check this https://github.com/thomasloven/lovelace-auto-entities/issues/345
Sorry!
Here is my code:
type: entities
entities:
- type: custom:auto-entities
show_empty: false
card:
type: entities
filter:
include:
- domain: light
exclude:
- hidden_by: user
- state: 'off'
- entity_id: light.*_lights
sort:
method: last_changed
This works, but changing the last line to method: area
produces an empty card.
Confirm a problem here.
Here the 2nd card (sort by area) is not displayed:
Here the 2nd card is displayed and keeps being displayed after F5 (page refresh) - but sort is wrong:
Thank you for confirming I am not crazy! @thomasloven, are you aware of this bug?
Managed to achieve it by using a template
option:
- type: custom:auto-entities
show_empty: false
card:
type: entities
filter:
template: >-
{% set ns = namespace(entity_and_area=[]) -%}
{%- for entity in states.light -%}
{%- set entity_id = entity.entity_id -%}
{%- set area = area_name(entity.entity_id) -%}
{%- set entity_and_area = ({'entity_id':entity_id,'area':area}) -%}
{%- set ns.entity_and_area = ns.entity_and_area + [entity_and_area] -%}
{%- endfor -%}
{%- set sorted_list = (ns.entity_and_area) | sort(attribute='area') -%}
{{ sorted_list | map(attribute='entity_id') | list }}
The code may be not optimal, asked here about possible improvements.
I can confirm this problem as well. Also, would it be possible to have an option to have a header printed for each area that entities are grouped under?
I can confirm. Sorting is not working. In my case, it looks like area of the device is used while it's redefined in the entity itself.
I can confirm this problem as well. Also, would it be possible to have an option to have a header printed for each area that entities are grouped under?
This would be amazing but I think it warrants a separate feature request. At that point, it becomes sort of a "group by" request where each group can have its own heading. Of course, it could be accomplished by other means so the owner of this AMAZING card might not be willing to implement it.
A collapsible group-by would be truly amazing :P.
any news on this? I also can't sort by area, still gives me an empty list when entering
sort:
method: area
It is also not available in the dropdown-list via the visual editor:
Hello I just found this and I am having the same issue. I'm hoping there will be a fix soon.
Area is missing from the sort drop down in the UI editor, manually coding area sort will not show the card.
Same problem here unfortunately.
I've successfully created a list of entites, and all sort methods work except for
area
, which returns an empty list. Reverting the sort toname
or any other method works correctly. Can anyone advise?