Validating and displaying a sensor with large text values

Hi there,

my Wallbox does provide a sensor about the current operating state with a larger text.
Yet, I don’t know all the states that the Wallbox might send - and the tile card is not capable of displaying all the content - like you can see in the screenshot below.

Therefore, I am using the Markdown Card as of now - but I would like to get a view similar to the tile card.
I don’t know if this can be done?

Secondary, I would like to change the <ha-alert> based on the content of the sensor.
I know, I can do this with an if/else template, but is there a way to validate this just on some patterns of the whole text?

here are some examples that I have already in my history of the sensor (sorry, the sensor value is in german - I’ve tried to translate them into english below)

  • Ladevorgang wurde gestartet… (bei Problemen: Prüfe bitte zuerst in den Einstellungen ‘Ladeeinstellungen’ und ‘Konfiguration’.)

    • Charging process has started… (if there are problems: please first check the settings ‘Charging settings’ and ‘Configuration’.)
  • Keine Ladung, da der Ladepunkt gesperrt ist

    • No charging because the charging point is locked
  • Die Ladung kann nicht gestartet werden, da die Einschaltschwelle nicht erreicht wird

    • Charging cannot be started because the switch-on threshold is not reached
  • Der Ladevorgang wird trotz fehlenden Überschusses nicht gestoppt, da in dem Fahrzeugprofil die Einstellung "Ladung aktiv halten’ aktiviert ist.

    • The charging process is not stopped despite there being no surplus because the setting ‘Keep charging active’ is activated in the vehicle profile.
type: tile
entity: sensor.test_text
tap_action: none
card_mod:
  style:
    ha-tile-info#info $: |
      state-display {
        white-space: normal;
        color: var(--secondary-text-color);
      }
      .info {
        height: unset !important;
      }

image

Thanks :slight_smile:
But somehow, my tile card keeps its height - due to the usage of sections…
On a ‘regular’ dashboard, the card-mod is working fine.

Define more rows for this cell?
image

Yeah, that’s probably the only way.

I was thinking, if there could be way to ‘resize’ the tile depending on the lenght of the text :slight_smile:

I think, I will stick to the yaml card for now :slight_smile: