Skip to content
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

[Compatibility other HACS] Custom-template-card and auto entities #1056

Open
OpenGrowBox opened this issue Dec 17, 2024 · 5 comments
Open

[Compatibility other HACS] Custom-template-card and auto entities #1056

OpenGrowBox opened this issue Dec 17, 2024 · 5 comments
Assignees
Labels
bug Something isn't working stale

Comments

@OpenGrowBox
Copy link

OpenGrowBox commented Dec 17, 2024

Hello dear Team,
I noticed that the bubble card not work with Templates as far as i noticed.

If I want to build a card with 3 custom components.

  1. custom config-template-card (selects from a select sensor the current Room creates a var)
  2. auto-entitys( with includes area - ${room) for all entity in that room )
  3. bubble-card ( if you use here the Room as String, it works. )

Like this one works with String as Area:

type: custom:config-template-card
variables:
  - ogb_room: states['select.ogb_rooms'].state
entities:
  - select.ogb_rooms
card:
  type: custom:auto-entities
  card:
    type: grid
    columns: 1
    square: false
  card_param: cards
  filter:
    include:
      - area: "FlowerTent"
        domain: light
        options:
          type: custom:bubble-card
          card_type: button
          button_type: button
          show_attribute: false
          show_last_changed: true
          icon: mdi:light-switch
          show_state: true
    exclude: []
  sort:
    method: state
    reverse: true
  show_empty: true

image

type: custom:config-template-card
variables:
  - ogb_room: states['select.ogb_rooms'].state
entities:
  - select.ogb_rooms
card:
  type: custom:auto-entities
  card:
    type: grid
    columns: 1
    square: false
  card_param: cards
  filter:
    include:
      - area: ${ogb_room}
        domain: light
        options:
          type: custom:bubble-card
          card_type: button
          button_type: button
          show_attribute: false
          show_last_changed: true
          icon: mdi:light-switch
          show_state: true
    exclude: []
  sort:
    method: state
    reverse: true
  show_empty: true

image

If you need a room sensor for current all rooms to select, you can use the opengrowbox-ha integration for no need to itself.

Also, if try to get that over templates in auto-enties I also don't get any result.

Looks like it's relating to the template engine

Or is the problem related to my YAML ? Maybe someone have an idea.

Working on Debian 11 HA Supervised

  • OS: MacOS
  • Browser: Brave
  • Bubble Card Version: v2.3.2
  • Home Assistant Service versions
    image

Thank you! 🍻

@OpenGrowBox OpenGrowBox added the bug Something isn't working label Dec 17, 2024
@MrBearPresident
Copy link
Collaborator

Combining 3 custom-components, that is some challenging stuff.
I can't follow completely why do you assume this is a bubble-card problem?

@OpenGrowBox
Copy link
Author

Hello,

If I use normal entity card as example, it works fine.

See here
image

type: custom:tabbed-card
tabs:
  - card:
      type: custom:config-template-card
      variables:
        ogb_room: states['select.ogb_rooms'].state
      entities:
        - select.ogb_rooms
      card:
        type: vertical-stack
        cards:
          - type: custom:auto-entities
            card:
              type: entities
              name: Other Options
              title: |
                Room Optionen
            filter:
              include:
                - area: ${ogb_room}
                  domain: select
              exclude:
                - name: "*Select*"
                - name: "*Own*"
                - name: "*GLS*"
                - name: "*Light*"
    attributes:
      label: Modes
      icon: mdi:auto-mode
layout_options:
  grid_columns: 4
  grid_rows: auto

What I think is that the card can't work with hat array/list of entities if they are from a var.

I just want to get the list / array of entities dynamic with in the bubble card.

Tried many things, what I found is that problem is with $vars. As I work with "Strings" and tell the "area" as String

Bubble card can display me the entities but not from the var.

Hope that helps to understand what I mean.

Thanks

@MrBearPresident
Copy link
Collaborator

MrBearPresident commented Dec 19, 2024

Maybe I'm doing something wrong.
But I'm unable to get variables working directly.

Through some hack-around you are able to open the JavaScript-debugger in the developer-tools.
Even there I was not able to read the variable "BEAR" directly.

The following did work though.
So I still think this is not a bubble-card problem.

type: custom:config-template-card
variables:
  - states['input_text.help_house_testtext']
  - BEAR: light
entities:
  - ${(() => {return vars[0].entity_id; })()}
card:
  type: custom:auto-entities
  card:
    type: grid
    columns: 1
    square: false
    something: ${(() =>{ console.log('log1'); return vars[1].BEAR;})()}
  card_param: cards
  filter:
    include:
      - domain: ${(() =>{ console.log('domainlog'); return vars[1].BEAR;})()}
        options:
          type: custom:bubble-card
          card_type: button
          button_type: state
          show_attribute: false
          show_last_changed: true
          show_state: true
    exclude: []
  sort:
    method: state
    reverse: true
  show_empty: true

image

@OpenGrowBox
Copy link
Author

Thanks :) i will take a look on it :)

@MrBearPresident MrBearPresident changed the title Using Templates form Custom-teomplate-card not working [Compatibility other HACS] Custom-template-card and auto entities Dec 21, 2024
@MrBearPresident MrBearPresident self-assigned this Dec 21, 2024
Copy link

github-actions bot commented Jan 4, 2025

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants