the bonnet switch closes to earth when the bonnet is opened so you can splice into the purple/orange wire from the switch with one side of a relay's coil through a blocking diode, the other side of the coil to live and the feed to the lights through the relay's contact, simple as that, the blocking diode between the relay's coil and the purple wire from the bonnet switch is to be 100% on the safe side as to isolate the backfeed through the coil to BCU or some signal from the BCU to the relay, then nothing bad can happen and it will be automatic