Skip to content

Idea: Add support for auto-entities #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Lansenou opened this issue Jun 26, 2023 · 3 comments
Closed

Idea: Add support for auto-entities #29

Lansenou opened this issue Jun 26, 2023 · 3 comments

Comments

@Lansenou
Copy link

Would it be possible to add support for auto-entities?

Context

Here auto entities could act as a filter, e.g. all lights in a room.

type: custom:auto-entities
filter:
  include:
    - area: bedroom
      domain: light
card_param: entities
card:
  type: entities

Results in
image

Problems

However when using this you'll get the error: Object { code: "invalid_format", message: "expected str for dictionary value @ data['item_id']. Got {'entity': 'light.signify_netherlands_b_v_lwo001_light'}" }.

Using a similiar template to cast the result from entity to string seems to get a bit further, but then crashes.

type: custom:auto-entities
filter:
  template: |
    {% for light in states.light %}
      {% if light.state == "on" %}
        {{ light.entity_id | string}},
      {% endif %}
    {% endfor %}
card_param: entities
card:
  type: custom:hue-like-light-card

Crash log

Uncaught TypeError: t is undefined
    calculateBackAndForeground hue-like-light-card.js:79
    updateStylesInner hue-like-light-card.js:937
    connectedCallback hue-like-light-card.js:945
    connectedCallback scoped-custom-element-registry.js:248
@Gh61
Copy link
Owner

Gh61 commented Jun 29, 2023

Thank you for reporting,
I'll look into it.

Gh61 added a commit that referenced this issue Jul 2, 2023
- allow config `entities:[{entity:'...'}]`
#29
@Gh61
Copy link
Owner

Gh61 commented Jul 2, 2023

Resolved in the current Release.

@Gh61 Gh61 closed this as completed Jul 2, 2023
@Lansenou
Copy link
Author

Lansenou commented Jul 2, 2023

Thanks a lot @Gh61 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants