Lovelace: Multiple entity row

How can I display the entity values ​​as an icon, the values ​​on as icon mdi:door-open in green and the values ​​off in red and icon mdi:door-closed this is the code. What do I have to change in the code

type: entities
entities:

  • entity: sensor.xxx_none_super
    name: OIL
    image: /local/Tankstelle/oil.png
    type: custom:multiple-entity-row
    entities:
    • entity: binary_sensor.xxx_none_status
      name: Status
      state-color: true
      show_header_toggle: false
      grid_options:
      rows: 1.6

sorry me English is not so good

Have a small problem with the card, displaying data from a solar production sensor providing high accuracy data with 4 fractional digits precision.
I want to limit to 1 digit, but the precision formatting seems not to work for the entities, while it works well for secondary info:

ksnip_20250320-162020

Here the code, is there something wrong with it?

entity: sensor.solar_production_energy_monthly
type: custom:multiple-entity-row
name: Produktion (Monat)
secondary_info:
  entity: sensor.solar_production_energy_yearly
  name: "Jahr:"
  format: precision1
show_state: false
state_color: true
column: true
entities:
  - entity: sensor.solar_production_energy_monthly
    name: Aktuell
    unit: null
    format: precison1
  - attribute: last_period
    name: Vormonat
    unit: kWh
    format: precison1

fix the typo

OMG, and I thought I did copy’n’paste…
Thanks, stupid mistake, but great card!

Hello everyone.
First time poster, long time reader.
I have a template sensor, that changes icon on state from climate entity.
this is working fine.
I’m trying to get that icon to be displayed in a multiple entity row.
This is where it gets tricky, I can’t figure out how to retrieve the data from the sensor. Well, I can get the data, but instead of displaying the actual icon, it displays : “mdi:fire”
Any help appreciated :slight_smile:
Thanks !

type: entities
entities:
  - entity: sensor.thermopompe_current_temperature
    type: custom:multiple-entity-row
    name: Thermopompe
    entities:
      - entity: binary_sensor.icon_thermopompe
        attribute: icon
  - entity: sensor.thermo_salon_current_temperature
    type: custom:multiple-entity-row
    name: Salon
    entities:
      - icon: |
          {% if is_state("binary_sensor.icon_salon", "on") %}
            mdi:fire
          {% else %}
            mdi:void
          {% endif %}

I’m just trying to get the Icon to be displayed, and not the the string.
Getting string on Thermopompe
Getting nothing from Salon, i just copied the template hoping it would work

Thank you all !

This code will not work since m-e-r (multiple-entity-row) does not support templates.

What is your final goal?
Change an icon dynamically?

Exactly.
If hvac_mode of my heathing device is set to “heat”
then I want an icon (mdi:fire) to be shown on the line, before the temperature.
this will let me know that the said device is working.

A general schema, adapt for yourself:

type: entities
entities:
  - type: custom:multiple-entity-row
    entity: sun.sun
    card_mod:
      style: |
        div.entity:nth-child(2) state-badge {
          {% if ... -%}
          --card-mod-icon: mdi:xxx;
          {%- else -%}
          --card-mod-icon: mdi:yyy;
          {%- endif %}
        }
    entities:
      - entity: sun.sun
      - entity: sun.sun
        name: false
        icon: true
      - entity: sun.sun
        name: false
        icon: true

1 Like

Thank you very much for your time !
This is SOLVED !

type: entities
entities:
  - type: custom:multiple-entity-row
    name: THERMO
    entity: sensor.thermopompe_current_temperature
    card_mod:
      style: |
        div.entity:nth-child(1) state-badge {
          {% if is_state("binary_sensor.icon_thermopompe", "on") -%}
          --card-mod-icon: mdi:fire;
          {%- else -%}
          --card-mod-icon: mdi:void;
          {%- endif %}
        }
    entities:
      - entity: binary_sensor.icon_thermopompe
        name: false
        icon: true

Hello, would like to set the button to the right of the charge value, can anyone help me? Best regards

type: entities
entities:
  - entity: sensor.heizkorper_batterie
    icon: mdi:battery
    name: Thermostat Fitnessraum
    secondary_info:
      entity: sensor.heizkorper_battery_last_replaced
      name: "Gewechselt:"
      format: date
    type: custom:multiple-entity-row
    style: |
      .entity:not(.state)>div {
        color: var(--secondary-text-color);
      }
    state_header: Charge
    entities:
      - entity: sensor.heizkorper_battery_type
        name: Battery Type
        styles:
          width: 80px
          font-weight: bold
          text-align: right
      - entity: button.heizkorper_battery_replaced
        name: false
        type: button
        icon: mdi:update
        styles:
          width: 20px
          font-weight: bold
          text-align: right
        tap_action:
          action: call-service
          service: button.press
          service_data:
            entity_id: button.heizkorper_battery_replaced
          confirmation:
            text: Bist du dir sicher?


Set the main entity to hidden (see docs of the mukti entity card) and add it again as additional entity at the place, where you want to see it.

Thanks a lot, i will try!

Can someone help me style the header lines? I want them a little bigger. I’m unable to target them with CSS and haven’t seen any examples here or in the card mod thread for multiple entity row.

I can change the color with

styles: 
    --secondary-text-color: white

but not the size or weight.

You can only do it with cardmod. Go to the main cardmod thread - 1st post - fantastic link at the bottom - multiple-entity-row.

Yeah I’ve been through every example there but haven’t found a single one that touches this particular element.

This was incorrect, there are indeed samples there of styling this text, they just don’t work for me, don’t understand why. I use card_mod heavily, but when it comes to this card it’s like I’m just unable to target things at all.

Here’s something I copied from the card_mod thread, it does nothing on my end…


type: entities
entities:
  - type: custom:multiple-entity-row
    entity: sensor.washing_machine_time_remaining
    name: Þvottavél
    icon: mdi:washing-machine
    show_state: false
    entities:
      - entity: sensor.washing_machine_time_remaining
        name: Tími eftir
        style: |
          .state.entity {
            color: magenta;
          }
          .state.entity span {
            color: cyan;
          } 
      - entity: sensor.washing_machine_finish_time
        name: Klárast kl.

Answered here: 🔹 Card-mod - Add css styles to any lovelace card - #8940 by Ildar_Gabdullin

1 Like
                              - type: custom:multiple-entity-row
                                entity: fan.salon
                                name: Mode
                                show_state: false
                                secondary_info:
                                  attribute: preset_mode
                                entities:
                                  - entity: fan.salon
                                    name: Mode Auto
                                    icon: mdi:fan-auto
                                    tap_action:
                                      action: call_service
                                      service: fan.set_preset_mode
                                      service_data:  # <-- Doit être aligné avec 'service'
                                        preset_mode: Auto  # <-- Doit être aligné avec 'service'
                                        entity_id: fan.salon # <-- Doit être aligné avec 'service'

the service call doesn’t work …?? why ??

Great mod, so versatile. Thanks :slight_smile:

1 Like

Version 4.7.0 just shipped - a ton of fixes an updates

:warning: Breaking changes

  • Minimum Home Assistant version is now 2024.4 (enforced via hacs.json). The row now always delegates state/attribute display to HA’s own formatters (hass.formatEntityState / formatEntityAttributeValue), so values match HA’s UI formatting exactly. If you’re on an older HA, stay on 4.6.1.
  • Sub-entity taps no longer also fire the main row’s action. If you relied on that double-firing, configure the desired action explicitly per entity.
  • A long-press without a hold_action now acts as a plain tap (matching HA’s native rows; previously opened more-info).

What’s new

  • Visual editor — edit the row through the entities card’s UI editor: tabbed Main/1/2/3 entity editing with add/reorder/copy/paste/delete, secondary info, state-based icons, per-entity custom CSS, and tap/hold/double-tap selectors.
  • Per-entity hold_action and double_tap_action — every action resolves against the entity actually tapped, including tap_action.entity more-info overrides.
  • Combinable formats — comma-separated numeric pipelines, with a Custom… entry in the editor:
    format: invert, precision3
    
  • hide_if against another entity:
    entities:
      - entity: sensor.dsc_exit_state
        hide_if:
          entity: switch.dsc_armed_away
          value: 'off'
    
  • icon_color — any CSS color for entity icons: icon_color: 'var(--accent-color)'
  • state_icon — state-to-icon map, takes precedence over icon:
    state_icon:
      'on': mdi:door-open
      'off': mdi:door-closed
    
  • show_state_first — render the main state before the additional entities.
  • New formats: percent (value × 100 → 25 %), and upper / lower / capitalize / title text transforms.
  • --multiple-entity-row-header-color theme variable for entity header color.
  • Top-level hide_if / hide_unavailable now work on the main state value (previously silently ignored).

Internal

  • Actions dispatch through HA core (hass-action event) — native confirmation dialogs and lock/cover security restrictions now apply; the unmaintained custom-card-helpers dependency is gone.
  • Incremental TypeScript migration begun; pre-2023.9 formatting fallbacks removed.
  • Fixed an uncaught RangeError when typing an incomplete precision/kilo/mega/milli format in the editor.

Credits

This release leans heavily on the community:

  • duczz — several features and the editor approach were adapted from the ha-multiple-entity-row fork
  • akomelj — original hide_if.entity implementation (#280)
  • ildar170975 — header-color theme variable (#317) and docs clarifications (#303)
  • tomatenkoppshow_state_first design (#384)
  • And the reporters whose issues shaped this release: pdwonline (#197), andreas-bulling (#325), kylepyke (#323), MiguelTVMS (#367), metbril (#227), Pat28 (#385), dcapslock (#386, #387 testing)
  • benct — original author and long-time maintainer of this card

Resolves #188, #197, #202, #227, #251, #323, #325, #367 (see also the previously closed #280, #338, #384, #385, #387).

Full Changelog: Comparing v4.6.1...v4.7.0 · benct/lovelace-multiple-entity-row · GitHub

3 Likes