Revise README for version 6.2.0 updates

Updated README for version 6.2.0, fixing DST handling and enhancing features.
This commit is contained in:
2026-03-29 17:45:10 +02:00
committed by GitHub
parent 8543493ac0
commit 13da0e0c87
+77 -34
View File
@@ -11,18 +11,61 @@ This project is an ArduinoIDEfriendly firmware for the **Seeed XIAO ESP32
- Uses a white LED and an optional presence sensor to give quick visual feedback. - Uses a white LED and an optional presence sensor to give quick visual feedback.
- Stores daily price data in **NVS** to survive reboots and reduce API calls. - Stores daily price data in **NVS** to survive reboots and reduce API calls.
The latest sketch implements **Version 6.1.2**, focusing on: The latest sketch implements **Version 6.2.0**, focusing on:
- **Version 6.2.0 FIX**: **DST (Daylight Saving Time) handling fully fixed** the ticker now works correctly on ALL days including DST switch days (spring forward and fall back). Uses timestamp-based price lookups instead of arithmetic calculations.
- Version 6.1.2 fix: restore correct **white LED indicator** behavior (ESP32 PWM fix; no dim glow when off). - Version 6.1.2 fix: restore correct **white LED indicator** behavior (ESP32 PWM fix; no dim glow when off).
- Version 6.1.1 fix: Correct daily **low/high hourly markers** (now includes negative and **0.0** prices). - Version 6.1.1 fix: Correct daily **low/high hourly markers** (now includes negative and **0.0** prices).
- Daily (not hourly) API fetching. - Daily (not hourly) API fetching.
- Robust **NVS storage** of daily price data. - Robust **NVS storage** of daily price data.
- Correct **CET/CEST** handling. - Correct **CET/CEST** handling.
- Resilient **aftermidnight refresh** (no more getting stuck on No data for today). - Resilient **aftermidnight refresh** (no more getting stuck on "No data for today").
- Preserved UI and button behavior from v5.5. - Preserved UI and button behavior from v5.5.
--- ---
## DST (Daylight Saving Time) How It Works
### v6.2.0: Fully DST-Safe
**Important**: Starting with v6.2.0, the ticker is **fully DST-safe** and requires **no manual intervention** on DST switch days.
The firmware uses **timestamp-based price lookups** that work correctly regardless of whether the day has 23, 24, or 25 hours:
| Day Type | Hours in Day | Price Entries | Status |
|----------|-------------|---------------|--------|
| Normal | 24 | 96 | ✅ Works |
| Spring forward (March) | 23 | 92 | ✅ Works (fixed in v6.2.0) |
| Fall back (October) | 25 | 100 | ✅ Works (fixed in v6.2.0) |
### Timezone Configuration
The firmware uses the `TZ_CET_CEST` timezone string for displaying local time:
```cpp
const char* TZ_CET_CEST = "CET-1CEST,M3.5.0/02:00,M10.5.0/03:00";
```
**Current behavior:**
- Spring forward: Last Sunday of March at 02:00 → 03:00 (CEST, UTC+2)
- Fall back: Last Sunday of October at 03:00 → 02:00 (CET, UTC+1)
### Future-Proof: If EU Cancels DST
If the EU parliament ever cancels DST switching, you only need to update **one line of code**:
```cpp
// Option A - Stay on CET (UTC+1, winter time) permanently:
const char* TZ_CET_CEST = "CET-1";
// Option B - Stay on CEST (UTC+2, summer time) permanently:
const char* TZ_CET_CEST = "CEST-2";
```
The rest of the code works unchanged because it uses timestamp-based lookups.
---
## Bidding Zones (BZN) / Region Selection ## Bidding Zones (BZN) / Region Selection
The firmware currently uses: The firmware currently uses:
@@ -118,11 +161,12 @@ Typical pins used in the sketch:
**Connections:** **Connections:**
- **LCD backpack XIAO ESP32C3** | LCD Backpack | XIAO ESP32C3 |
- `VCC`**5V** (or 3V3 if your module explicitly supports 3.3V I²C) |-------------|---------------|
- `GND`**GND** | VCC | 5V |
- `SDA` → board I²C SDA pin (see XIAO ESP32C3 documentation) | GND | GND |
- `SCL` → board I²C SCL pin | SDA | I²C SDA |
| SCL | I²C SCL |
> Note: On many XIAO ESP32C3 board definitions, SDA/SCL are mapped internally. Just use the default I²C pins as documented by Seeed. > Note: On many XIAO ESP32C3 board definitions, SDA/SCL are mapped internally. Just use the default I²C pins as documented by Seeed.
@@ -187,12 +231,14 @@ The presence sensor is used to control LCD backlight and LEDs to save power and
Recommended module: **RCWL0516** microwave motion sensor. Recommended module: **RCWL0516** microwave motion sensor.
**Wiring (from the v5.5 header, preserved in v6.x):** **Wiring:**
- `VCC`**3.3V** | RCWL0516 | Connection |
- `GND`**GND** |-----------|------------|
- `OUT``GPIO 9` (`presencePin`) | VCC | 3.3V |
- **Required**: 10 kΩ pulldown resistor between `GPIO 9` and `GND`. | GND | GND |
| OUT | GPIO 9 (`presencePin`) |
| **Required**: 10kΩ pulldown | Between GPIO 9 and GND |
Characteristics: Characteristics:
@@ -240,23 +286,16 @@ The LED is driven with various patterns to indicate price level; see “LED Pric
--- ---
## Firmware Features (v6.1.2) ## Firmware Features (v6.2.0)
### Core Display & Pricing ### Core Display & Pricing
- Data source: - Data source: `https://api.energy-charts.info/price?bzn=SI`
- Resolution: 15minute intervals with hourly averages
```text - Display shows:
https://api.energy-charts.info/price?bzn=SI - **Row 0**: Current hour, four 15minute values
``` - **Rows 13**: Current hour + next two hours as hourly averages
- Price calculation: Raw MWh → EUR/kWh with configurable surcharges (power company fee + VAT)
- Resolution:
- Prices in **15minute intervals** (`price[]`, `unix_seconds[]`).
- Display shows:
- **Row 0**: Current hour, four 15minute values in compact format (`XX XX XX XX`).
- **Rows 13**: Current hour + next two hours as hourly averages.
- Price calculation:
- Raw MWh prices are converted to **EUR/kWh**.
- Two configurable surcharges: - Two configurable surcharges:
- `POWER_COMPANY_FEE_PERCENTAGE` (default `12.0` %). - `POWER_COMPANY_FEE_PERCENTAGE` (default `12.0` %).
- `VAT_PERCENTAGE` (default `22.0` %). - `VAT_PERCENTAGE` (default `22.0` %).
@@ -271,14 +310,17 @@ The LED is driven with various patterns to indicate price level; see “LED Pric
The white LED (GPIO 5) reflects the **current 15minute interval** price: The white LED (GPIO 5) reflects the **current 15minute interval** price:
- Very cheap (`<= 0.05 EUR/kWh`) → smooth breathing. | Price Level | LED Behavior |
- Cheap / normal → steady on. |-------------|--------------|
- Moderately expensive → slow blink. | Negative / no data | LED off |
- Expensive → faster blink. | ≤ 0.05 EUR/kWh | Smooth breathing |
- Very expensive → complex “doubleblink with long on” pattern. | 0.05 0.15 | Steady on |
- Negative price or no data → LED off. | 0.15 0.25 | Slow blink |
| 0.25 0.35 | Fast blink |
| 0.35 0.50 | Double blink |
| > 0.50 | Triple blink pattern |
**Important implementation note (v6.1.2):** **Important implementation note (from v6.1.2 on):**
- On ESP32, avoid mixing PWM (`analogWrite`) and `digitalWrite` on the same LED pin. - On ESP32, avoid mixing PWM (`analogWrite`) and `digitalWrite` on the same LED pin.
- The firmware now uses `analogWrite(pin, 0/255)` consistently to guarantee the LED is fully off when gated off. - The firmware now uses `analogWrite(pin, 0/255)` consistently to guarantee the LED is fully off when gated off.
@@ -553,7 +595,7 @@ If NVS does not contain valid WiFi credentials, or if connecting fails repeat
- `DNSServer` (from ESP32 core) - `DNSServer` (from ESP32 core)
- `WebServer` (from ESP32 core) - `WebServer` (from ESP32 core)
- `Preferences` (builtin for ESP32) - `Preferences` (builtin for ESP32)
3. Open the v6.1 `.ino` file (e.g. `20260130_electricity_ticker_6_1_nvs_daily_fetch.ino`). 3. Open the v6.2.0 `.ino` file (e.g. `ESP32_standalone_electricity_ticker_6_1_2_nvs_daily_fetch.ino`).
4. In Tools: 4. In Tools:
- Board: `Seeed XIAO ESP32C3` - Board: `Seeed XIAO ESP32C3`
- Port: choose the correct serial port. - Port: choose the correct serial port.
@@ -569,6 +611,7 @@ If NVS does not contain valid WiFi credentials, or if connecting fails repeat
## Versioning & Changelog ## Versioning & Changelog
- **v6.2.0** DST handling fully fixed via timestamp-based lookups
- **v6.1.2** LED indicator restored (broken in previous version): - **v6.1.2** LED indicator restored (broken in previous version):
- Avoid mixing PWM and `digitalWrite` on the same LED pin (ESP32 LEDC behavior). - Avoid mixing PWM and `digitalWrite` on the same LED pin (ESP32 LEDC behavior).
- Ensures LED is fully off when gated off; patterns operate correctly. - Ensures LED is fully off when gated off; patterns operate correctly.