diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino index ee3a0b961..5b0d8562d 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino @@ -1428,7 +1428,7 @@ void CmndShutterPosition(void) //override tiltposition if explicit set (shutterbutton) if (Shutter[index].tilt_target_pos_override != -128) { - Shutter[index].tilt_target_pos = Shutter[index].tilt_target_pos_override; + Shutter[index].tilt_target_pos = tmin(tmax( Shutter[index].tilt_config[0],Shutter[index].tilt_target_pos_override ), Shutter[index].tilt_config[1]); Shutter[index].tilt_target_pos_override = -128; } diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino index a763e51e1..18940e681 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino @@ -1343,7 +1343,7 @@ void CmndShutterPosition(void) // manual override of tiltposition if (Shutter[index].tilt_target_pos_override != -128) { - Shutter[index].tilt_target_pos = Shutter[index].tilt_target_pos_override; + Shutter[index].tilt_target_pos = tmin(tmax( Shutter[index].tilt_config[0],Shutter[index].tilt_target_pos_override ), Shutter[index].tilt_config[1]); Shutter[index].tilt_target_pos_override = -128; }