Tasker currently has state change to detect Headset Plugged, and BT connect/disconnect.
However recent versions of Android (and some apps e.g. Pocket Casts) provide an ability to show/change audio output without connecting/disconnecting e.g. BT device is connected, can change to internal speaker, or with 2 BT devices connected can switch between them.
Therefore I'd like an event/state change to detect when audio output changes - perhaps with 2 associated variables: audio output (i.e. Speaker/BT/Plugged headset) and device name (to allow trigger only for specific audio output e.g. Car).
I currently do this using logcat entries, however this is device/phone specific