Custom card: Room Card

I removed the main entity styles and tried with and without the styles in the rows entity still no dice.

type: custom:room-card
title: Kitchen
show_icon: true
entity: light.light_kitchen_underglow
rows:
  - entities:
      - entity: light.light_kitchen_underglow
        state_color: true
        name: Underglow
        show_icon: true
        icon:
          conditions:
            - condition: equals
              value: 'on'
              icon: mdi:led-strip-variant
              styles:
                color: red
        tap_action:
          action: toggle

...   
       icon:
          conditions:
            - condition: equals
              value: 'on'
              icon: mdi:led-strip-variant
              color: red
type: custom:room-card
title: Kitchen
show_icon: true
entity: light.lamp_nachtkast_marco
rows:
  - entities:
      - entity: light.lamp_nachtkast_marco
        state_color: true
        name: Underglow
        show_icon: true
        icon:
          conditions:
            - condition: equals
              value: 'on'
              icon: mdi:led-strip-variant
              styles:
                color: red
            - condition: equals
              value: 'off'
              icon: mdi:led-strip-variant
              styles:
                color: green


This is working for me. Does the light.light_kitchen_underglow have a state off/on?

Not sure what’s changed but it’s working now…
Great card, glad I can use it in my mobile dashboard.

Thanks for all your help!

1 Like

Version 1.07.21 seems to have introduced a bug (or at least an undesirable feature) where you can no longer click on the main entity image to get its more-info page. This code in 1.07.20 works fine:

type: custom:room-card
title: Presence
entity: binary_sensor.house_occupied
show_icon: true
entities:
  - entity: binary_sensor.great_room_occupied
    name: Great
    show_icon: true
    state_color: true
  - entity: binary_sensor.kitchen_occupied
    name: Kitchen
    show_icon: true
    state_color: true
  - entity: binary_sensor.dining_room_occupied
    name: Dining
    show_icon: true
    state_color: true
  - entity: binary_sensor.study_occupied
    name: Study
    show_icon: true
    state_color: true
  - entity: binary_sensor.main_bedroom_occupied
    name: Bedroom
    show_icon: true
    state_color: true
info_entities:
  - entity: binary_sensor.guest_bathroom_occupied
    show_icon: true
    state_color: true
  - entity: binary_sensor.main_bathroom_occupied
    show_icon: true
    state_color: true

But with 10.07.21 and later clicking on binary_sensor.house_occupied does nothing. I’ve tried adding a tap_action to it, and either I don’t understand how to format the tap_action or it just plain doesn’t work.

Have you updated to 1.07.22 yet?

I had, and I did again just to check. Problem exists for me in 1.07.21 and 1.07.22. I have to revert back to 1.0.7.20 to restore the functionality.

Hmm there is no default action anymore. You are right. Can you make a bug on github?

1 Like

Can somebody explain to me how to show both the icon and state in info_entities? For example, for temperature, I want the thermometer icon, followed by the temperature.

I have not had any luck with getting it to display in the info_entities row. I am not sure if it is a bug or a feature.

It is possible to do in the entities row.

I have been trying to figure this out on my own and reading through this whole thread and the wiki, but I haven’t had any luck. I would like to get the hide_if function to work. I can get it to hide on simple states like ‘on’ or ‘off’ but not when one sensor’s value is less than or equal to another’s value. Is it possible?

  entities:

    - entity: sensor.bathroom_temp_sensor_humidity
      show_state: true
      show_icon: false
      show_name: false
      name: Humidity
    - entity: sensor.initial_humidity
      show_state: true
      show_name: false
      show_icon: false
      name: Initial Humidity
      hide_if:
        conditions:
          - condition: equals
            entity: sensor.bathroom_temp_sensor_humidity
            value: true

I would like to hide the sensor.initial_humidity if it is less than or equal to sensor.bathroom_temp_sensor_humidity.

Thanks in advance for the help. :slight_smile:

Here is the link to the wiki with configuration.

when i try this the background image only affects the top left icon

type: custom:room-card
title: Salone
entity: light.luci_salone
icon: mdi:lightbulb-group
show_icon: true
state_color: true
show_state: false
tap_action:
  action: toggle
double_tap_action:
  action: more-info
hold_action:
  action: more-info
styles:
  background-image: url('https://images.pexels.com/photos/235986/pexels-photo-235986.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1')
entities:

Am i doing it wrong ?

image

Can you show me the script for the volume buttons ?

Sorry it’s nothing exciting, just a mqtt call to HASS.Agent (higly recommended if you wanna control your pc via HA) running on the target machine via a button I created in it, or a plain request to media.player to volume up, depending on conditions:

sequence:
  - if:
      - condition: not
        conditions:
          - condition: or
            conditions:
              - condition: device
                device_id: 02b04594348468b26aaf943f3db23b23
                domain: media_player
                entity_id: media_player.turboviglen
                type: is_buffering
              - condition: device
                device_id: 02b04594348468b26aaf943f3db23b23
                domain: media_player
                entity_id: media_player.turboviglen
                type: is_paused
              - condition: device
                device_id: 02b04594348468b26aaf943f3db23b23
                domain: media_player
                entity_id: media_player.turboviglen
                type: is_playing
    then:
      - device_id: 250c005da7cff68f6df7363e9cb910c0
        domain: button
        entity_id: button.turboviglen_mediavolumeup
        type: press
    else:
      - service: media_player.volume_up
        data: {}
        target:
          entity_id: media_player.turboviglen
mode: single
icon: mdi:volume-plus
2 Likes

Is there a way to shrink the gaps shown on the picture

Hi everyone.

image

I suck at this HA stuff and I’m always trolling the forums looking for someone’s code to copy so I can complete a decent dashboard but always get stuck somewhere. Anyway I found someone who put this glow around their cards and I love it so thought I would share it.
If you want to change the colour from green to something else go to this site HTML colour picker and then you can “make” and choose any colour you want, just change the #56DD3F value in the code. If i remember correctly you also need to install card-mod from HACS.

You can just paste the code at the very bottom of your card.
show off what you came up with too.

style: |
  ha-card {
    background: none !important;
    box-shadow: 1px 0px 12px 10px #56DD3F !important;
  }
5 Likes

Hi,
I have a weird behaviour of this in regards of the displayed language of entity names/values - while the names are shown in german the state values are shown in the ‘localized’ value (what I see as value of ‘localized’ entry in the attribute of the entity itself).

In an entity card everything is displayed as german, so it looks an issue of the custom room card - can I choose what value is used to be displayed? Or does this need to be fixed in the code?


CustomRoomCardIssue2

Is it possible that it happens due to the fact that this a custom integration using HACS that has its own directory for translations and this is ignored by the custom room card?

The de.json is located here:

/config/custom_components/miele/translations/de.json

thanks for sharing!
is there a way to make that glow blinking according to an attribute change or threshold?

1 Like

Why always the icon shows “color red” and “blind-tilt-open” ?

  - entity: cover.toldo_estudio
    name: Toldo
    show_icon: true
    icon:
      template:
        styles: >
          if (entity.state = 'open') return 'color: red';   if (entity.state =
          'closed') return 'color: green';   else return 'color: orangered';
        icon: >
          if (entity.state = 'open') return 'phu:blind-tilt-open'; if
          (entity.state = 'closed') return 'phu:blind-tilt-closed'; else return
          'phu:blind-tilt-open';

Thanks in advance.

Jose

I think you need to use valid entity names and boolean operators in your if clauses. The best way to check to see if an entity’s state matches something is to use:

is_state('cover.toldo_estudio', 'open')

Also, open may be case sensitive (I don’t use covers much, so I don’t have an easy way to check). So it might be Open instead.