Custom card: Room Card

Have you tried show_state? If that doesn’t help share your yaml. If it would be the card, more people should have it

It’s weird… I copied another example, started from scratch and rebuild my config. Now it works. Maybe some hidden spaces/newlines which are not detected by the parser?

Did you ever manage to make the icons bigger? This is the only thing stopping me from rolling room cards out :confused:

Nope, sorry… :confused:

Try this:

type: custom:room-card
entity: light.woonkamer_lampen
show_icon: true
title: Woonkamer
styles: 
  '--mdc-icon-size': 50px;

I love the look of this card, however my header style is not working. Can someone please tell me what I am doing wrong…

On the phone the “Master Bedroom” overlaps the icons
image

type: custom:room-card
title: Master Bedroom
style: |
  .card-header {font-size: 20%}
entity: light.bedroom_main_lights
icon: mdi:bed
show_icon: true
tap_action:
  action: toggle

Ideally I would like to show like this with temperature separated by a “|” from the humidity. With the contact door and motion sensor justified to the right
image

Thanks

Try

styles:
  font-size: 20%

But it’s better to use px imo

Thanks for the quick reply @marcokreeft87

However :frowning: doesn’t work I tried different values it seems to adjust the height of the card

type: custom:room-card
title: Master Bedroom
styles:
  font-size: 5px
entity: light.bedroom_main_lights

Hmm was just a guess. Let me get back to you after work with a working answer :slight_smile:

How about this:


card_styles: 
  '--ha-card-header-font-size': 54px;
2 Likes

Can someone explain how I make the width between cards smaller? This distance here, between two cards. It’s driving me nuts. The CSS doesn’t seem to show anything useful that I can change. I’m using a horizontal masonry layout to hold room card cards with a soft UI theme.

That must be the theme that you are using. Can you share your yaml?

1 Like

Yes, you’re right. It was in the soft-ui yaml, but it needed to be reloaded before it took effect. Thanks!

1 Like

That did the trick – this card is awesome. Thanks for your hard work!
Once I complete my room cards I will share the YAML

1 Like

Hi, is it possible to use a state in the style definition? For example, change this:

    icon:
      template:
        styles: |
          if (entity.state == 'on') return 'color: rgb(var(--lounge-color))';

with this:

    icon:
      template:
        styles: |
          if (entity.state == 'on') return "color: {{states('input_text.color_lounge')}}";

I can’t get it to work and I’ve searched everywhere for a working example.

Thanks

Try states.input_text.color_lounge.state or maybe without the .state on the end

Thanks for your response Marco. Unfortunately neither of those suggestions worked. I’m stumped, having tried

{{states('input_text.color_lounge')}}
{{states.input_text.color_lounge.state}}
{{states.input_text.color_lounge}}

They should all return:

image

but the icon color isn’t changing.

Without the {{ and }} ?
The way you define the template is gets parsed to javascript. And javascript doesn’t know about jinja templating

Hi, just to close the loop on this. I asked the question about using entities for colours elsewhere and have been warned against it. It’s not easy to do and HA isn’t designed to use it in the way I want to. I’m sticking with using theme variables, which means that I don’t have the issue with the room card any more.

Thanks for the update Matt!