Skip to content

Releases: shailensobhee/ESPSomfy-RTS

3.2.0

25 Apr 19:10
e0de2c9

Choose a tag to compare

Summary

  • Merges 8 commits from cjkas/ESPSomfy-RTS up to upstream v3.0.13 (RTW decoder fix, /controller chunked streaming, login UX)
  • Bumps version to v3.2.0 across appversion, FW_VERSION, and asset cache-bust strings
  • Preserves all our HCSR04 distance-sensor work and shailensobhee SSDP branding

Upstream commits taken

26400c5 — Fix off-by-one bug in RTW protocol decoder

  • src/Somfy.cpp:177 — replaces special-case cmd = encKey == 133 ? My : (encKey - 133) with the symmetric inverse of the encoder (encKey - 132). Old formula decoded every non-My RTW command one slot too low (Up read as My, Down as MyUp).
  • src/Somfy.h:192 — adds uint8_t rawCmd to somfy_frame_t so the raw command nibble (decoded[1] >> 4) is preserved before any protocol-classification rewriting of cmd.
  • src/Somfy.cpp:164-165 — populate rawCmd in decodeFrame.
  • src/Somfy.cpp:4434-4437 — new ESP_LOGI on every valid RX showing ADDR / CMD / RAW_CMD / KEY / PROTO.
  • src/Somfy.cpp:4451 — emit rawCmd in the WebSocket frame event.
  • data-src/index.html:1030 — adds Raw header span to the frame log.
  • data-src/index.js:2956-2957 — render rawCmd as uppercase hex (0x{N}); blank if older firmware.
  • data-src/main.css:835-839 — sizes and centers the new column.

6365f16 — Memory-bounded streaming builder for /controller

  • src/WResp.h:55-60, src/WResp.cpp — new BufferedJsonFormatter subclass of JsonFormatter writing into a caller-supplied fixed buffer.
  • src/Web.cpp:428 — new ControllerChunker class owning a 3072-byte buffer; produces the /controller JSON one section at a time (HEADER → ROOMS → SHADES → GROUPS → REPEATERS → DONE).
  • src/Web.cpp:699-700handleController rewritten to drive the chunker via request->beginChunkedResponse(...). Eliminates the OOM hit that affected users with many shades/groups.

4f7fa73 — Login UX

  • data-src/login.html — wraps login in a real <form>; tags inputs with autocomplete="username" / "current-password" so password managers work.
  • data-src/index.js:1260-1262 — on successful login, store the credential via new PasswordCredential(...) + navigator.credentials.store(...) when the API is available.
  • appversion fetch is now properly awaited so the version string in the UI no longer flashes the placeholder.

Marker / merge commits

  • 5c90715 — merge of PR cjkas#24 (RTW decoder)
  • f51e90b — chore: bump v3.0.12
  • 15e7dd1 — merge of PR cjkas#25 (controller streaming)
  • 6f856ff — merge of PR cjkas#26 (login UX)
  • 3ba27ad — chore: bump v3.0.13

What we kept over upstream

  • FW_VERSION / appversion / cache-bust strings → v3.2.0 (intentionally ahead of upstream's v3.0.13)
  • src/ESPNetwork.cpp:323-332 SSDP fields → kept the shailensobhee branding from 74d126c (no conflict — upstream didn't touch those lines after our fork point)
  • Somfy noise-detection thresholds from 305a4b2 — unchanged (upstream only reworded the comment)

What was preserved on our side through the merge

  • Full HC-SR04 sensor stack: src/HCSR04.cpp/.h, HCSR04Settings on ConfigSettings, MQTT/SomfyController wiring, /hcsr04settings + /connecthcsr04 + /discovery routes, Sensors tab with live distance via WebSocket distance event

Conflict resolutions in merge commit 4969720

  • data-src/appversion, src/ConfigSettings.h, data-src/index.html (×2), data-src/index.js (×2): version-string conflicts — kept ours (re-bumped to v3.2.0 here)
  • src/Web.cpp include block: took both#include ""HCSR04.h"" (ours) plus #include <memory> (upstream needs it for std::make_shared<ControllerChunker> at Web.cpp:699)

Build status

  • pio run -e esp32c6 succeeded — RAM 27.6%, Flash 38.9%
  • ✅ Firmware + LittleFS flashed to ESP32-C6 (XIAO), boots and serves UI

Test plan

  • Build for esp32c6 (no errors)
  • Flash firmware + filesystem
  • Web UI shows version v3.2.0
  • HC-SR04 distance live-updates every second on Sensors tab
  • Frame Log shows new Raw column populated with 0x{N} hex on Somfy RX
  • RTW remote (if available): non-My commands decode correctly (Up = Up, Down = Down, not the off-by-one mappings)
  • /controller endpoint loads (chunked streaming) with shades populated
  • Logout/login: browser offers to save credentials via PasswordCredential API
  • No regressions in shade control, groups, MQTT discovery

🤖 Claude, Shailen and my friend cjkas - also helped by the same Claude - improved this code and made it robust!

3.1.0

18 Apr 16:03

Choose a tag to compare

Updated firmware to incorporate the HC-SR04 distance sensor, in order to natively track the % that an awning (Marquise) is open/closed.
This is a non-breaking change. If someone does not have the sensor, the firmware behaves as usual. The sensor integration is also independent and does not interfere with the RTS-side of the firmware.

3.0.11

11 Apr 21:52

Choose a tag to compare

  1. Fixed Watchdog errors esp_task_wdt_reset(707): task not found.
  2. Implemented picking app version dynamically from the appversion file, as opposed to hard-coding in the scripts.

Full Changelog: v3.0.7...v3.0.11