Bluetooth speaker and fallback to 'internal' speaker



I managed to set up Mopidy to use an external bluetooth speaker (Sony SRS-X77).
But now I want to add a fallback option, that if the bluetooth speaker is not connected Mopidy routes audio to the Phat Beat DAC (say internal speaker) of my pi.
Any hints how to do this?

Bluetooth config set up with bluealsa (
output = alsasink device=btspeaker
mixer_volume = 30

pcm.btspeaker {
type plug
slave.pcm {
type bluealsa
device “5C:93:A2:8B:EE:81”
profile “a2dp”
hint {
show on
description “SRS-X77”

Before using the bluetooth speaker I was using a Phat Beat DAC with the following config (
mixer = software
mixer_volume = 35
output = autoaudiosink
enabled = true
enabled = true
card = 0
control = PCM

The task sounds easy: If not connected to bluetooth speaker -> use Phat Beat DAC.
I would really appreciate if someone knows how to do this.

The ‘project’ behind this question is to realize a Phoniebox with bluetooth output and internal speaker fallback.