home-assistant / ui-schema

A schema to define a user interface for Home Assistant.
Apache License 2.0
41 stars 6 forks source link

Filtering is not working for all card types #134

Closed moskovskiy82 closed 6 years ago

moskovskiy82 commented 6 years ago

Will reference #125

The demo shows that filtering is possible. It works with a media player card but not with other types. For example below config when state is satisfied:

  - type: entity-filter
    entities:
      - light.zwave_zal_small_level
    state_filter:
      - 'on'
    card:
      type: entities
      entities:
        - media_player.kodi_cinema
        - input_number.zal_onkyo_volume
        - input_select.onkyo_mode

Renders only: image

Same if we change for glance type card:

image

balloob commented 6 years ago

Oh, I guess that is where the hack stops working 🤔

The filter card will override the entities prop. If you are rendering a single entity card, like media player, the entities option is just ignored. With an entities card not so much.

moskovskiy82 commented 6 years ago

Any chances of another behavior being implemented? This will be an extremely useful feature de cluttering the frontend

c727 commented 6 years ago

It was a failure to abuse entity filter for this.

This is maybe an option, not sure if we want it in core

- type: conditional-card
  conditions:
    - entity: light.test
      state: "on"
    - entity: switch.test
      state_not: "off"
  card:
    type: glance
balloob commented 6 years ago

Yes, my bad @c727 😞 Will open a PR to remove the example.

I think a conditional card is 👍 However, we'll still run into #127