Lovelace: Multiple entity row

i got it, icon is the trick

nice experiment ! :wink:

not trying to convince you of anything, but do you really feel the icons are beter than the name for this purpose?

see what I did:

and have the units nicely positioned too

type: entities
card_mod:
  style: |
    .card-content {
      padding: 8px 8px 8px 0px;
    }
entities:
  - type: custom:multiple-entity-row
    entity: weather.buienradar
    card_mod:
      style:
        hui-generic-entity-row $: |
          .info {
            display: none;
          }
#           state-badge {
#             display: none;
#           }
        .: |
          .entities-row {
           align-items: start !important;
           width: 100%;
           justify-content: space-evenly !important;
          }
#           .entities-row div.entity {
#             white-space: nowrap;
#           }
#     name: false
    show_state: false
#     tap_action:
#       action: more-info
#       entity: weather.buienradar
    entities:
      - entity: sensor.buienradar_temperature
        name: Temp
      - entity: sensor.buienradar_wind_force
        name: Bft
      - entity: sensor.buienradar_wind_direction
        name: Wind
#         unit: Uit #🧭
      - entity: sensor.buienradar_pressure
        name: Lucht
      - entity: sensor.buienradar_precipitation
        name: Neerslag
      - entity: sensor.buienradar_goes_irradiance
        name: Zon
      - entity: sensor.buienradar_humidity
        name: Vocht

maybe you can use it.

2 Likes

Agree with you)
To be honest my point is to get simple card with all my temp/hum sensors with auto-entities and multiple row.
But what i see is very complicated solution - why entities ar placing from right to left ? why there’s no option just to put name of sensor and show it’s values in rows? And so on :slight_smile:

I understand that all those things can be implemented via coding and regex, but it’s absolutely not user friendly, especially for such simple and common task:)

Why? well because these custom cards are made by people spending their time to try and get what they want/need at the time of developing.
It’s not that you can just use a custom card and expect its a completely free world of options. each option has to be implemented…

so, if you want something else, feel free to suggest a Feature request. Or, even better, open a Pull request with your own improvements.


Btw, I do think you can get what you want with a grid of small custom: button-card cards. might need some work in the config options, but very possible indeed. And you can place them as you wish.

Hey, is there a way to set the button right and the Text on Center? Currently is all right, because center made the button not in line with the other.

styles:
  width: 60px
  text-align: right

image

Create a picture in MS Paint (or similar) of what you need.
1 picture is worth 100 words.

i wanna set the text to center when the button is right
image

Using required “styles” may be sufficient.
Although in some cases card-mod may be needed.
Try to solve it step-by-step.

First, what is an initial task?
Assume you need to align the m-e-r toggle with a toggle in the next standard toggle-entity-row.
Then check these variants w/o setting a “width”:

type: entities
entities:
  - type: section
    label: default (short name)
  - type: custom:multiple-entity-row
    entity: sun.sun
    show_state: false
    entities:
      - entity: input_boolean.test_boolean
        name: name
        toggle: true
      - entity: input_boolean.test_boolean_2
        name: name
        toggle: true
  - entity: input_boolean.test_boolean

  - type: section
    label: default (long name)
  - type: custom:multiple-entity-row
    entity: sun.sun
    show_state: false
    entities:
      - entity: input_boolean.test_boolean
        name: name
        toggle: true
      - entity: input_boolean.test_boolean_2
        name: long long name
        toggle: true
  - entity: input_boolean.test_boolean

  - type: section
    label: align right (short name)
  - type: custom:multiple-entity-row
    entity: sun.sun
    show_state: false
    entities:
      - entity: input_boolean.test_boolean
        name: name
        toggle: true
      - entity: input_boolean.test_boolean_2
        name: name
        toggle: true
        styles:
          text-align: right
  - entity: input_boolean.test_boolean

  - type: section
    label: align right (long name)
  - type: custom:multiple-entity-row
    entity: sun.sun
    show_state: false
    entities:
      - entity: input_boolean.test_boolean
        name: name
        toggle: true
      - entity: input_boolean.test_boolean_2
        name: long long name
        toggle: true
        styles:
          text-align: right
  - entity: input_boolean.test_boolean

i.e. w/o setting the “width” results may be different dependently on a name’s length.
Here there are several factors which affect the result.
Probably you need to FIX one factor (“width”) - either you really need it or not, just to reduce a number of variables in the equation.

1 Like

Does anyone know how to use a template in secondary_info and in state_color?

I’d want to display the current temperature and the target temperature as a secondary info and then icons for each available preset. The currently active preset should be shown as active.

I’m overwhelmed by all the suggestions I find using single and double quotes, '{{ }} brackets, {% %} brackets and even [[ ]] brackets, putting everything in single or double quotes,… - it just does not get evaluated, but displays the code as static text (or in case of the icon colors, all three icons have the same color). Thanks!

type: entities
entities:
  - type: section
  - entity: climate.vorzimmer_heizung
    type: custom:multiple-entity-row
    name: Vorzimmer
    show_state: false
    state_color: true
    secondary_info: 'Current: {{ state_attr(''climate.vorzimmer_heizung'', ''temperature'') }}, Target: {{ state_attr(''climate.vorzimmer_heizung'', ''target_temperature'') }}'
    entities:
      - icon: mdi:thermometer-low
        state_color: '{{ is_state_attr(''climate.vorzimmer_heizung'', ''preset_mode'', ''eco'') }}'
        tap_action:
          action: call-service
          service: climate.set_preset_mode
          service_data:
            preset_mode: eco
            entity_id: climate.vorzimmer_heizung
      - icon: mdi:thermometer
        state_color: >-
          {{ is_state_attr('climate.vorzimmer_heizung', 'preset_mode',
          'comfort') }}
        tap_action:
          action: call-service
          service: climate.set_preset_mode
          service_data:
            preset_mode: comfort
            entity_id: climate.vorzimmer_heizung
      - icon: mdi:thermometer-high
        state_color: >-
          {{ is_state_attr('climate.vorzimmer_heizung', 'preset_mode', 'boost')
          }}
        tap_action:
          action: call-service
          service: climate.set_preset_mode
          service_data:
            preset_mode: boost
            entity_id: climate.vorzimmer_heizung

“Overwhelming” could be avoided if Docs are read))
Templates are not supported in m-e-r.
Dependently on “state_color”, an icon_color is set automatically for binary entities.

No templates at all? Oh. I have read the docs, but they do not contain the word “template” at all and the docs for secondary_info state: “The secondary_info field can either be any string if you just want to display some text”. I suggest to update the docs to add the note that templates are not supported.

As for the icon color, how do I color the icon for the active preset? I’d want some visual display of the current state and a visual confirmation when changing the preset. Thanks.

Ask in card-mod thread

Supporting templates is not a mandatory feature; most conventional cards do not support templates - why inability to support templates should be mentioned in Docs?
But you may create a PR in m-e-r Repo with your proposed changes in Docs anyway.

I don’t understand the card-mod thread, it’s about css customisation, why would that help? I’m not fluent with CSS. I just want three icons representing three presets, with the active preset highlighted. Shouldn’t there be an easy solution for that without messing with css?

I don’t know what is “convention”, I’ve been using HA for 3 months. You said the docs would have explained that templates are not supported, but unfortunately they don’t do so.

If some functionality is not described in Docs - it is probably not supported.

Cannot check it myself - please tell me, is this functionality supported in standard cards for your entity?
If yes - then this could be a reason for asking a FR in m-e-r repo.

It’s a climate entity. The HA default thermostat card does not display presets. I wanted to create something like GitHub - piitaya/lovelace-climate-mode-entity-row: Climate mode entity for Lovelace , just with the current temperature displayed too.

I meant Entities card mainly & more-info for a “climate” entity.
If a “climate” entity is placed on Entities card - will an icon (icon_color) change dependently on a preset?

Answer is - no.
So, you have 2 ways: either use card-mod or create template binary sensors like “ON if a preset=xxx” (+ use state_color=true).

I understand, thanks for your help.

I’ve been mostly using custom:flex-table-card together with auto-entities.
Table like structure looks like this:

Name | actual temperature | set temperature | actual humidity | level|
Room1 Thermo |23.5|23.0|50|…|
Room1 Heater . |23.2|23.0|…|10|

First 2 values are common to thermostats and heaters
3rd value is only for thermostats and 4th for heaters (its the valve level). So it’s a fixed 5 columns table.

As there has been a change on the new Homematic integration level does not come any more as attribute in climate instead its now a sensor (state is level of valve) and it’s only for heaters.

As flex-table only supports one entity per row I tried with markdown. Works but a lot to type and not really readable. Defining for a heavy lot of heaters template sensors isn’t a solution too.
Therefore I used multiple-entity-row. With hide_if I get a table like this:

Room1 Thermo |23.5|23.0|50|
Room1 Heater . |23.2|23.0|10|

This is confusing as it should look like at the top.
As I didn’t find another way I defined , I’m using an unavailable attribute level in the 1st row and for humidity in the 2nd row.

Room1 Thermo |23.5|23.0|50 . . . . . .|undefined|
Room1 Heater . |23.2|23.0|undefined|10 . . . . . |

So the question is, how to get rid of the „undefined“ (replace it or something else) or to be able to define an empty column to get the fixed column structure
Any idea?

Here’s my current code:

type: entities
entities:
  - entity: climate.fg_az_thermostat
    type: custom:multiple-entity-row
    show_state: false
    name: FG-AZ-Thermo
    entities:
      - attribute: current_temperature
        name: Current [°C]
        format: precision1
        styles:
          width: 50px
          text-allign: right
      - attribute: temperature
        name: Set [°C]
        format: precision1
        styles:
          width: 50px
          text-allign: right
      - attribute: current_humidity
        name: Humidity [%]
        format: precision0
        styles:
          width: 56px
          text-allign: right
      - attribute: level
        name: Valve [%]
        format: precision0
        styles:
          width: 50px
          text-allign: right
  - entity: climate.fg_az_heater
    type: custom:multiple-entity-row
    show_state: false
    name: FG-AZ-Heater
    entities:
      - attribute: current_temperature
        name:  
        format: precision1
        styles:
          width: 50px
          text-allign: right
      - attribute: temperature
        name: 
        format: precision1
        styles:
          width: 50px
          text-allign: right
      - attribute: current_humidity
        name: 
        format: precision0
        styles:
          width: 56px
          text-allign: right
      - entity: sensor.fg_az_heater_level
        name: ' '
        format: precision0
        unit: false
        styles:
          width: 50px
          text-allign: right

Read about “hide_if” & “default” in Docs.

Ildar hide_if I tried already but then I’ve instead of the fixed 5 column structure a 4 column one.
So instead of having name|actual|set|humidity|level I get a
name|actual|set| humidity or level.
This is somehow confusing because in the 4th column it will be either humidty oder valve level.