ofekashery/vertical-stack-in-card

Alignment and formatting problems.

Jaguaza opened this issue · 2 comments

Good morning and thank you for your work.

I have this cards:
image

With the following code:

type: vertical-stack
cards:
  - type: custom:mushroom-title-card
    title: HABITACIONES
  - type: custom:vertical-stack-in-card
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:mushroom-template-card
            primary: Casa
            secondary: '{{ states(''sensor.temperatura_casa'') }}º'
            icon: mdi:home-assistant
            badge_icon: >-
              {% set stateLights = states('sensor.contador_luces') %}

              {% set stateSockets = states('sensor.contador_enchufes') %}

              {% if is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                mdi:power
              {% elif is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float < 1 %}
                mdi:lightbulb
              {% elif is_number(stateLights) and stateLights | float < 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                mdi:power-plug
              {% endif %}
            tap_action:
              action: navigate
              navigation_path: 0
            multiline_secondary: true
            icon_color: >-
              {% set stateLights = states('sensor.contador_luces') %}

              {% set stateSockets = states('sensor.contador_enchufes') %}

              {% if is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                blue
              {% elif is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float < 1 %}
                blue
              {% elif is_number(stateLights) and stateLights | float < 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                blue
              {% endif %}
            badge_color: blue
            fill_container: true
            layout: horizontal
          - type: horizontal-stack
            cards:
              - type: custom:mushroom-chips-card
                chips:
                  - type: entity
                    entity: sensor.contador_luces
                    icon_color: orange
                    icon: mdi:lightbulb
                    tap_action:
                      action: call-service
                      service: script.turn_on
                      data: {}
                      target:
                        entity_id: script.apagar_luces_casa
                alignment: center
              - type: custom:mushroom-chips-card
                chips:
                  - type: entity
                    entity: sensor.contador_enchufes
                    icon_color: blue
                    icon: hue:socket-eu
                    tap_action:
                      action: call-service
                      service: script.turn_on
                      data: {}
                      target:
                        entity_id: script.apagar_enchufes_casa
                alignment: center
  - type: custom:vertical-stack-in-card
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:mushroom-template-card
            primary: Recibidor
            secondary: '{{ states(''sensor.temperatura_cocina'') }}º'
            icon: mdi:exit-run
            badge_icon: >-
              {% set stateLights = states('sensor.contador_luces_recibidor') %}

              {% set stateSockets = states('sensor.contador_enchufes_recibidor')
              %}

              {% if is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                mdi:power
              {% elif is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float < 1 %}
                mdi:lightbulb
              {% elif is_number(stateLights) and stateLights | float < 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                mdi:power-plug
              {% endif %}
            tap_action:
              action: navigate
              navigation_path: recibidor
            multiline_secondary: true
            icon_color: >-
              {% set stateLights = states('sensor.contador_luces_recibidor') %}

              {% set stateSockets = states('sensor.contador_enchufes_recibidor')
              %}

              {% if is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                blue
              {% elif is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float < 1 %}
                blue
              {% elif is_number(stateLights) and stateLights | float < 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                blue
              {% endif %}
            badge_color: blue
            fill_container: true
            layout: horizontal
          - type: horizontal-stack
            cards:
              - type: custom:mushroom-chips-card
                chips:
                  - type: entity
                    entity: sensor.contador_luces_recibidor
                    icon_color: orange
                    icon: mdi:lightbulb
                    tap_action:
                      action: call-service
                      service: script.turn_on
                      data: {}
                      target:
                        entity_id: script.apagar_luces_recibidor
                    hold_action:
                      action: call-service
                      service: switch.turn_on
                      data: {}
                      target:
                        entity_id: switch.techo_recibidor
                alignment: center
              - type: custom:mushroom-chips-card
                chips:
                  - type: entity
                    entity: sensor.contador_enchufes_recibidor
                    icon_color: blue
                    icon: hue:socket-eu
                    hold_action:
                      action: call-service
                      service: switch.turn_on
                      data: {}
                      target:
                        entity_id: switch.mirilla
                alignment: center
  - type: custom:vertical-stack-in-card
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:mushroom-template-card
            primary: Cocina
            secondary: '{{ states(''sensor.temperatura_cocina'') }}º'
            icon: mdi:fridge-outline
            badge_icon: >-
              {% set stateLights = states('sensor.contador_luces_cocina') %}

              {% set stateSockets = states('sensor.contador_enchufes_cocina') %}

              {% if is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                mdi:power
              {% elif is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float < 1 %}
                mdi:lightbulb
              {% elif is_number(stateLights) and stateLights | float < 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                mdi:power-plug
              {% endif %}
            tap_action:
              action: navigate
              navigation_path: cocina
            multiline_secondary: true
            icon_color: >-
              {% set stateLights = states('sensor.contador_luces_cocina') %}

              {% set stateSockets = states('sensor.contador_enchufes_cocina') %}

              {% if is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                blue
              {% elif is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float < 1 %}
                blue
              {% elif is_number(stateLights) and stateLights | float < 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                blue
              {% endif %}
            badge_color: blue
            fill_container: true
            layout: horizontal
          - type: horizontal-stack
            cards:
              - type: custom:mushroom-chips-card
                chips:
                  - type: entity
                    entity: sensor.contador_luces_cocina
                    icon_color: orange
                    icon: mdi:lightbulb
                    tap_action:
                      action: call-service
                      service: script.turn_on
                      data: {}
                      target:
                        entity_id: script.apagar_luces_cocina
                    hold_action:
                      action: call-service
                      service: switch.turn_on
                      data: {}
                      target:
                        entity_id: switch.techo_cocina
                alignment: center
              - type: custom:mushroom-chips-card
                chips:
                  - type: entity
                    entity: sensor.contador_enchufes_cocina
                    icon_color: blue
                    icon: hue:socket-eu
                    tap_action:
                      action: call-service
                      service: script.turn_on
                      data: {}
                      target:
                        entity_id: script.apagar_enchufes_cocina
                    hold_action:
                      action: call-service
                      service: switch.turn_on
                      data: {}
                      target:
                        entity_id: switch.electrodomesticos_cocina
                alignment: center
  - type: custom:vertical-stack-in-card
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:mushroom-template-card
            primary: Patio
            secondary: '{{ states(''sensor.temperatura_patio'') }}º'
            icon: mdi:flower-tulip-outline
            badge_icon: >-
              {% set stateLights = states('sensor.contador_luces_patio') %}

              {% set stateSockets = states('sensor.contador_enchufes_patio') %}

              {% if is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                mdi:power
              {% elif is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float < 1 %}
                mdi:lightbulb
              {% elif is_number(stateLights) and stateLights | float < 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                mdi:power-plug
              {% endif %}
            tap_action:
              action: navigate
              navigation_path: patio
            multiline_secondary: true
            icon_color: >-
              {% set stateLights = states('sensor.contador_luces_patio') %}

              {% set stateSockets = states('sensor.contador_enchufes_patio') %}

              {% if is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                blue
              {% elif is_number(stateLights) and stateLights | float >= 1 and
              is_number(stateSockets) and stateSockets | float < 1 %}
                blue
              {% elif is_number(stateLights) and stateLights | float < 1 and
              is_number(stateSockets) and stateSockets | float >= 1 %}
                blue
              {% endif %}
            badge_color: blue
            fill_container: true
            layout: horizontal
          - type: horizontal-stack
            cards:
              - type: custom:mushroom-chips-card
                chips:
                  - type: entity
                    entity: sensor.contador_luces_patio
                    icon_color: orange
                    icon: mdi:lightbulb
                    tap_action:
                      action: call-service
                      service: script.turn_on
                      data: {}
                      target:
                        entity_id: script.apagar_luces_patio
                    hold_action:
                      action: call-service
                      service: switch.turn_on
                      data: {}
                      target:
                        entity_id: switch.luz_patio
                alignment: center
              - type: custom:mushroom-chips-card
                chips:
                  - type: entity
                    entity: sensor.contador_enchufes_patio
                    icon_color: blue
                    icon: hue:socket-eu
                    tap_action:
                      action: call-service
                      service: script.turn_on
                      data: {}
                      target:
                        entity_id: script.apagar_enchufes_patio
                    hold_action:
                      action: call-service
                      service: switch.turn_on
                      data: {}
                      target:
                        entity_id: switch.enchufe_patio
                alignment: center

How can I make the cards chips on the right be seen centered and not at the top.

I also have a problem and it is that many times when I enter it looks bad. As seen here:
image

To solve it I have to delete the browser cache or give it to edit and save it again.

Do you know any solution please.

Help me please.

😔