Custom card: Room Card

Thanks. Confirmed that 1.4.0 fixes things.

May I make a suggestion on version numbering? Ultimately you are obviously free to number how you like, but perhaps take a look at:

It takes about when to bump what part of the version number, and that helps people know when code they are using will break versus when you have introduced a new feature or just fixed a bug. So, for instance, when you changed the code so that show_icon was required, that’s a breaking change. That would indicate a need to bump the version to 2.0.0 (and include extra change log information). It alerts me as a person using the card to the fact that I should look through those notes to see what might break in my setup before I upgrade. When you add a new option (like the ability to hide the title) that doesn’t break anything, you can increment the second number (so in that case it might have been 1.3.0). Bug fixes and non-breaking changes to existing features are in the third number (so the one you just released to fix the bug I found would have been, perhaps 2.0.1). You can go past nine (I have stuff versioned like 1.13.26), so you don’t have to bump the first or second number just because you got to nine (or 99) in the one after it.

Yes I know. But I am limited to HACS. Check room-card/info.md at d068cdf05ce6fcfda195ab0fe6d3fa55d6d71811 · marcokreeft87/room-card · GitHub.

If I went to 1.3.10 for example I could never make a version 13.1.0 or 1.31.0

1 Like

I forgot! You can use styles for this:


type: custom:room-card
title: Mancave
entity: light.mancave_lampen
icon: mdi:floor-lamp-outline
show_icon: true
tap_action:
styles:
  background-image: url('https://images.pexels.com/photos/235986/pexels-photo-235986.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1')

The tap_action, and double tap are now applied to both icon and title: Action should apply to the Title too · Issue #54 · marcokreeft87/room-card · GitHub

That is a very strange way display change logs, but I guess if you’re gonna use HACS (and you should), you’re stuck with that stupid.

Tell me about it. Maybe there is a better way, but I haven’t found it yet

I was looking at the code again, and I think I see what HACS wants. You basically have to convert the version number into an integer for comparison. I think if you add a leading zero to the minor and maintenance versioning, you could do semantic versioning, albeit a little bit odd on display. So you’d use:

1.01.01

I think that will get you what you need in HACS. The only thing to look at is whether you have to bump the major version once to get to the new schema. 1.5.1 (151) is less than 1.05.02 (10,502), so I think you’d be OK without a major version bump, but I haven’t looked closely at HACS to know for sure. If this works at least that would give you 99 minor versions with 99 patch versions in each. For this kind of development, that will likely be plenty.

1 Like

Thnx, I will try that when Im back from holiday

It would be nice to have an option(s) to set vertical divider(s) and horizonal divider(s)

image

This way items can be “grouped” together. An option to set a card-group(s) so items gets a solid square around it.

An option to left/center/right align the card content would also be appreciated…

1 Like

Unfortunately that’s a won’t do. The card itself already is made for grouping. To put grouping in a card for grouping is overkill

Can we do somehow “group parametrization” for all entities in dashboard?
I mean for all entities we have to add “tap_action…” but maybe can we do it ones for all entities ?
code would be much smaller :slight_smile:

type: custom:room-card
title: Łazienka
style: |
  .card-header {font-size: 130%;}
entity: group.lazienkaup
icon: mdi:string-lights
state_color: true
show_icon: null
tap_action:
  action: toggle
entities:
  - entity: light.lazienka_gorna_1
    name: 1
    tap_action:
      action: toggle
  - entity: light.lazienka_gorna_2
    name: 2
    tap_action:
      action: toggle
  - entity: light.lazienka_gorna_3
    name: 3
    tap_action:
      action: toggle
  - entity: light.lazienka_gorna_4
    name: 4
    state_color: true
    tap_action:
      action: toggle
  - entity: light.lustro_lazienka_gorna
    name: lustro
    state_color: true
    tap_action:
      action: toggle
  - entity: light.led_lazienka_gorna
    name: led
    state_color: true
    tap_action:
      action: toggle
info_entities:
  - entity: switch.kaloryfer_lazienka_gorna
    show_icon: true
    icon: mdi:google-home
    state_color: true
    tap_action:
      action: toggle
  - entity: switch.gniazdka_lazienka
    show_icon: true
    icon: mdi:toothbrush-paste
    state_color: true
    tap_action:
      action: toggle

I see your point. Please at least consider a left/center/right align for each row.

2 Likes

Just to mention that the new ‘icon templating’ is working great and reduces the icon conditions.
I have used it on the fan below for three steps and the washer+dryer to indicate it’s running.

title: HVAC
entities:
  - entity: light.bathroom_strip
    show_icon: true
    name: ceiling
    icon: ghi:ceiling-being
  - entity: sensor.fan_itho_state
    show_state: true
    show_icon: true
    name: fan
    icon:
      template:
        styles: >
          if (entity.state > 150) return 'color: red'; if (entity.state > 70)
          return 'color: orange'; else return 'color: green';
        icon: >
          if (entity.state > 150) return 'mdi:fan-speed-3';
          if (entity.state > 70) return 'mdi:fan-speed-2';
          else return 'mdi:fan-speed-1';
  - entity: sensor.nefit_actual_power
    state_color: true
    show_state: true
    show_icon: true
    name: nefit
    icon: mdi:radiator
  - entity: sensor.plug_washmachine_power
    show_state: true
    show_icon: true
    name: washer
    icon:
      template:
        styles: >
          if (entity.state > 0) return 'color: var(--paper-item-icon-active-color)';
        icon: |
          return 'mdi:washing-machine';
    format: precision0
  - entity: sensor.plug_dryer_power
    show_state: true
    show_icon: true
    name: dryer
    icon:
      template:
        styles: >
          if (entity.state > 0) return 'color: var(--paper-item-icon-active-color)';
        icon: |
          return 'mdi:tumble-dryer';
    format: precision1
info_entities:
  - entity: binary_sensor.security_hvac_smoke_smoke
    show_icon: true
    icon:
      state_on: mdi:fire-alert
  - entity: binary_sensor.security_bathroom_door_contact
    show_icon: true
    icon:
      state_on: mdi:door-open
      state_off: mdi:door-closed
  - entity: sensor.climate_hvac_temperature
    format: precision1
  - entity: sensor.climate_hvac_humidity
    format: precision0

2022-09-25 HAroom-03-template

4 Likes

Is there a possibility to change the Value?
I whant to add a Unit to an info_entities Attribute

Check the wiki search for unit

arghhhh … shame on me :frowning:

No problem, not like you are the only one haha

@marcokreeft87 I just saw new update about templating … this is exactly what I wrote couple post above !! Thanks a lot !! that`s a great job !!

1 Like

O yeah you were the one who gave me the request. Forgot about it, I did put it on the todo list tho :stuck_out_tongue: But thnx!

Hi is there any way to make the entities in the rows aligned to center ? Thanks!