From c88d36997fe5876eed2b159e7b8b7718902276c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Metrich?= Date: Sat, 4 Jul 2026 16:31:23 +0200 Subject: [PATCH] Always send Up/Down at hard-stop positions for recalibration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit moveToTarget() silently dropped commands when pos == currentPos, which prevented position recalibration via slider, MQTT, or Home Assistant when the shade was already at 0% or 100%. Physical end-stops are ground truth — always send the command so the motor can jog to the hard stop and self-correct any position drift. Co-Authored-By: Claude Sonnet 4.6 --- Somfy.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Somfy.cpp b/Somfy.cpp index c2e09c3..18f9693 100644 --- a/Somfy.cpp +++ b/Somfy.cpp @@ -3833,6 +3833,10 @@ void SomfyShade::moveToTarget(float pos, float tilt) cmd = somfy_commands::Up; else if (pos > this->currentPos) cmd = somfy_commands::Down; + else if (pos == 0.0f) + cmd = somfy_commands::Up; // Hard stop: always send to allow position recalibration + else if (pos == 100.0f) + cmd = somfy_commands::Down; // Hard stop: always send to allow position recalibration else if (tilt >= 0 && tilt < this->currentTiltPos) cmd = somfy_commands::Up; else if (tilt >= 0 && tilt > this->currentTiltPos)