I'm building a project where I would have both a bluetooth receiver and an aux in line connected to the same speaker. One way could be to detect the presence of jack inserted in the aux in connector and to switch off the bluetooth module. I read this question How does an audio jack detect when a speaker is plugged in? and it seems that there is not an automatic electronic circuit to achieve this, but only manual or patented solutions. Do you have any suggestion?
Many 3.5 mm jacks include switches that are operated when plug is inserted in the jack. The most common use of the switches is on a headphone jack, to disconnect internal speakers when headphones are plugged in. Such a jack could be used to disconnect your internal BlueTooth source when an external source is plugged in. (no electronics involved, just mechanical switches in the jack.)