lovelace-state-switch icon indicating copy to clipboard operation
lovelace-state-switch copied to clipboard

Multiple state switch cards overlay each other

Open sgofferj opened this issue 3 years ago • 19 comments

I have a whole bunch of state switch cards to make different cards appear and disappear based on the "system mode". The first one is an input select. I noticed that the selection for the input select is covered by the second state switch card.

    cards:
      - type: custom:state-switch
        entity: input_select.mode
        states:
          Morning:
            type: entities
            entities:
              - input_select.mode
          Day:
            type: entities
            entities:
              - input_select.mode
          Daylight:
            type: entities
            entities:
              - input_select.mode
          Evening:
            type: entities
            entities:
              - input_select.mode
          Go to bed:
            type: entities
            entities:
              - input_select.mode
          Night:
            type: entities
            entities:
              - input_select.mode
      - type: custom:state-switch
        entity: input_select.mode
        states:
          Morning:
            type: custom:sun-card
          Day:
            type: custom:sun-card
          Daylight:
            type: custom:sun-card
      - type: custom:state-switch
        entity: input_select.mode
        states:
          Morning:
            type: media-control
            entity: media_player.living_room
      - type: custom:state-switch
        entity: input_select.mode
        states:
          Evening:
            type: media-control
            entity: media_player.living_room_tv
          TV:
            type: media-control
            entity: media_player.living_room_tv
[...]

Screenshot_20210607_182341

sgofferj avatar Jun 07 '21 15:06 sgofferj

Please try release 1.9.0

thomasloven avatar Oct 25 '21 22:10 thomasloven

Updated now. I'll set it up again and report back (I deleted the setup because of the issue)

sgofferj avatar Oct 28 '21 07:10 sgofferj

Sorry, problem persists.

sgofferj avatar Oct 28 '21 08:10 sgofferj

Please try release 1.9.3

thomasloven avatar Mar 01 '22 10:03 thomasloven

Will do. May take a few days.

sgofferj avatar Mar 01 '22 19:03 sgofferj

Please try release 1.9.3

I am facing the same overlay issue. This issue is still there in release 1.9.3, I am on HA core-2022.3

Screenshot 2022-03-03 023651

satyambaba avatar Mar 02 '22 21:03 satyambaba

That does not at all look like two cards overlapping each other. Also please provide information about your configuration and browser.

thomasloven avatar Mar 02 '22 21:03 thomasloven

That does not at all look like two cards overlapping each other. Also please provide information about your configuration and browser.

@thomasloven, It didn't look like an overlay as there was no card below that. Please refer to the below screenshot. I am using Chrome browser (Version 98.0.4758.102 (Official Build) (64-bit)).

Screenshot_20220303-033237

The yaml for that card is -

type: custom:state-switch
entity: media_player.bedroom_display
states:
  playing:
    type: custom:mini-media-player
    volume_stateless: false
    artwork: full-cover
    entity: media_player.bedroom_display
    sound_mode: full
    source: full
    group: true
    info: scroll
  paused:
    type: custom:mini-media-player
    volume_stateless: false
    artwork: material
    entity: media_player.bedroom_display
    sound_mode: full
    source: full
    group: true
    info: scroll

The moment I remove one state value (either "playing" or "paused"), I don't see the overlay.

satyambaba avatar Mar 02 '22 22:03 satyambaba

I have a similar issue, also with the mini-media-player (v1.16 - also tested with v1.15) I thought it may be the group option of the mini-media player but I have tested that also and it is not. Chrome Version 98.0.4758.102 (Official Build) (64-bit)

This is v1.9.0, cards are displaying correctly. image

This is v1.9.1+ (incl 1.9.3). It looks like it's displaying both states but overlapping the cards? image

With the group option set to false. image

type: custom:state-switch
entity: template
template: >
  {{ 'on' if states('sensor.all_speakers')|lower
      not in ['idle','off','unknown','unavailable','none'] else 'off' }}
states:
  'off':
    type: custom:mini-media-player
    entity: media_player.all_speakers
    name: 'All Speakers'
    icon: mdi:speaker-multiple
    group: true
    toggle_power: false
    hide: !include /config/lovelace/media_player/include/mini_media_player_off.yaml
  'on':
    type: custom:mini-media-player
    entity: media_player.all_speakers
    name: 'All Speakers'
    icon: mdi:speaker-multiple
    group: true
    toggle_power: false
    hide: !include /config/lovelace/media_player/include/mini_media_player_on.yaml
    artwork: full-cover
    source: full
    info: scroll

I get a lot of this in the browser console. Possibly related?

Uncaught (in promise) DOMException: Failed to execute 'querySelector' on 'DocumentFragment': '#3m820am24-menu' is not a valid selector.
    at ec.firstUpdated (http://homeassistant.local:8123/hacsfiles/mini-media-player/mini-media-player-bundle.js:1:153520)
    at ec.performUpdate (http://homeassistant.local:8123/hacsfiles/mini-media-player/mini-media-player-bundle.js:1:131322)
    at http://homeassistant.local:8123/hacsfiles/mini-media-player/mini-media-player-bundle.js:1:130872
    at Generator.next (<anonymous>)
    at cb (http://homeassistant.local:8123/hacsfiles/mini-media-player/mini-media-player-bundle.js:1:48215)
    at f (http://homeassistant.local:8123/hacsfiles/mini-media-player/mini-media-player-bundle.js:1:48399)

jazzyisj avatar Mar 04 '22 02:03 jazzyisj

Just highlighting, this issue still persists after HA v2022.4.1, so I guess this is not OS related. I use state switch heavily, so is there any workaround at this moment while we wait for the resolution. Have also raised this issue on mini media player github. https://github.com/kalkih/mini-media-player/issues/641

satyambaba avatar Apr 09 '22 16:04 satyambaba

I have a similar issue. The drop-down menu is constantly shown for one of my entities even when it's not selected and this overlaps other entities. Same issue with multiple browsers and HA app.

Home Assistant Core 2022.5.5 Home Assistant Supervisor 2022.05.3 Home Assistant OS 8.1 Kernel version 5.15.41 Agent version 1.2.1

mini media player release V1.16.4

hh801ip32it81

The list that is overlapping is from the top entity 'media_player.denon_avr_x4300h'

entities:
  - artwork: cover
    entity: media_player.denon_avr_x4300h
    group: true
    hide:
      controls: true
      power_state: false
    icon: mdi:monitor-speaker
    source: icon
    type: custom:mini-media-player
  - entity: media_player.avr_zone_2
    group: true
    hide:
      controls: true
      power_state: false
    icon: mdi:monitor-speaker
    source: icon
    type: custom:mini-media-player
  - entity: media_player.heos_amp
    group: true
    hide:
      controls: true
      power_state: false
    type: custom:mini-media-player
  - entity: media_player.epson
  - entity: media_player.entertainment_room
  - entity: media_player.dinning_room_tv
  - entity: media_player.main_bed_room_tv
    group: true
    hide:
      controls: true
      power_state: true
type: entities
title: Video Players

Jaykurb avatar May 25 '22 14:05 Jaykurb

The linux kernel version of the system running your backend is actually not at all as useful as for example information about the configuration for that card and what the custom entity rows you're using are.

thomasloven avatar May 25 '22 18:05 thomasloven

Apologies, I have updated the post above.

Jaykurb avatar May 26 '22 12:05 Jaykurb

Should be fixed in 1.9.4

thomasloven avatar May 29 '22 20:05 thomasloven

In my setup a similar issue seems to be solved, but update 1.9.4 broke box-shadows((( https://github.com/thomasloven/lovelace-state-switch/issues/67

ildar170975 avatar May 30 '22 00:05 ildar170975

I accidentally included one line too much from my experiments. Try 1.9.5.

thomasloven avatar May 30 '22 08:05 thomasloven

Thank you, Thomas, box-shadows seem to be fixed.

ildar170975 avatar May 30 '22 09:05 ildar170975

Sorry for the dumb question but where do I update to 1.9.5?

Jaykurb avatar Jun 02 '22 11:06 Jaykurb

HACS or https://github.com/thomasloven/lovelace-state-switch/releases

thomasloven avatar Jun 02 '22 21:06 thomasloven