For the 2002 model year (from 9/01/2001 production), BMWs came standard with automatic headlights. 5 components need to be installed or replaced to bring this functionality to older BMWs. This video details the steps that must be completed in order to retrofit automatic headlights. The car used in this video is February, 2000 production BMW E39 M5.
LCM Coding and Programming @ 3:09: https://www.youtube.com/watch?v=GMgBdmapCYk
Parts:
Automatic Headlight Switch: 61316909779
Automatic Headlight Switch Bezel: 61316909780
Rain Light Sensor: 61356923954
LCM (Light Control Module) IIIB
RLS (Rain Light Sensor) Prism Kit: http://automotivedesigngroup.com/catalog/i100.html
RLS (Rain Light Sensor) Pad: http://automotivedesigngroup.com/catalog/i114.html
E39Source website: http://www.e39source.com
Help support E39Source by donating: http://www.e39source.com/donate