thomasloven / lovelace-state-switch

🔹Dynamically replace lovelace cards depending on occasion
MIT License
382 stars 27 forks source link

Not working with 'custom:auto-entities' card #51

Closed bcutter closed 2 years ago

bcutter commented 3 years ago

Applying custom:state-switch to a custom:auto-entities card results in the card not showing up.

Example:

While

type: 'custom:auto-entities'
card:
  type: entities
  title: Übersicht Switch-Controls
  state_color: true
  show_header_toggle: false
entities: null
filter:
  include:
    - entity_id: automation.switch_control*
      options:
        secondary_info: last-triggered
  exclude: []
show_empty: true
unique: true
sort:
  method: last_triggered
  reverse: true

gives grafik

, once the state-switch is applied (and the requirement is met, of course)...

type: 'custom:state-switch'
entity: input_boolean.gui_global_details
default: ''
transition: none
states:
  'on':
    type: 'custom:auto-entities'
    card:
      type: entities
      title: Übersicht Switch-Controls
      state_color: true
      show_header_toggle: false
    entities: null
    filter:
      include:
        - entity_id: automation.switch_control*
          options:
            secondary_info: last-triggered
      exclude: []
    show_empty: true
    unique: true
    sort:
      method: last_triggered
      reverse: true

...that gives: grafik

(nothing).

What a pity, both great cards come from the same developer... finger´s crossed :-)

thomasloven commented 2 years ago

Please try release 1.9.0

bcutter commented 2 years ago

Please try release 1.9.0

I tested 1.9.0 and the result is: it still is not working at all.

For testing I compared

type: custom:auto-entities
card:
  type: entities
  title: null
  state_color: true
  show_header_toggle: false
entities: null
filter:
  include:
    - entity_id: automation.switch_control*
      options:
        secondary_info: last-triggered
  exclude:
    - name: zzzOLD*
show_empty: true
unique: true
sort:
  method: last_triggered
  reverse: true

with

type: custom:state-switch
entity: input_boolean.gui_global_details
default: ''
transition: none
states:
  'on':
    type: custom:auto-entities
    card:
      type: entities
      title: null
      state_color: true
      show_header_toggle: false
    entities: null
    filter:
      include:
        - entity_id: automation.switch_control*
          options:
            secondary_info: last-triggered
      exclude:
        - name: zzzOLD*
    show_empty: true
    unique: true
    sort:
      method: last_triggered
      reverse: true

Card does still not show up with v1.9.0.

thomasloven commented 2 years ago

Please try 1.9.1. That should fix this.

bcutter commented 2 years ago

Yes I can confirm 1.9.1 fixed this issue, it is finally working 👍