Thank you for the information,
There can be a number of causes of cramps of the legs while sleeping.
Dehydration, deficiency of calcium, magnesium, potassium, sodium-electrolytes, vitamins , muscle fatigue etc. can cause cramps.
Peripheral artery disease causing circulation abnormalities also can cause muscle spasm.
Systemic diseases like diabetes, low thyroid, Parkinson's disease, liver disorder like cirrhosis, kidney disease, alcoholism & others can be associated with it.
Sometimes no cause can be apparent too & can be difficult to treat.
You have tried some home measures-
Please take plenty of fluid, fruits, vegetables etc.
If you take coffee, alcohol, tobacco
etc. you can avoid those.
Stretching, warm bath can be taken.
Regular exercise or a walk daily can be helpful
Sometimes muscle relaxants are prescribed.
You can discuss with your doctor whether it will be suitable for you.
I hope this information helps.
I will be happy to assist, if you need any clarification.
Please feel free for any follow up query.