Custom card: Room Card

Thnx @BebeMischa! I appreciate it

1 Like

@C.G.B.Spender
I understand your ocd, suffer myself as well.
Try the active state for the color;

        icon:
          template:
            styles: >
              if (entity.state > 35) return
              'color:var(--paper-item-icon-active-color)';
1 Like

Check out version 1.07.01 this will fix the icon color updating

1 Like

@marcokreeft87 Will do when I get home work, cheers!

@GH2user I recently found the gold color is the yellow that the ha theme uses, but your suggestion has the added benefit of working with every theme I believe, Iā€™ll be implementing that, thanks!

1.07.01 works great, the media player icon now changes colors consistently with the player state. Many thanks once again!

1 Like

question about marigin - how to make it smaller ?
I would like to make margin smaller on topā€¦

image

I figured out that for header I can do it something like this - and is`t working :slight_smile:

style: |
  .card-header {font-size: 130%; padding-top: 0px;}

but how to make it the same for entity-info ?

image

thanks in advance !

The entity row has its own CSS domain. Hereā€™s an example of some changes I made to mine:

        .entities-info-row {
          padding: 0px;
          right: -10px;
          top: 0px;
        }

Ive already try this but doesnt work :frowning:

type: custom:room-card
title: Julia
style: |
  .card-header {font-size: 130%; padding-top: 0px;}
  .entities-info-row {
    padding: 50px;
    right: 50px;
    top: 50px;}

image

I`ve also try without header modification:

style: |
  .entities-info-row {
    padding: 50px;
    right: 50px;
    top: 50px;}

image

here is my whole code - maybe I`m doing something wrong ?

type: custom:room-card
title: Julia
style: |
  .card-header {font-size: 130%; padding-top: 0px;}
  .entities-info-row {
    padding: 50px;
    right: 50px;
    top: 50px;}

entity: group.julia
icon: mdi:string-lights
state_color: true
show_icon: null
tap_action:
  action: toggle
entities:
  - entity: light.julia_1
    name: sufit
    show_icon: true
    tap_action:
      action: toggle
  - entity: light.juliawall
    name: nocna
    show_icon: true
    tap_action:
      action: toggle
info_entities:
  - entity: switch.gniazdka_tv_julia
    show_icon: true
    state_color: true
    icon: mdi:google-home
    tap_action:
      action: toggle
    styles:
      width: 20px

You need to use styles, not style. Style is an config attribute for card-mod.
It also expects an object, so like this:

styles: >
  color: green

thanks but as I trying this there is no option to make margin smallerā€¦ I try use with different options etc -no one workingā€¦ can you help to find correct syntax for margin smaller ?
as you can see that works for header ā€¦ so basically should also works if I know what should be in place ā€œ.card-headerā€ and should worksā€¦ of course should be ā€œ.entities-info-rowā€ but doesn`t work :frowning:

type: custom:room-card
title: Oliwia
style: |
  .card-header {
    font-size: 130%; 
    padding-top: 0px;}

I even try to use div for all arrea

div {
margin: -5px;
padding-top: 0px;
}

but that make a mess for other areasā€¦ so I try to modify all I can believe thats the only one optionsā€¦


  .entities-info-row {
    padding: 10px;
    right: 10px;
    top: 50px;
  }
  div {
    margin: -10px 0px 0px 0px;
    padding-top: 0px;
  }
  .entities-row .entity {
    padding-top: 20px;
    margin-left: 0px;
  }
  .entity {
    padding-top: 10px;
    margin-left: 0px;
  }
  .card-header {
    font-size: 150%; 
    padding-top: 20px
  }

but looks like ā€œ.entities-info-rowā€ doesn`t work at all ā€¦

image

Hello,
Iā€™m using Room Card, I really like it!

However, this error often occurs:
Cannot read properties of undefined (reading ā€˜styleā€™)

It occurs both in the browser, and in the Android app and iOS appā€¦

Does it happen to anyone else?

If I keep refreshing the page (F5) or closing and opening the app again, it solvesā€¦ but itā€™s something that gets in the way of using itā€¦


you need to manually delete the browser cache on desktop and reload the page (have to do this each time you install/update lovelace card from hacs)

on android you need to go to apps/home assistant/force close/data/clear cache/restart app
on iphone I have no idea

Yeah weird right. HACS used to do it for you but not since the last big update

Hello and many thanks for this card. Iā€˜ve looked for something like this since days. But iā€˜m not sure, if i found a bug or if i am missing something. Please have a look at this screenshot:

Two aspects:

  1. The toggle switch does not appear, neither for the switch-domain nor does it show for climate devices. I suppose the setting is completely ignored. Or am i doing something wrong?

  2. Attributes would also not be shown.

Could you plz check if these are bugs? Thank you in advance.

Iā€™m running into a weird problem. My room cards are working perfectly on the mobile app, but throwing an error in Chrome, claiming that the custom element ā€œhorizontal-stackā€ doesnā€™t exist. When I created the cards an hour ago they displayed properly, then suddenly decided to quit. Hereā€™s the code for one of the cards:

type: custom:room-card
title: Guest Room
entity: light.guest_bedroom_ceiling_fixture
icon: mdi:ceiling-fan-light
show_icon: true
tap_action:
  action: toggle
cards:
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: toggle
        entity: scene.guest_bedroom_off
        name: 'Off'
        show_state: false
        icon_height: 20px
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: toggle
        entity: scene.guest_bedroom_bright
        name: Bright
        icon_height: 20px

Iā€™ve tried clearing the cache and cookies in Chrome, restarting the browser, no luck. It works fine in the mobile app, but not in Chrome. Not in mobile Chrome using the nabu casa link either.

Any idea whatā€™s going on?

And now I changed one of the horizontal stack cards to a grid, which works fine. But as soon as I saved that change, all the other cards are magically fixed, displaying their horizontal stacks properly again.

This has to be a bug in the Room Card, right?

  1. You are right. But this is not a bug. I just copied too much in the wiki :stuck_out_tongue:
  2. Attributes are not shown by the card, thats correct

Some of the default cards arent supported by room card.
But why are you using a horizontal card in room card? The entities are displayed horizontalā€¦

I wanted some separation between two lists: individual lights displayed within the main room card, and scene buttons below using the horizontal stack. It was an aesthetic preference, and I was hoping to keep all of it within a single card for each room. Hereā€™s what Iā€™m targeting:

image

I got this working with the grid card instead of the horizontal stack. It seems to be a workable alternative so far.

1 Like

You can use rows in room card. That might be what you are looking for