Lovelace: Multiple entity row

I love this frequently updated card more and more. Big thanks to @benct

Anyone succeeded in hiding an entity if unavailable or not found?

It does not work for me this way:

entities:
  - entity: light.eettafel_midden
    type: 'custom:multiple-entity-row'
    toggle: true
    entities:
      - attribute: brightness
        name: Brightness
        hide_unavailable: true
  - type: section
  - entity: media_player.werkplek
    type: 'custom:multiple-entity-row'
    hide_unavailable: true
    state_color: true
    toggle: true
    icon: 'mdi:google-home'
    entities:
      - attribute: volume_level
        name: Volume
        format: precision2
        hide_unavailable: true
  - entity: media_player.werkplek_hub
    type: 'custom:multiple-entity-row'
    hide_unavailable: true
    toggle: true
    icon: 'mdi:tablet-dashboard'
    entities:
      - attribute: volume_level
        name: Volume
        format: precision2
        hide_unavailable: true

What could be (done) wrong?
I think it will also be nice to hide an entity completely if unavailable?!

Do you know what the correct record should be in the case of changes in the color of the sensor icons?
Zrzut ekranu 2020-10-23 210245

Hi, please let me know, in more detail, what you like to achieve.
So, which state of which (attribute of) sensor should lead to which action?

Maybe you can share the current code, that could be make it more clear for me.
You can post in here or send me a private message.

I mean changing the color of the icon of a given sensor depending on whether it is on or off

example: if sensor.warm_water_active is ‘on’ icon mdi:fire is yellow
if sensor.warm_water_activated_2 is ‘on’ icon mdi:fire is yellow


  - entities:
      - entity: sensor.warm_water_active
        name: Aktywny
        icon: mdi:fire
      - entity: sensor.warm_water_activated_2
        name: Aktywowany
        icon: mdi:fire
    entity: sensor.warm_water_heating
    state: false
    show_state: false
    state_header: Grzanie wody
    state_color: true
    toggle: false
    name: CWU
    icon: 'mdi:coolant-temperature'
    type: 'custom:multiple-entity-row'

sensor.warm_water_active is ‘on’
sensor.warm_water_activated_2 is ‘off’
Zrzut ekranu 2020-10-24 201906 kopia

I guess you mean this?:

  - entity: sensor.warm_water_heating
    type: 'custom:multiple-entity-row'
    name: CWU
    show_state: false
    state_color: true
    entities:
      - entity: sensor.warm_water_active
        name: Aktywny
        icon: 'mdi:fire'
        state_color: true
      - entity: sensor.warm_water_activated_2
        name: Aktywowany
        icon: 'mdi:fire'
        state_color: true

Hi,
I’m new in HA, and i want to setup Multiple entity row. I’ve install this whit HACS, i create a lovelace.yaml and when my page is blank.
This is my .yaml :

views:
  - title: Accueil
    path: accueil
    panel: false
    badges: []
    cards:
#
#Multiple row test1
#
type: entities
entities: 
    - entity: sensor.nas_temperature
      type: custom:multiple-entity-row
      name: 'Temperature NAS 1'
      entities:
        - sensor.nas_temperature

          

#Nom de page
title: Test

Sorry, I didn’t notice the answer.

In the case of binary_sensor, of course, state_color: true will work. Unfortunately, the example I gave is the sensor and here the colors do not change as standard. I am using card-mode.

I managed to change the main icon, but not the additional one.

        style: |
          :host {
            --paper-item-icon-color:
              {% if is_state(config.entity, 'on')  %}
                var(--state-icon-active-color)
              {% else %}
                var(--state-icon-color)
              {% endif %}
              ;
          }

Mmm… What happens if you use the colors directly instead of via a var?

        style: |
          :host {
            --paper-item-icon-color:
              {% if is_state(config.entity, 'on')  %}
                yellow
              {% else %}
                orangered
              {% endif %}
              ;
          }

Maybe you could show the complete code of this part?

And, what is the info from this sensor as shown within Developer Tools?

  - entities:
      - entity: sensor.warm_water_active
        name: Aktywny
      - entity: sensor.warm_water_activated_2
        name: Aktywowany
        icon: 'mdi:fire'
        style: |
          :host {
            --paper-item-icon-color:
              {% if is_state(config.entity, 'on')  %}
                yellow
              {% else %}
                orangered
              {% endif %}
              ;
          }
    entity: sensor.warm_water_heating
    state: false
    state_header: Grzanie wody
    state_color: true
    toggle: false
    name: CWU
    icon: 'mdi:coolant-temperature'
    type: 'custom:multiple-entity-row'

image

After update Home Assistant custom:multiple-entity-row

Error

Hello,

I have a card with the following code:

type: 'custom:multiple-entity-row'
entity: sensor.wc_qp_janela
styles:
  color: var(--my-font01-color)
name: Janelas/portas
state_header: WC
entities:
  - entity: sensor.qp_varanda
    name: Varanda
  - entity: sensor.qp_janela
    name: Janela
    styles:
      color: var(--my-font02-color)
style: |
  ha-card {
    --my-font02-color: {% if states('sensor.qp_janela') = "Fechada" %}red{% else %}black{% endif %};
    --my-font01-color: {% if states('sensor.wc_qp_janela') = "Aberta" %}red{% else %}black{% endif %};
    }

The card:
image

The entities don’t change the color.

Some help, please?

thks

What do you get after changing ‘=’ to ‘==’ ?
Otherwise show info from sensor (attributes).

Hi,

the same result :neutral_face:

thks

If you give me some more detailed info than I can take a better look at it. At best you show your complete card and the sensor info.

Hi Nico,

The sensor info:

      # Sensores de porta e janela com estado personalizado
      qp_varanda:
        friendly_name: Porta da varanda
        value_template: "{% if is_state('binary_sensor.wd_qp_porta_varanda', 'on') %}Aberta{% else %}Fechada{% endif %}"
        icon_template: "{% if is_state('binary_sensor.wd_qp_porta_varanda', 'on') %}mdi:door-open{% else %}mdi:door-closed{% endif %}"
      
      qp_janela:
        friendly_name: Janela
        value_template: "{% if is_state('binary_sensor.wd_qp_janela_pequena', 'on') %}Aberta{% else %}Fechada{% endif %}"
        icon_template: "{% if is_state('binary_sensor.wd_qp_janela_pequena', 'on') %}mdi:door-open{% else %}mdi:door-closed{% endif %}"

      wc_qp_janela:
        friendly_name: WC Quarto principal
        value_template: "{% if is_state('binary_sensor.wd_wc_quarto_principal', 'on') %}Aberta{% else %}Fechada{% endif %}"
        icon_template: "{% if is_state('binary_sensor.wd_wc_quarto_principal', 'on') %}mdi:window-open{% else %}mdi:window-closed{% endif %}"

The code of the complete card:

type: 'custom:multiple-entity-row'
entity: sensor.wc_qp_janela
styles:
  color: var(--my-font01-color)
name: Janelas/portas
state_header: WC
entities:
  - entity: sensor.qp_varanda
    name: Varanda
  - entity: sensor.qp_janela
    name: Janela
    styles:
      color: var(--my-font02-color)
style: |
  ha-card {
    --my-font02-color: {% if states('sensor.qp_janela') == 'Fechada' %} red {% else %} black {% endif %};
    --my-font01-color: {% if states('sensor.wc_qp_janela') == 'Fechada' %} red {% else %} black {% endif %};
    }

Thanks for your help :slight_smile:

1 Like

Try this:

type: entities
entities:
  - type: 'custom:multiple-entity-row'
    entity: sensor.wc_qp_janela
    show_state: true
    styles:
      color: var(--my-font01-color)
    name: Janelas/portas
    state_header: WC
    entities:
      - entity: sensor.qp_varanda
        name: Varanda
      - entity: sensor.qp_janela
        name: Janela
        styles:
          color: var(--my-font02-color)
style: |
  ha-card { 
    --my-font02-color: {% if states('sensor.qp_janela') == 'Fechada' %} red {% else %} black {% endif %}; 
    --my-font01-color: {% if states('sensor.wc_qp_janela') == 'Fechada' %} red {% else %} black {% endif %}; 
  }
1 Like

Amazing…

It’s working.

NicoS, thanks for you help :slight_smile:

best regards

1 Like

Hello again,

How I can put the state blink?
image

I try this code, but didn’t work:

type: entities
entities:
  - type: 'custom:multiple-entity-row'
    entity: sensor.wc_qp_janela
    styles:
      color: var(--my-font01-color)
    style: |
      ha-card {
          animation: var(--my-animation);
          }
          @keyframes blink {
            50% {
                background: white;
                opacity: 0.0;
            }
    name: Janelas/portas
    state_header: WC
    entities:
      - entity: sensor.qp_varanda
        name: Varanda
        styles:
          color: var(--my-font02-color)
      - entity: sensor.qp_janela
        name: Janela
        styles:
          color: var(--my-font03-color)
style: |
  ha-card { 
    --my-font01-color: {% if states('sensor.wc_qp_janela') == 'Aberta' %} red {% else %} black {% endif %};
    --my-font02-color: {% if states('sensor.qp_varanda') == 'Aberta' %} red {% else %} black {% endif %};
    --my-font03-color: {% if states('sensor.qp_janela') == 'Abeta' %} red {% else %} black {% endif %};
    --my-animation: {% if states('sensor.wc_qp_janela') == 'Aberta' %} blink 2s ease infinite  {% endif %};
  }

I found the solution:

type: entities
entities:
  - type: 'custom:multiple-entity-row'
    entity: sensor.wc_qp_janela
    styles:
      color: var(--my-font01-color)
      animation: var(--my-animation01);
    style: |
      @keyframes blink {
        50% {
            background: white;
            opacity: 0.2;
        }
    name: Janelas/portas
    state_header: WC
    entities:
      - entity: sensor.qp_varanda
        name: Varanda
        styles:
          color: var(--my-font02-color)
          animation: var(--my-animation02);
        style: |
          @keyframes blink {
            50% {
                background: white;
                opacity: 0.2;
            }
      - entity: sensor.qp_janela
        name: Janela
        styles:
          color: var(--my-font03-color)
          animation: var(--my-animation03);
        style: |
          @keyframes blink {
            50% {
                background: white;
                opacity: 0.3;
            }
style: |
  multiple-entity-row { 
    --my-font01-color: {% if states('sensor.wc_qp_janela') == 'Aberta' %} red {% else %} black {% endif %};
    --my-font02-color: {% if states('sensor.qp_varanda') == 'Aberta' %} red {% else %} black {% endif %};
    --my-font03-color: {% if states('sensor.qp_janela') == 'Abeta' %} red {% else %} black {% endif %};
    --my-animation01: {% if states('sensor.wc_qp_janela') == 'Aberta' %} blink 2s ease infinite  {% endif %};
    --my-animation02: {% if states('sensor.qp_varanda') == 'Aberta' %} blink 2s ease infinite  {% endif %};
    --my-animation03: {% if states('sensor.qp_janela') == 'Aberta' %} blink 2s ease infinite  {% endif %};
  }

2 Likes

:+1: Rows in entities cards can be styled individually. For those, the styles will be applied to the shadowRoot of the element, so a good starting point (rather than ha-card ) would be :host :

See also here

1 Like

I’m trying to put a entities-condition inside multiple-entity-row but failed sofar. The following code demonstrates that in case of a single entity, the condition works. But, embed the condition within multiple-entity -row fails to react. Is this an indentation issue or is it NOT DOABLE at all? Any help appreciated.
Screenshot_2020-11-13 Overview - Home Assistant

type: entities
entities:
  - entity: sensor.str_dt_in_out
  - entity: sensor.last_flame_out
    type: conditional
    conditions:
      - entity: sensor.last_flame_out
        state: '00:00'
      - entity: switch.floor_pump_208
        state_not: 'on'
    row:
      entity: sensor.last_flame_out
  - entities:
      - entity: sensor.last_flame_out
        type: conditional
        conditions:
          - entity: sensor.last_flame_out
            state: '00:00'
          - entity: switch.floor_pump_208
            state_not: 'on'
        row:
          entity: sensor.last_flame_out
      - entity: sensor.floor_pump_power
        name: Power
        unit: W
    entity: switch.floor_pump_208
    icon: 'mdi:lightbulb'
    state_color: true
    toggle: false
    type: 'custom:multiple-entity-row'
show_header_toggle: false
title: ESP-MQTT