These instructions apply to the Mercedes GLA Mk2 (H247) 2020-Present.
For other models, please choose your vehicle here.
If the panoramic sunroof on your Mercedes-Benz GLA (H247, 2020–present) stops auto-closing, won’t tilt properly, or behaves oddly after the battery was disconnected or went flat, it needs re-initialising. The roof motor has lost its learned positions; re-teaching them takes under a minute with the roof switch. This is a normal built-in function rather than a fault — the roof simply needs to relearn where its fully closed, tilted and open stops are, and the car gives you a manual way to do exactly that from the driver’s seat.

Why the Sunroof Needs Re-initialising
The sunroof controller stores its tilt, open and closed limits so it can run on a single touch and auto-reverse the instant it senses an obstruction in the opening. Those learned end-stops live in volatile memory. The moment the roof loses power — a flat 12 volt battery, a battery swap, a blown fuse, or a disconnect during other work — that memory is wiped. Until you teach the positions back, the motor no longer trusts where the glass is: one-touch open and close drop out, the roof may only creep while you hold the switch, and the anti-trap safety function can be disabled. Re-initialising simply drives the roof to its physical limits under your control so the controller can re-measure and store them.
Before You Start
- Park somewhere sheltered — the roof will cycle through open and tilt positions, so avoid doing this in rain or a car wash.
- Switch the ignition on (engine running or in accessory mode is fine); the roof will not initialise without power at the switch.
- Make sure the 12 volt battery is healthy — a weak battery is the most common reason the cycle stalls part-way.
- Check the roof track and seal are clear of leaves, grit or ice that could stop the glass reaching its true end-stop.
- Keep hands, hair and objects clear of the opening throughout — during the learn cycle the anti-trap protection is not active.
How to Re-initialise the Sunroof
- Switch the ignition on.
- Make sure the sunroof and sunshade are closed.
- Press and hold the close switch (push it to the close position). The roof will move slightly — keep holding.
- The roof runs through its full close/tilt cycle automatically; keep the switch held until it finishes.
- Release — the system is reset and one-touch works again.
If It Doesn’t Complete
- Don’t release early. The most common mistake is letting go the moment the glass moves — hold the switch through the entire open, tilt and close sequence until the roof settles on its own.
- Clear any obstruction in the roof track or seal, then try again from fully closed.
- Confirm the battery is up to charge. If the voltage sags mid-cycle the controller aborts the learn; charge the battery or run the engine and repeat.
- Check the sunroof fuse if the switch does nothing at all — a blown fuse will leave the roof completely dead rather than just uninitialised.
- If the roof still refuses to run its full cycle after several clean attempts, a motor or switch fault may need diagnosis rather than a simple relearn.
What to Expect Afterwards
Once the cycle finishes and you release the switch, one-touch open and close should return immediately, along with the auto-reverse anti-trap protection. Test it: tap the switch once to open fully, once to close fully, and confirm the glass stops cleanly at each end without you holding the button. If everything moves in one press, the positions are relearned and no further action is needed.
Frequently Asked Questions
Why did my GLA sunroof stop auto-closing?
A battery disconnect or flat battery wiped the roof controller’s learned limits, so it no longer knows where the closed and tilt positions are. Until you re-initialise it, one-touch and auto-reverse stay disabled and the glass may only move while you hold the switch.
How do I reset the Mercedes GLA sunroof?
With the roof and sunshade fully closed and the ignition on, press and hold the close switch. Keep it held as the roof runs through its full close and tilt cycle, then release once it settles. One-touch operation is restored at that point.
Is it safe to do myself?
Yes — it needs no tools and no under-car work. The only caution is that the anti-trap protection is inactive during the learn cycle, so keep hands, hair and loose objects well clear of the opening until the roof has finished moving and you have released the switch.
Do I need a tool or a workshop?
No. The procedure is done entirely with the factory sunroof switch and takes under a minute, so there is no need for a diagnostic tool or a dealer visit unless the roof has an actual motor, fuse or switch fault that stops it cycling at all.
Do I have to re-initialise every time I start the car?
No. Once the positions are relearned they are stored and stay put through normal use. You only need to repeat this after the roof loses power again — typically a flat battery, a battery replacement, or a disconnect during other electrical work.
The roof only moves while I hold the switch — is that normal?
That creep-while-held behaviour is exactly the symptom of a roof that has lost its stored limits. It is the car’s fallback mode. Completing the hold-and-release initialise cycle restores full one-touch movement, so it should not persist once the relearn is done properly.
Re-initialised the sunroof after a battery change? Re-teach the windows too — see our GLA window guide. For warning lights, look up the code on autodtcs.com.
Independent guide — not affiliated with Mercedes. Always follow your official service manual and safety precautions. Read our full disclaimer.