Last time this happened to me, my idle valve was stuck open. ?I disconnected the power and the idle returned to normal (when warm). ?But on a cold start it wouldn't idle (no surprise really). ?I cleaned the valve with nasty solvent (carb cleaner or the like). ?I think I sprayed some other light lubricant after but I can't recall. ?It is like a small motor that is pulse modulated. ?
I haven't bought a proper spare (yet). ?I tried a super cheap one off AliExpress but it didn't work. ?An OEM is like $400 CAD or something. ?A more legitimate unit is still $200 or so. ?My original still seems to work just fine since the cleaning.
?
Based on your comment, there is also a cold start mode that uses one of temp sensors.
From my notes:
"BLACK or BLUE G62 (Engine Coolant Temp Sensor), a two-wire sensor on the head fitting that signals the ECM (it's critical to helping the ECM set correct timing and mixture, but is not part of cooling system). (See Bentley Vol 1, page C 19-7; also see Bentley Vol 2, page X-215.) "