{% extends "base.html" %} {% block title %}{{ display_name.split(',')[0] }} – DWD Wetter{% endblock %} {% block head %} {% endblock %} {% block content %} {# ── Wetterklasse für den Hero-Gradient ─────────────────────────── #} {% if current.icon == "🌧️" %}{% set wclass = "w-rain" %} {% elif current.icon == "❄️" %}{% set wclass = "w-snow" %} {% elif current.icon == "☁️" %}{% set wclass = "w-cloudy" %} {% elif current.icon == "⛅" %}{% set wclass = "w-partcloud" %} {% else %}{% set wclass = "w-clear" %}{% endif %}
{{ display_name.split(',')[0] }} {{ display_name.split(',')[1:3]|join(',') if ',' in display_name else '' }}
{{ current.temp_c if current.temp_c is not none else "–" }}°
{{ current.icon or "☁️" }}
{% if current.wind_kmh is not none %} {{ current.wind_kmh }} km/h {{ wind_dir_name(current.wind_dir) }} {% endif %} {% if current.cloud_pct is not none %} {{ current.cloud_pct }}% Bedeckung {% endif %} {% if current.pressure_hpa is not none %} {{ current.pressure_hpa }} hPa {% endif %}
{% set items = [ ("Gefühlt wie", (current.temp_c|string + " °C") if current.temp_c is not none else "–"), ("Böen", (current.gust_kmh|string + " km/h") if current.gust_kmh is not none else "–"), ("Niederschlag", (current.precip_mm|string + " mm") if (current.precip_mm is not none and current.precip_mm > 0) else ((current.rain_prob|string + " %") if (current.rain_prob is not none and current.rain_prob > 0) else "0 mm")), ("Sonne", (current.sun_min|string + " min/h") if (current.sun_min is not none and current.sun_min > 0) else "–"), ] %} {% for label, val in items %}
{{ val }} {{ label }}
{% endfor %}
📡 Station {{ station_name }} ({{ station_dist }} km) · ID {{ station_id }}

Stundenweise

{% for h in forecast %}
{% if h.datetime is string %}{{ h.datetime[11:16] }} {% else %}{{ h.datetime.strftime('%H:%M') }}{% endif %}
{% if h.datetime is string %}{{ h.datetime[8:10] }}.{{ h.datetime[5:7] }}. {% else %}{{ h.datetime.strftime('%d.%m.') }}{% endif %}
{{ h.icon }}
{% if h.temp_c is not none %}{{ h.temp_c }}°{% else %}–{% endif %}
{% if h.precip_mm and h.precip_mm > 0 %}
{{ h.precip_mm }} mm
{% elif h.rain_prob is not none and h.rain_prob > 0 %}
{{ h.rain_prob }}%
{% else %}
{% endif %} {% if h.wind_kmh is not none %}
{{ h.wind_kmh }}km/h
{% endif %}
{% endfor %}

Temperatur & Niederschlag

48 Stunden

Tagesübersicht

{# calc global min/max for bar scaling – do it in a loop to stay Jinja2-safe #} {% set ns = namespace(g_min=99, g_max=-99) %} {% for d in daily %} {% if d.temp_min is not none and d.temp_min < ns.g_min %}{% set ns.g_min = d.temp_min %}{% endif %} {% if d.temp_max is not none and d.temp_max > ns.g_max %}{% set ns.g_max = d.temp_max %}{% endif %} {% endfor %} {% set g_min = ns.g_min %} {% set g_max = ns.g_max %} {% set g_range = (g_max - g_min) if (g_max - g_min) > 0 else 1 %} {% for d in daily %}
{{ d.icon }}
{% if d.date is string %} {% set y = d.date[:4]|int %}{% set mo = d.date[5:7]|int %}{% set dy = d.date[8:10]|int %} {% set days = ["Mo","Di","Mi","Do","Fr","Sa","So"] %} {{ dy }}.{{ d.date[5:7] }}. {% else %} {{ d.date.strftime('%a') }} {% endif %}
{% if d.temp_min is not none and d.temp_max is not none %} {% set left_pct = ((d.temp_min - g_min) / g_range * 100)|round(1) %} {% set width_pct = ((d.temp_max - d.temp_min) / g_range * 100)|round(1) %}
{% endif %}
{{ d.temp_min }}° {{ d.temp_max }}° {% if d.precip > 0 %} 🌧 {{ d.precip }}mm {% elif d.rain_prob is not none and d.rain_prob > 0 %} 💧 {{ d.rain_prob }}% {% endif %}
{% endfor %}

Alle Daten: Deutscher Wetterdienst – Open Data (MOSMIX)

{% endblock %} {% block scripts %} {% endblock %}