thomasloven / lovelace-auto-entities

🔹Automatically populate the entities-list of lovelace cards
MIT License
1.18k stars 111 forks source link

Help with list of adaptive lighting manual controlled lights #445

Closed broyuken closed 1 month ago

broyuken commented 1 month ago

Hello, running into a bit of a problem trying to list out an attribute with auto entities. I'm using adaptive lighting https://github.com/basnijholt/adaptive-lighting and one of the attributes it lists is manual_control which will tell you if a light is not set to automatically adjust based on time of day. I'm trying to populate a list of entities that have the attribute set but I can't seem to figure out how to get it to display.

If I go into the templates section of developer tools and run the following: {{ state_attr('switch.adaptive_lighting_office_lamp', 'manual_control') }}

It returns

[
  "light.office_floor_lamp_light"
]

If I go right into the states page of the developer tools and look at that entity it is listed like this manual_control: light.office_floor_lamp_light

I've tried a ton of combinations, and the only one that I was able to get to return anything was the following:

type: custom:auto-entities
filter:
  include:
    - attributes:
        manual_control: $$*light*
  exclude: []
card:
  type: entities

which will do what I want, but I'd like to be able to filter it a little bit better. If my filter is manual_control: $$light* or manual_control: $$[*light* nothing shows up, so I can't tell what it's actually looking for. Does it want the brackets, or no? If so how would I handle an attribute that returns an array like that? In the end I just want it to display a result if the manual_control attribute is not empty.

broyuken commented 1 month ago

Figured out a way to do it with a template entity instead with the help of some template guru's.