Lights on/off at Random

 The Battery 

Battery condition is critical to the operation of the car as many functions - ignition, steering, sliding doors, air conditioning all rely on the battery being up to scratch.  The negative is connected to earth.

A battery can go flat in a short time if it has gone low capacity or there is a discharge through a fault on the car.

More than once, it has been found that headlights go on and off (despite being switched off) and other funnies occur - which quickly drains the battery.

this may be caused by water in the electrics: especially the BSI which is the unit carrying fuses in the left glove-box.

This can occur if the under-bonnet fusebox lid is loose or missing.  If water gets into this fusebox it can run down into the sensitive BSI and give unexpected results.

This shows the fuse box cover removed; make certain it is properly located and clipped.  One owner has found the cover distorted so it wouldn't clip on securely

If this lid is not replaced properly, WATER CAN GET INTO THE FUSEBOX and can drain down into the FUSEBOX IN THE GLOVE LOCKER with dire results.  Locate the lid in position and press down hard until the clip at the right hand edge clicks into place.

Lights turn on at Random

Although this thread applies to the 206, the 1007 is very similar:  see here