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

State-switch stops working since HA 2021.12 #72

Closed
Spirituss opened this issue Jan 13, 2022 · 8 comments
Closed

State-switch stops working since HA 2021.12 #72

Spirituss opened this issue Jan 13, 2022 · 8 comments

Comments

@Spirituss
Copy link

Spirituss commented Jan 13, 2022

Lovelace doesn't show anything in lovelace. Here is the example of custom:state-switch, which is defined inside custom:layout-card, sensor sensor.priority has value 0.

views: 
- title: Title
  id: counters
  panel: true 
  visible:
    - user: xxxx
    - user: yyyy  
  cards:
    - type: custom:layout-card
      layout_type: vertical
      layout:
        width: 300
        max_cols: 2
      cards:        
        - type: custom:state-switch
          entity: sensor.priority
          states:
            0:
              type: custom:stack-in-card
              mode: vertical
              cards:
                - type: entities
                  entities: 
                    - entity: sensor.sensor 
                    ....
@ASNNetworks
Copy link

Duplicate ticket, already reported: #63

@Spirituss
Copy link
Author

It is not. I don’t see “blank spaces”, there is no any stuff on the screen.

@itsadamslife
Copy link

I have the same issue inside custom:grid-layout. I can get it to work by manually typing in the #state in the URL, but only if I first use the state that is not assigned as default.

type: custom:grid-layout
path: home
layout:
  #default
  grid-gap: var(--custom-layout-card-padding)
  grid-template-columns: repeat(4, 1fr) 0
  grid-template-rows: 0 repeat(2, fit-content(100%)) 0
  grid-template-areas: |
    "sidebar  .         .         .         ."
    "sidebar  entities  entities  entities  ."
    "sidebar_buttons  footer    footer    footer    ."
    ".        .         .         .         ."
  mediaquery:
    #phone
    "(max-width: 800px)":
      grid-gap: calc(var(--custom-layout-card-padding) * 1.7)
      grid-template-columns: 0 repeat(2, 1fr) 0
      grid-template-rows: 0 repeat(4, fit-content(100%)) 0
      grid-template-areas: |
        ".  .            .               ."
        ".  sidebar      sidebar         ."
        ".  entities     entities        ."
        ".  footer       footer          ."
        ".  sidebar_buttons sidebar_buttons ."
        ".  .            .               ."
    #portrait
    "(max-width: 1200px)":
      grid-gap: calc(var(--custom-layout-card-padding) * 2.4)
      grid-template-columns: repeat(3, 1fr) 0
      grid-template-rows: 0 repeat(2, fit-content(100%)) 0
      grid-template-areas: |
        "sidebar  .            .              ."
        "sidebar  entities     entities       ."
        "sidebar_buttons  footer       footer         ."
        ".        .            .              ."

cards:
  - !include sidebar.yaml

  - type: custom:state-switch
    entity: hash
    default: rooms
    view_layout:
      grid-area: entities
    states:
      rooms:
          type: vertical-stack
          cards:
            - a bunch of stuff
      devices:
          type: vertical-stack
          cards:
            - more stuff
       media:
           type: vertical-stack
           cards:
             - more stuff

  - !include footer.yaml

When selecting the dashboard in lovelace, nothing loads in the state-switch area. When adding #rooms to the URL, again nothing loads. When adding #devices to the URL, the devices will load. From there, I can then select the button created for #rooms and #media and those entities will load. I have also tested this by changing the default: state, which confirmed that the default will not load, even when initially manually putting the # in the URL.

@Spirituss
Copy link
Author

Seems to be the general issue. I use state-switch on many places in lovelace and all of them don't show anything.

@Spirituss Spirituss changed the title Nothing in lovelace if state-switch is inside layout-card State-switch stops working since HA 2021.12 Feb 9, 2022
@Spirituss
Copy link
Author

@thomasloven Could you advice any fix of the issue, since states: <value>: condition doesn't works anymore.

@Spirituss
Copy link
Author

Similar issue is here #63 (comment)

@Spirituss
Copy link
Author

Any news here?

@Spirituss
Copy link
Author

@thomasloven It works again after the last update. Thanks!

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

3 participants