Zum Inhalt springen

WetterCubePlus/WetterAmpel/en

Aus WetterCube Wiki
Dies ist die englische Fassung. Zur deutschen Fassung

The WetterAmpel is a standalone Wi-Fi add-on. It queries the WetterCubePlus and shows the temperature as a traffic light using three WS2812B LEDs. The firmware is at WetterAmpel/WetterAmpel.ino.

Display

LED Meaning
Green temperature in the green range (default 15–19 °C)
Yellow temperature in the yellow range (default 20–24 °C)
Red temperature in the red range (default 25–99 °C)
all blink red DWD warning active, not yet acknowledged on the cube
short white flash request to the cube failed (the last color stays on)

You set the ranges in the cube's web interface under Ampel-Konfiguration.

Modes

Under Ampel-Konfiguration → Was die Ampel anzeigt you choose what the LEDs mean. The traffic light itself does not need to be reflashed.

Mode Green Yellow Red
Temperature (default) in the green range in the yellow range in the red range
Pollen (my allergens) none to low load medium to high load strong load
Air quality European AQI up to 40 (good, medium) AQI up to 60 (moderate) AQI above 60 (poor or worse)

In pollen mode the worst of the pollen selected under Meine Allergene counts. A DWD warning makes the light blink in every mode. If data is missing, the light stays off. The WebUI shows next to the color what triggered it (e.g. "Birke (Stufe 2.5 von 3)").

Parts and wiring

Component Type
Microcontroller ESP32-C3 (e.g. Super Mini), Wi-Fi built in
LEDs 3× WS2812B, in series
Power 5 V via USB
Function Connection
WS2812B data (first LED, DIN) GPIO 8
WS2812B VCC 5 V
WS2812B GND GND

The LEDs are wired as a chain (DIN → DOUT → DIN → …): LED 0 green (bottom), LED 1 yellow (middle), LED 2 red (top). A 300–470 Ω resistor in the data line and a 100 µF capacitor between VCC and GND are recommended.

Flashing the firmware

  1. In the configuration block at the top of WetterAmpel.ino, enter your Wi-Fi name, password and the cube's IP (WIFI_SSID, WIFI_PASSWORD, CUBE_HOST).
  2. Upload to the ESP32-C3 with the Arduino IDE (libraries: FastLED and ArduinoJson).
Important: Enter the credentials locally only and never commit them. The repository is public; the repo intentionally contains only placeholders (xxx).

Firmware behavior

  • Polls GET http://<CUBE_HOST>/api/ampel every 30 seconds.
  • If Wi-Fi is gone for more than 2 minutes, the traffic light restarts itself (a plain "reconnect" used to hang on some modules).
  • It also restarts preventively every 24 hours.

Cube API

GET /api/ampel returns, for example:

{
  "temperature": 22.4,
  "data_age_min": 3,
  "dwd_warning": false,
  "active": "yellow",
  "mode": "temperature",
  "detail": "22.4 °C",
  "thresholds": {
    "green":  { "min": 15, "max": 19 },
    "yellow": { "min": 20, "max": 24 },
    "red":    { "min": 25, "max": 99 }
  }
}

mode is temperature, pollen or air, detail describes the current display. data_age_min shows how old the last successful weather fetch is. dwd_warning: true means an active DWD warning that has not yet been acknowledged on the cube by opening the warning map.