Stack-In-Card: Drop-in replacement for vertical-stack-in-card

Yes, because this is for yaml mode, it’s not exactly the same for the UI editor :slight_smile:
Without the - it should work in the UI editor.

1 Like

Hello.

First of all, @RomRider thanks for picking up the card for further development.

In my PRD environment (pre-0.107), ‘custom:vertical-stack-in-card’ used to do this:

with this config:

cards:
  - entities:
      - entity: binary_sensor.door_window_sensor_158dxxxxxxxxxxd
        name: Porta Quarto
      - entity: sensor.temperature_158dxxxxxxxxxx0
        name: Temperatura
        secondary_info: last-changed
      - entity: sensor.humidity_158dxxxxxxxxxx0
        name: Humidade
        secondary_info: last-changed
      - entity: light.diogo
        secondary_info: last-changed
    state_color: true
    type: entities
  - card:
      entities:
        - entity: switch.tomada_diogo
          name: Tomada Aquecedor
          secondary_info: last-changed
      state_color: true
      type: entities
    conditions:
      - entity: input_select.season_mode
        state: Winter
    type: conditional
show_header_toggle: false
state_color: true
title: Quarto Diogo
mode: vertical
type: 'custom:stack-in-card'

Now in my TST environment (0.107.5), both ‘custom:vertical-stack-in-card’ (with preloaded) and ‘custom:stack-in-card’ do this, for the same exact config:

I don’t understand why this header toggle is added and why I can’t disable it. I tried putting the show_header_toggle: false everywhere and it doesn’t seem to do anything.

Is this something that can be fixed?

Thanks in advance.

  - card:
      entities:
        - entity: switch.tomada_diogo
          name: Tomada Aquecedor
          secondary_info: last-changed
      state_color: true
      type: entities
    conditions:
      - entity: input_select.season_mode
        state: Winter
    type: conditional

Probably needs to be

  - card:
      entities:
        - entity: switch.tomada_diogo
          name: Tomada Aquecedor
          secondary_info: last-changed
      state_color: true
      type: entities
      show_header_toggle: false
    conditions:
      - entity: input_select.season_mode
        state: Winter
    type: conditional
1 Like

@RomRider thanks for another great card!
Can anyone advise me how to achieve the following:
I want to create a card using stack-in-card with an automation inside and (it the automation is on) an input_number under it.

I can only do that by adding two cards - entities and conditional. Here’s my config:

type: custom:stack-in-card
cards:
  - type: entities
    entities:
      - entity: automation.ventilation_1st_floor_bathroom_extractor_fan_turn_on_by_humdity_gradient
        name: by humidity gradient

  - type: conditional
    conditions:
      - entity: automation.ventilation_1st_floor_bathroom_extractor_fan_turn_on_by_humdity_threshold
        state: 'on'
    card:
      type: entities
      entities:
        - input_number.ventilation_1st_floor_bathroom_shower_humidity_threshold

And it looks huge:
Screen Shot 2020-03-22 at 20.30.15 (2)

Is there a better way of achieving my goal and how can I make my card more compact?

You can use lovelace-card-mod to reduce the padding. There’s no other way.

Yes, I already tried that. Just wanted to know if there s no other options.

I’m sorry, but I was pretty sure I had tried it already, but it seems I didn’t, as it worked perfectly. Thanks a lot.

I have a view where I only have 3 stack-in cards.

In my PRD environment (pre-0.107), ‘custom:vertical-stack-in-card’ used to do this:

Now in my TST environment (0.107.5), ‘custom:vertical-stack-in-card’ or ‘custom:stack-in-card’ do this, for the same exact config:

It seems to be vertically stacking the 3 different ‘custom:vertical-stack-in-card’/‘custom:stack-in-card’ cards. This doesn’t seem to happen in views with other entity cards, only in these (I have 2 in the same situation).

Is it something I’m missing (again), or is this something can someone else can also confirm to happen?

Thanks again.

I can see a reason why this would happen, I’ll check tomorrow.
If you want to have a fixed and deterministic layout, I’d suggest you to try the layout-card

Thanks a lot.

Not really, I just don’t want horizontal space wasted when looking at a view in a non-mobile device.

I have the exact same issue where everything is now it a single column where it used to be in three.

1 Like

So for now there is no solution as all the cards are created asynchronously and I can’t compute the height of the card. Unfortunately HA core doesn’t provide a solution for that (yet ?). This is related to the latest 0.107 update and the way custom cards are handled. I’ll open an issue on the frontend of HA to see if it can be corrected in the future.
Edit: https://github.com/home-assistant/frontend/issues/5321

I’d still suggest to try the layout card in the meantime to see if it would solve your issues :slight_smile:

OK, thanks for following up on this issue.

Just out of curiosity, any specific reason why this only happens if a view only contains these kind of custom-cards?

I don’t have a proper explanation, I’d have to look deeply into how ha core displays cards and calls the card size function.

No worries, it’s actually not relevant if the actual issue can be fixed on frontend

I have a dumb question here :slight_smile:
What would be the reason to use the stack-in-card or the vertical-stack-in-card now that the second has been updated to work with latest HA?

In my opinion there is none, but I might be wrong.
Also, at this point might be really worth it “merge” the two into the stack-in-card (since the name make more sense now that also the vertical-stack-in-card support vertical and horizontal stacking)

Thanks :slight_smile:

I’ve asked the person developping vertical-stack-in-card to move the repo to custom-cards so that we can merge both together, but it’s unlikely to happen :man_shrugging:
Also I think that vertical-stack-in-card will have some issues for people with semi-transparent backgrounds on cards.

Yep I know you did, I was in that thread :slight_smile:
It was more out of curiosity about functionality but I guess there is no difference between the two :slight_smile:

Let’s wait a bit and see what happens.

Having a card in custom-cards is easier for everyone (it will be found by default by HACS), it can also be easily taken over by someone else if required.

Regarding features, I’m sure people will have some weird requests in the future :slight_smile:

2 Likes

That’s for sure ahahahahahaha