2 Skinning Beispiele
Forgejo Release Bot edited this page 2026-11-21 17:45:21 +01:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Skinning-Beispiele für Kodi 22

Diese Beispiele verwenden die Window-Properties des Kodi-Wetterfensters (ID 12600). Für Homescreen-Widgets immer ausdrücklich Window(Weather).Property(...) angeben. Es handelt sich um Bausteine, nicht um vollständige Skin-Dateien.

1. Aktuelle Wetterkarte

<control type="group">
  <control type="label">
    <label>$INFO[Window(Weather).Property(Current.Location)]</label>
  </control>
  <control type="label">
    <label>$INFO[Window(Weather).Property(Current.Condition)]</label>
  </control>
  <control type="label">
    <label>$INFO[Window(Weather).Property(Current.Temperature)]°C</label>
  </control>
  <control type="label">
    <visible>!String.IsEmpty(Window(Weather).Property(Current.Pressure))</visible>
    <label>Luftdruck: $INFO[Window(Weather).Property(Current.Pressure)]</label>
  </control>
  <control type="label">
    <visible>!String.IsEmpty(Window(Weather).Property(Current.WindGust))</visible>
    <label>Windboeen: $INFO[Window(Weather).Property(Current.WindGust)] km/h</label>
  </control>
</control>

Current.Pressure enthält bereits hPa – im Skin keine zweite Einheit anfügen. Current.WindGust ist ohne Einheit formatiert; Today.WindGust enthält dagegen bereits km/h. Bei anderer Sprachausgabe eigene Lokalisierungsstrings verwenden.

2. Vorhersagetag mit Wochentag, Text und Icon

<control type="group">
  <control type="label">
    <label>$INFO[Window(Weather).Property(Day0.Title)]</label>
  </control>
  <control type="label">
    <label>$INFO[Window(Weather).Property(Day0.Outlook)]</label>
  </control>
  <control type="label">
    <label>$INFO[Window(Weather).Property(Day0.HighTemp)]°C</label>
  </control>
  <control type="image">
    <texture>$INFO[Window(Weather).Property(Day0.OutlookIcon),resource://resource.images.weathericons.default/]</texture>
  </control>
</control>

Achtung: Der resource://...default/-Pfad zeigt nur die Variante mit fest gewähltem Standard-Wettericonpaket. Wenn Arctic Zephyr ICU ein benutzerdefiniertes Paket anbietet, muss der Pfad über dessen Icon-Paket-Auswahl kommen; sonst geht diese Einstellung verloren. Day0.OutlookIcon selbst ist lediglich N.png.

3. Warnungskachel nur bei aktiven Warnungen

<control type="group">
  <visible>String.IsEqual(Window(Weather).Property(Alerts.HasAlerts),true)</visible>
  <control type="image">
    <texture>$INFO[Window(Weather).Property(Alerts.HighestIcon)]</texture>
  </control>
  <control type="label">
    <label>$INFO[Window(Weather).Property(Alerts.Summary)]</label>
  </control>
  <control type="label">
    <label>Warnstufe $INFO[Window(Weather).Property(Alerts.HighestLevel)]</label>
  </control>
</control>

Die Alerts.*.Icon-Felder enthalten absolute, bereits aufgelöste Bildpfade. Hier keinen zweiten Ressourcen-Pfad voranstellen.

4. Mehrere Warnungen und Warnstufenzähler

<label>$INFO[Window(Weather).Property(Alerts.Count)]</label>
<label>$INFO[Window(Weather).Property(Alerts.1.headline)]</label>
<label>$INFO[Window(Weather).Property(Alerts.Level2.Count)]</label>
<texture>$INFO[Window(Weather).Property(Alerts.1.LevelIcon)]</texture>

Für Stufe 4 gilt: die ARGB-Eigenschaft kann violett sein, obwohl die Bilddatei rot ist. Deshalb Alerts.HighestLevel oder Alerts.HighestColor auswerten, wenn die Darstellung den amtlichen Schweregrad ausdrücken soll.

5. Sichtweite und Strahlung aus MOSMIX

<control type="group">
  <visible>String.IsEqual(Window(Weather).Property(MOSMIX.Status),ok)</visible>
  <control type="label">
    <visible>!String.IsEmpty(Window(Weather).Property(MOSMIX.Hourly.1.Visibility))</visible>
    <label>Sichtweite: $INFO[Window(Weather).Property(MOSMIX.Hourly.1.Visibility)] km</label>
  </control>
  <control type="label">
    <visible>!String.IsEmpty(Window(Weather).Property(MOSMIX.Hourly.1.SolarRadiation))</visible>
    <label>Strahlung: $INFO[Window(Weather).Property(MOSMIX.Hourly.1.SolarRadiation)] W/m²</label>
  </control>
</control>

MOSMIX-Zahlen sind typischerweise ohne Einheit. Einige reguläre Kodi-Properties sind dagegen Strings mit Einheit. Nicht mischen, ohne die Einheitentabelle zu prüfen.

6. MQTT-Statusanzeigen

<control type="label">
  <label>WIS2 Wetter: $INFO[Window(Weather).Property(DWD.WeatherPushStatus)]</label>
</control>
<control type="label">
  <label>WIS2 Warnungen: $INFO[Window(Weather).Property(Alerts.PushStatus)]</label>
</control>
<control type="group">
  <visible>String.IsEqual(Window(Weather).Property(Alerts.PushConnected),true)</visible>
  <control type="label">
    <label>Warnungsstream verbunden</label>
  </control>
</control>

Nicht verwechseln: MQTT connected ≠ Alerts.HasAlerts. Ein erfolgreiches Abonnement sagt nichts über aktive Warnungen.

7. Sichere Bedingungen bei leeren Daten

<visible>!String.IsEmpty(Window(Weather).Property(Hourly.1.Precipitation))</visible>

Ein leerer Niederschlagsprozentsatz ist unbekannt – er ist nicht automatisch 0%. Das gilt ebenso für MOSMIX-Werte, wenn die Station oder das Feld nicht verfügbar ist.

Weiter: Property-Referenz · Wettericons · Skinning-Grundlagen