Tasker: Run a task when a specific bluetooth device loses connection
Create a profile that is active when connected to the Bluetooth device and set up an exit task to run whatever you want when the profile becomes inactive due to the device disconnects.