Skip to content

Commit f9df89e

Browse files
Change calibration gesture from double-click to 7 quick presses
Auto-calibration drives the window through full travel, so the trigger must be hard to hit accidentally. The 3-10s Wi-Fi wipe hold on the same button is unchanged; timings still cannot overlap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent fafe4c7 commit f9df89e

3 files changed

Lines changed: 33 additions & 10 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ sensor). Local/branch builds report `dev`.
99
This project adheres to [Semantic Versioning](https://semver.org/) and the
1010
format is based on [Keep a Changelog](https://keepachangelog.com/).
1111

12+
## [Unreleased]
13+
14+
### Changed
15+
- **Calibration button gesture: double-click → 7 quick presses** (GPIO21).
16+
Auto-calibration drives the window through its full travel, so the trigger
17+
is now deliberately hard to hit by accident; a stray double-tap no longer
18+
starts it. The 3–10 s hold (Wi-Fi credential wipe) on the same button is
19+
unchanged, and the two timings still cannot overlap.
20+
1221
## [2.0.0] - 2026-07-22
1322

1423
Major architectural change: the firmware is now built on the shared

‎firmware/esphome/Glasscalibur-auto-calibrate.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ Entities/IDs added:
9696
the old `cal_travel_timeout: 90s` expired mid-travel and failed every
9797
healthy probe. Each travel instead arms `cal_t0_ms`/`cal_budget_ms` from
9898
the live speed (nominal × 1.5 + 10 s).
99-
- Triggers: GPIO21 **double-click** (on_multi_click, presses ≤0.6 s; the
100-
3–10 s hold on the same pin is Wi-Fi credential wipe — different timing,
99+
- Triggers: GPIO21 **7 quick presses** (on_multi_click, presses ≤0.6 s each —
100+
deliberately hard to hit by accident, since calibration drives full travel;
101+
the 3–10 s hold on the same pin is Wi-Fi credential wipe — different timing,
101102
must not overlap); Button 1 single-click **aborts** a running calibration
102103
(also restores irun 19 and the saved vibration threshold); Button 1
103104
double-click, the time schedules, the sun schedule, and the tamper check
@@ -202,7 +203,7 @@ Entities/IDs added:
202203
stall during release just stops. Release must exist in BOTH stall paths.
203204
9. **NAN temperature = refuse**, in the cal gate and any future thermal
204205
logic. Sensor absent means protection absent.
205-
10. **GPIO21 gestures must not overlap:** double-click (≤0.6 s presses) =
206+
10. **GPIO21 gestures must not overlap:** 7 quick presses (≤0.6 s each) =
206207
calibrate; 3–10 s hold = Wi-Fi wipe.
207208
11. **Limit-switch presses are direction-gated.** A switch press acts
208209
(resync position + stop) only when travel is toward that switch or the

‎firmware/esphome/glasscalibur-product.yaml‎

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# GPIO8 : ENN (TMC2209 enable, active low)
3232
# GPIO14 : DIAG (TMC2209 StallGuard / fault output -> on_stall)
3333
# GPIO15 : Open-end limit switch (active low, polled)
34-
# GPIO21 : Calibration / Wi-Fi Reset button (active low; double-click =
34+
# GPIO21 : Calibration / Wi-Fi Reset button (active low; 7 quick presses =
3535
# auto-calibrate, hold 3-10 s to clear Wi-Fi creds — the timings
3636
# must never overlap)
3737
# GPIO19 : I2C SDA
@@ -81,7 +81,7 @@
8181
# IDLE -> close the cover
8282
# - Double click : open the cover (ignored while calibrating)
8383
# Calibration / WiFi Reset (GPIO21):
84-
# - Double click : start auto-calibration (see the auto_calibrate script)
84+
# - 7 quick clicks: start auto-calibration (see the auto_calibrate script)
8585
# - Hold 3-10 s : clear saved Wi-Fi credentials and reboot into setup
8686
#
8787
# -----------------------------------------------------------------------------
@@ -793,17 +793,20 @@ binary_sensor:
793793
- logger.log: "LIMIT 2 blip while opening - ignored"
794794

795795
# Calibration / WiFi Reset (GPIO21) — two gestures, non-overlapping timings:
796-
# * Double-click (presses ≤ 0.6 s each) -> start auto-calibration. The
797-
# script announces itself (3 beeps + 2 s) before any motion and refuses
798-
# if the device is busy, tampered, or the motor is hot.
796+
# * 7 quick presses (each ≤ 0.6 s) -> start auto-calibration. Seven is
797+
# deliberate: calibration drives the window through its full travel, so
798+
# the trigger must be impossible to hit accidentally (a stray
799+
# double-tap used to be enough). The script still announces itself
800+
# (3 beeps + 2 s) before any motion and refuses if the device is busy,
801+
# tampered, or the motor is hot.
799802
# * Hold 3-10 s -> erase saved Wi-Fi credentials and reboot into setup
800803
# mode. A long hold is required (not a quick tap) so the device can't
801804
# be knocked offline by an accidental press. On reboot the device
802805
# re-runs Wi-Fi setup: with no credentials saved (and none compiled
803806
# into the firmware), it broadcasts the "glasscalibur-XXXXXX" hotspot /
804807
# captive portal so a new network can be entered (Improv over USB
805808
# serial works too).
806-
# A double-click press can never satisfy the 3 s minimum hold, so the two
809+
# A calibration press can never satisfy the 3 s minimum hold, so the two
807810
# gestures cannot both fire from one input.
808811
- platform: gpio
809812
name: WiFi Reset
@@ -819,12 +822,22 @@ binary_sensor:
819822
- delayed_on: 10ms
820823
on_multi_click:
821824
- timing:
825+
- ON for at most 0.6s
826+
- OFF for at most 0.4s
827+
- ON for at most 0.6s
828+
- OFF for at most 0.4s
829+
- ON for at most 0.6s
830+
- OFF for at most 0.4s
831+
- ON for at most 0.6s
832+
- OFF for at most 0.4s
833+
- ON for at most 0.6s
834+
- OFF for at most 0.4s
822835
- ON for at most 0.6s
823836
- OFF for at most 0.4s
824837
- ON for at most 0.6s
825838
- OFF for at least 0.3s
826839
then:
827-
- logger.log: "CAL: requested via calibration button double-click"
840+
- logger.log: "CAL: requested via calibration button (7 presses)"
828841
- script.execute: auto_calibrate
829842
on_click:
830843
- min_length: 3000ms

0 commit comments

Comments
 (0)