Apologies if this is lengthy: New engine fitted to my lovely E39 530d after breather flaps caused destruction of old one; lovely job but since then my alarm has been going off with no pattern to it. It can be left for days with no problem, then can go off 3 times in one hour! Can be parked up at night and not go off until 4am! I'd park it in town and walk away, it'd go off, I'd return and open and close each door, and the boot, watching the rear view mirror flasher - sometimes it flashes quickly 20 times, sometimes not; sometimes it would go off again, sometimes not. Could NOT work out any door switch to be the culprit or any concrete cause.

Then my brother pointed out I should just lock the car manually and so the alarm won't be engaged. Fine. Then last Sunday came home, parked car - central locking would not engage - checked fuses, all fine. Later my son-in-law drove in the drive and told me my angel eyes were flashing like mad. They were like a police car! (now they have always had this flash thing they do when I turn on ignition - left, right... 5seconds... left, right... don't know if this is standard). So I tried to start the car but battery seemed completely dead. Thought the angel eyes had drained it, so got the jump leads out. Fitted them to battery (but not even connected to other car) and the whole car came alive again! Hasn't happened since. Then yesterday I could NOT get it to start, so I surmised there might be a link, so locked it with the clicker and unlocked again. Started! Must have been the immobiliser engaged itself. Good to know it works.

Any ideas of the problem and a quick fix, or is this a lengthy investigation at labour costs?