question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

card-mod with multiple-entity-row

See original GitHub issue

My Home Assistant version: 0.117.5

My lovelace configuration method (GUI or yaml): GUI

What I am doing:

Hy, i would to color the entities based on a status in a multiple-entity-row entity. Is possible? I try to use CARD-mod but seams that is not compatible with multiple-entity-row. My situation is this: but not work.

can you help me?

What I expected to happen:

color the text depending of the value

What happened instead:

nothing. The text remain with the base black color.

Minimal steps to reproduce:


card:
  title: Volumetric
  type: entities
  entities:
    - entity: light.volumetrico_ufficio
      icon: 'mdi:signal'
      type: 'custom:multiple-entity-row'
      secondary_info: last-changed
      toggle: true
      state_color: true
      entities:
        - entity: sensor.volumetrico_ufficio_status
          name: false
          style: |
            ha-card {
            color: {% if is_state('sensor.volumetrico_ufficio_status', 'NORMAL')
            %} green {% else %} red {% endif %};
            }   



Error messages from the browser console:

nothing error message

By putting an X in the boxes ([ ]) below, I indicate that I:

  • [X ] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).

  • [X ] Have made sure I am using the latest version of the plugin.

  • [X ] Have followed the troubleshooting steps of the “Common Problems” section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.

  • [X ] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
viktakcommented, Mar 22, 2021

@KTibow Thank you for all the help! I finally understand how this works and was able to not only make this example work, but also styled several other cards using the same method. This was the key hint you gave me:

You can’t just put a $. You need to be specific about which element to root into.

I constantly got this wrong. The above hint made me realize that my “root” element is the entity card.

For anyone else arriving here and wondering, this is the final yaml that actually works as expected:

          - entity: sensor.supervisor_updates
            name: Supervisor
            icon: mdi:home-assistant
            type: custom:multiple-entity-row
            show_state: false
            entities:
              - entity: sensor.supervisor_current_version
                name: Installed
              - entity: sensor.supervisor_latest_version
                name: Latest
            card_mod:
            style: |
              {% if states('binary_sensor.updater_supervisor') == "on" %}
              div.entity:nth-child(2) > div:nth-child(2) {
                color: yellow;
              }
              {% endif%}

Thank you again for sticking with me on this!!!

0reactions
Anton-Kacommented, Jul 14, 2021

@KTibow Thank you for all the help! I finally understand how this works and was able to not only make this example work, but also styled several other cards using the same method. This was the key hint you gave me:

You can’t just put a $. You need to be specific about which element to root into.

I constantly got this wrong. The above hint made me realize that my “root” element is the entity card.

For anyone else arriving here and wondering, this is the final yaml that actually works as expected:

          - entity: sensor.supervisor_updates
            name: Supervisor
            icon: mdi:home-assistant
            type: custom:multiple-entity-row
            show_state: false
            entities:
              - entity: sensor.supervisor_current_version
                name: Installed
              - entity: sensor.supervisor_latest_version
                name: Latest
            card_mod:
            style: |
              {% if states('binary_sensor.updater_supervisor') == "on" %}
              div.entity:nth-child(2) > div:nth-child(2) {
                color: yellow;
              }
              {% endif%}

Thank you again for sticking with me on this!!!

I struggled with this snag for several hours. With your help, everything worked out. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lovelace: Multiple entity row - Home Assistant Community
Multiple Entity Row Show multiple entity states or attributes on entity rows in Home ... More card-mod examples for "multiple-entity-row".
Read more >
benct/lovelace-multiple-entity-row - GitHub
Show multiple entity states and attributes on entity rows in Home ... NOTE: This is not a standalone lovelace card, but a row...
Read more >
multiple-entity-row - Home Assisant Cards
multiple -entity-row ... There is no image for the card. Here are the instructions how to add an image. Tags: entity-row
Read more >
Hide Entity State Icons - Domoticaworld.com
Hide Entity State Icons ; NEXT: you hide icons by typing a space in the icon field (or add ” ” in the...
Read more >
Home Assistant | Does anyone know of a card add-on that ...
GitHub - thomasloven/lovelace-fold-entity-row: A foldable row for entities card ... You can have as many entities as you want in custom:button-card using ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found