Updateanzeige im Dashboard

Hallo in die Runde.

Ich bin dabei mich so langsam in Home Assistant einzuwachsen und erstelle mir grad das/ die ersten Dashboards.

Ich hätte jetzt gern eine Anzeige auf dem Dashboard, ob es Updates gibt. Eine Liste mit auto-entities das habe ich schonmal hinbekommen, aber für das Hauptboard ist die doch etwas lang. Wie kann ich mir jetzt einen Helfer erstellen, der mir sagt “es sind xx Updates verfügbar” und mit Klick dann auf die Liste springt. oder das Symbol/ Schrift je nach Zustand grün oder gelb eingefärbt wird.

Ich hoffe, ich konnte mein Problem halbwegs verständlich darstellen.

Meinst Du so?

Mit den MUSHROOM Karten (aus HACS) geht das recht einfach.

type: custom:mushroom-update-card
entity: update.home_assistant_supervisor_update

Hallo Roberto,

na fast. Mir reicht es eigentlich, wenn ich, ich nenn es mal eine “Summencard” , habe.

Wenn ich dann da raufgehe dann würde mich dann die Ansicht schon gefallen.

Dafür könntest du dir einen eigenen Template-Sensor über die Helfer anlegen:

{{ states.update 
| selectattr('state','eq','on')
| list 
| count }}

Der gibt dir dann die Anzahl an Updates aus.

Ich glaub, jetzt bin auf dem richtigen Weg.

Wenn ich ihm jetzt noch beigebogen bekomme, dass er bei >0 das icon einfärben soll, dann hab ichs.

Kann man im Code-Editor Wenn dann Bedingungen einbauen?

Zeig doch mal den Code deiner Card.

Ich hab es mit der Bubble.Card mal so nachgebaut:

type: custom:bubble-card
card_type: button
button_type: state
entity: sensor.abfrage_updates
styles: |
  .bubble-button-background {
    opacity: 1 !important;
    background-color: ${state >= '1' ? 'red' : 'Lightgreen'} !important;
  }
grid_options:
  columns: 6
  rows: auto

Aber so färbt sich die Card doch schon entsprechend ein.

Ja, wenn kein Update vorliegt grün, ab einem Update rot.

Also alle “Probleme” beseitigt ?

Super. Vielen Dank für die schnelle Hilfe.

Vielleicht eine blöde Frage: Aber wo kommt der her?

Hat Maxe als Template Sensor Helfer empfohlen, 9 Mails höher.

1 „Gefällt mir“

Das mit dem Sensor klappt soweit.

mit der Farbe will es noch nicht so.

Hier ist mal mein Code.

type: custom:mushroom-entity-card
entity: sensor.updates
icon: mdi:cog
name: Updates
card_mod:
  style: |
    ha-card {
      {% if ( states('sensor.updates') , float(0) = 0 ) %}
        --card-mod-icon-color: green;
      {% elif ( states('sensor.updates') , float(0) <> 0 ) %}
        --card-mod-icon-color: red;
      {% endif %}
    }

Er will aber ums verrecken nicht grün werden.

da ist auch einiges falsch, wo hast du die styles her?
Schau mal so:

card_mod:
  style: |
    ha-card {
      {% if ( states('sensor.updates') | float(0) == 0 ) %}
        --card-mod-icon-color: green;
      {% else %}
        --card-mod-icon-color: red;
      {% endif %}
    }

Ich habe versucht etwas passendes zu finden und mir schien die Syntax recht logisch. :see_no_evil_monkey:

Aber Danke, jetzt klappt es.