Regensensor Anzeige Fehler

Hi an Alle:

Stehe vor einem Rätsel:

bei Regen wird mir der Text “Regen” so angezeigt, als wäre der Platz “zu klein”

Bei Trockenheit ist alles OK:

Hier mal der Code dazu:

type: entity
card_mod:
  style: |
    :host {
     {% if is_state('binary_sensor.hm_sen_rd_o_qeq0808454_ch1', 'on') %}
      --card-mod-icon:  mdi:weather-pouring;
      --card-mod-icon-color: #039dfc;
      {% else %}
      --card-mod-icon: mdi:weather-cloudy;
      --card-mod-icon-color: #f2f2f2;
      {% endif %}
    }
    .name {
       font-size: 20px !important;
       margin-top: -5px; 
      }
    .value { 
       font-size: 35px !important;
       margin-left: px !important; 
       visibility: hidden;
       position: relative;
       display: inline-block; 
      }
    .value::before { 
       content: ""; 
       visibility: visible; 
       position: absolute; 
       top: 0;
       left: 0;
       right: 0;
       bottom: 0;
       display: flex; 
       justify-content: center;
       align-items: center;
       line-height: 1;
    }
    {% if is_state('binary_sensor.hm_sen_rd_o_qeq0808454_ch1', 'on') %}
      .value::before {
        content: "Regen";
    }
    {% else %}
      .value::before {
        content: "Trocken";
      }
    {% endif %}
    .icon {
       --mdc-icon-size: 40px;
       margin-top: -px;
       margin-right: -15px;
      }
       .info {
       margin-bottom: -5px; !important 
      }
grid_options:
  columns: 6
  rows: auto
name: Regen
icon: mdi:water-percent
state_color: false
entity: binary_sensor.hm_sen_rd_o_qeq0808454_ch1

Kann mir da bitte jemand helfen

Danke und Gruß

Jürgen

das wird nicht mehr weiterentwickelt
daher schon mal hier bitte lesen und umstellen:

geht sehr zügig, im zweifel Fall von unten nach oben lesen :grinning_face:

1 „Gefällt mir“

die KI antwortet zu deinem Problem:
(aber sichere bitte deinen Code, aber der ist ja auch hier)

type: entity
card_mod:
  style: |
    :host {
      {% if is_state('binary_sensor.hm_sen_rd_o_qeq0808454_ch1', 'on') %}
        --card-mod-icon: mdi:weather-pouring;
        --card-mod-icon-color: #039dfc;
      {% else %}
        --card-mod-icon: mdi:weather-cloudy;
        --card-mod-icon-color: #f2f2f2;
      {% endif %}
    }
    .name {
      font-size: 20px !important;
      margin-top: -5px; 
    }
    .value { 
      font-size: 0px !important; /* Versteckt den Originaltext komplett */
      margin-left: 0px !important; 
      position: relative;
      display: inline-block; 
    }
    .value::before { 
      font-size: 35px !important; /* Setzt die Größe für "Regen"/"Trocken" */
      visibility: visible; 
      position: absolute; 
      top: 0;
      left: 0;
      display: flex; 
      align-items: center;
      line-height: 1;
      white-space: nowrap; /* Verhindert ein Abschneiden des Textes */
    }
    {% if is_state('binary_sensor.hm_sen_rd_o_qeq0808454_ch1', 'on') %}
      .value::before {
        content: "Regen";
      }
    {% else %}
      .value::before {
        content: "Trocken";
      }
    {% endif %}
    .icon {
      --mdc-icon-size: 40px;
      margin-top: 0px;
      margin-right: -15px;
    }
    .info {
      margin-bottom: -5px !important; 
    }
grid_options:
  columns: 6
  rows: auto
name: Regen
state_color: false
entity: binary_sensor.hm_sen_rd_o_qeq0808454_ch1

funktioniert leider nicht - es wird kein Value angezeigt..

Habe gerade nochmal im Code herumgespielt:

Irgendwo hier liegt der Fehler:

.value {
font-size: 35px !important;
margin-left: px !important;
xxx
position: relative;
display: inline-block;
}
.value::before {
content: „“;
xxx
position: absolute;

Das Problem wird auch sein: Es wird “Nass” ausgegeben (4Buchst.) daraus soll “Regen” werden (5 Buchst.)

Vielleicht hat noch jemand ne Idee..

Gruß Jürgen

Das war mir neu, da habe ich im nächsten Urlaub was zu tun..

Gruß Jürgen

Ok, nochmal nen Update:

Hab das ganze von Grund auf neu gemacht, ohne “übersetzung” von “Nass” nach “Regen” und noch mal durch die Ki gejagt und sie da jetzt geht es :smiley:

type: entity
entity: binary_sensor.hm_sen_rd_o_qeq0808454_ch1
name: Regen
state_color: false
grid_options:
  rows: auto
  columns: 6
card_mod:
  style: |
    :host {
      {% if is_state('binary_sensor.hm_sen_rd_o_qeq0808454_ch1', 'on') %}
      --card-mod-icon: mdi:weather-pouring;
      --card-mod-icon-color: #039dfc;
      --mdc-icon-size: 40px;
      {% else %}
      --card-mod-icon: mdi:weather-cloudy;
      --card-mod-icon-color: #f2f2f2;
      --mdc-icon-size: 40px; 
      {% endif %}
    }
    .name {
       font-size: 20px !important;
       margin-top: -5px; 
      }
    .value { 
       font-size: 0px !important; 
    }
    .value::after {
      content: "{% if is_state('binary_sensor.hm_sen_rd_o_qeq0808454_ch1', 'on') %}Regen{% else %}Trocken{% endif %}";
      font-size: 35px !important;
      visibility: visible;
      display: inline-block;
    }
    .icon {
       margin-top: 0px;
       margin-right: -15px;
     }
    .info {
       margin-bottom: -5px !important; 
     }

Gruß Jürgen
2 „Gefällt mir“