Solar Einspeisung animieren

Hallo,

ich mochte das mein Solar Icon animiert wird, sobald das erste Watt angezeigt wird. Leider finde ich unter Mushroom nichts brauchbares. Hätte da jemand ein Code für mich?

Danke

evtl. hilft Dir das ein wenig

link

danke, leider nicht so das richtige

Hi und erstmal herzlich willkommen. Ich nehme an du willst das direkt in der mushroom-card darstellen. Über eine mushroom-template card kann das icon animiert werden. Habe gerade nochmal schnell geschaut, das ha-state-icon muss angesprochen werden. Habe es auch bei mir getestet, graue Sonne gleich 0Watt und animierte gelbe Sonne größer 0 Watt.

type: custom:mushroom-template-card
primary: Solarproduktion
secondary: "{{ states('sensor.total_power') }} W"
icon: mdi:white-balance-sunny
entity: sensor.total_power
color: |
  {% if states(entity) | float(0) > 0 %}
    amber
  {% else %}
    grey
  {% endif %}
features_position: bottom
card_mod:
  style: |
    ha-state-icon {
      {% if states('sensor.total_power') | float(0) > 0 %}
        animation: rotation 20s linear infinite;
      {% endif %}
    }
    @keyframes rotation {
      0% {
        transform: rotate(0deg);
      }
      100% {
        transform: rotate(360deg);
      }
    }

vielleicht ist das ja was du suchst: KLICK

Super danke! Noch ne Möglichkeit das er ab 1000 Watt ein 1,0k anzeigt?

n.

Super danke! Noch ne Möglichkeit das er ab 1000 Watt ein 1,0k anzeigt?

Moin, ja klar die Zahl kann man auch noch anpassen, wenn man möchte:

image

type: custom:mushroom-template-card
primary: Solarproduktion
secondary: >-
  {% set val = states('sensor.total_power') | float(0) %}
  {% if val > 1000 %}
    {{ (val / 1000) | round(2) | replace('.', ',') }} kW
  {% else %}
    {{ val | round(0) }} W
  {% endif %}
icon: mdi:white-balance-sunny
entity: sensor.total_power
color: |
  {% if states(entity) | float(0) > 0 %}
    amber
  {% else %}
    grey
  {% endif %}
features_position: bottom
card_mod:
  style: |
    ha-state-icon {
      {% if states('sensor.total_power') | float(0) > 0 %}
        animation: rotation 20s linear infinite;
      {% endif %}
    }
    @keyframes rotation {
      0% {
        transform: rotate(0deg);
      }
      100% {
        transform: rotate(360deg);
      }
    }

besten dank!

Hi,

wollte die Rotation auf blinken umstellen: findet ihr den Fehler im code?

ha-state-icon {
{% if states(‚sensor.hub_2000_output_pack_power‘) | float(0) > 0 %}
animation: blink 1.5s linear infinite;
{% endif %}
}

@keyframes blink {
50% {
opacity: 0;
}
}

EDIT by Jay: Code bitte immer über die Codefunktion „</>“ im Editor einfügen.

Der Fehler im Code liegt bei deinen Anführungszeichen!
Du kannst nicht die „deutschen“ Anführungszeichnen nutzten, sondern 'test'

Als Tipp, wenn du die opacity auf z.B. 0.3 setzt, blinkt das icon nicht wild herum sondern leuchtet sozusagen immer auf.

type: custom:mushroom-template-card
primary: Solarproduktion
secondary: "{{ states('sensor.hub_2000_output_pack_power') }} W"
icon: mdi:white-balance-sunny
entity: sensor.hub_2000_output_pack_power
color: |
  {% if states(entity) | float(0) > 0 %}
    amber
  {% else %}
    grey
  {% endif %}
features_position: bottom
card_mod:
  style: |
    ha-state-icon {
      {% if states('sensor.hub_2000_output_pack_power') | float(0) > 0 %}
        animation: blink 1.5s linear infinite;
      {% endif %}
    }
    @keyframes blink {
      50% {
        opacity: 0;
      }
    }