"visibility" code gets deleted by HA

2025-01-20 09-40-37

I set the visibility via the card options and save it. Works as expected. Now I go back to edit the card and the “visibility” code is gone, it just gets deleted by HA. I am assuming this happens on edit, as the function works as long as I don’t edit the card.

Activating a visibility option again works fine and the code is added to my yaml. On the next edit, it is gone again.

Very strange.

This is a long code, 600 lines.
And it includes card-mod.
Can you test with card-mod with a SHORTER easy reproducible code and then post this code here.
There is a known issue that card-mod code is deleted - but nothing about a visibility code.

type: custom:vertical-stack-in-card
cards:
  - type: heading
    heading_style: title
    heading: Pop-Up mit Warnungen
    icon: mdi:information-outline
    badges: []
  - type: custom:gap-card
    height: 6
  - type: custom:mushroom-chips-card
    chips:
      - type: template
        icon: mdi:window-open-variant
        icon_color: grey
        tap_action:
          action: navigate
          navigation_path: "#Window_OPEN"
      - type: template
        icon: mdi:door-open
        icon_color: grey
        tap_action:
          action: navigate
          navigation_path: "#Doors_OPEN"
      - type: template
        icon: mdi:puzzle-outline
        icon_color: grey
        tap_action:
          action: navigate
          navigation_path: "#Add_Ons_DOWN"
      - type: template
        icon: mdi:alarm-light
        icon_color: grey
        tap_action:
          action: navigate
          navigation_path: "#Alarms_CHECK"
    alignment: center
visibility:
  - condition: state
    entity: input_number.tab_zaehler
    state: "5.0"

Close it and reopen it and the “visibility” code is gone. At least for me. Simple cards do not have this problem. There was CARD_MOD code, I removed it.

It appears to be a bug with custom:vertical-stack-in-card

1 Like

Try using a stack-in-card just in case (has own issues, can be solved by card-mod)

Why didn’t I find that? Thank you, I will try to check on this later.

Great suggestion…custom:stack-in-card works with visibility, just no visual editor.

Last release in November 2020. Seems like a dead horse to me. But thanks for the tip.

Works more or less with a bit of card-mod.