Here im presenting you my simple hack to make Amazon Alexa (Echo Dot 3. Gen) able to switch between it's internal speaker and the 3.5mm input jack.

I wanted to use the Echo as my spotify interface to my hifi amplifier, since it has an 3.5mm audio jack and it is quiet cheap (i paid 17.99€). The only problem is you either have to keep your hifi amplifier on all the time or unplug the 3.5mm Cable each time you turn off the amplifier. Otherwise you won't be able to hear Alexa when your Amplifier is switched off.

Since I'm switiching off my amplifier with a sonoff smart plug and manually unplugging the audio cable each time was not an option for me i needed to find a different solution.

Time to void the warranty. Opening up the echo you see the first pcb thats hosts both, the power and the audio jack. I was looking for some circuitry that generates a logic singal if audio jack i plugged in or not, as described in linked paper from TI.

Unfortunately i didn't find out which chip exactly handles this task. But i found out, that the signal on testpoint TM56 is the signal i was looking for. 

As you can see in the picuters, Logic is the following:

Nothing plugged in --> ~1.56 V (High) Signal.

3.5mm Audio Jack plugged in --> 0V (Low) Signal. 

Cable not plugged in High Signal
Cable plugged in Low Signal

Now i only needed to emulate this signal somehow, to fool alexa. Using Tasmota (Open Source home automation software, to make your microcontrollers smart) flashed on a ESP8266 (Wemos D1 Mini, it perfectly fits) would do the job. Using a simplet 50/50 Voltage devider to bring the 3.3V outputs to an acceptable level i wired up the WEMOS the following. 

My Tasmota Pin Configuration looks like the following:

Pin D4 as inverted Relay, so i switches low when i turn it "on". D2 as LED Output for Debugging. In the Alexa app now i grouped the hifi amplifier and the tasmota switch, so both are switched with one command. 

Wifi reception is good even though its mounted underneath a big aluminium die cast housing.