The best would be to switch here automatically between the "Audio Profile swicher" profiles (more saved options in the profile1.json like video resolution, etc)!
Hope anybody here can light me up!
I have something like that going on. It's based on this.
My version of 99-btautoconnect.rules in storage/.config/udev.rules.d (trying a few BT receivers / headphones as you can see):
ACTION=="remove", SUBSYSTEMS=="input", ATTRS{name}=="00:11:67:85:63:60", RUN+="/storage/.kodi/userdata/favourites/scripts/audioscripts/switchtoHDMIprofile.sh"
ACTION=="add", SUBSYSTEMS=="input", ATTRS{name}=="00:11:67:85:63:60", RUN+="/storage/.kodi/userdata/favourites/scripts/audioscripts/switchtobluetoothprofile.sh"
ACTION=="remove", SUBSYSTEMS=="input", ATTRS{name}=="00:1F:81:08:25:AB", RUN+="/storage/.kodi/userdata/favourites/scripts/audioscripts/switchtoHDMIprofile.sh"
ACTION=="add", SUBSYSTEMS=="input", ATTRS{name}=="00:1F:81:08:25:AB", RUN+="/storage/.kodi/userdata/favourites/scripts/audioscripts/switchtobluetoothprofile.sh"
ACTION=="remove", SUBSYSTEMS=="input", ATTRS{name}=="E8:28:AB:12:83:30", RUN+="/storage/.kodi/userdata/favourites/scripts/audioscripts/switchtoHDMIprofile.sh"
ACTION=="add", SUBSYSTEMS=="input", ATTRS{name}=="E8:28:AB:12:83:30", RUN+="/storage/.kodi/userdata/favourites/scripts/audioscripts/switchtobluetoothprofile.sh"
ACTION=="remove", SUBSYSTEMS=="input", ATTRS{name}=="E8:28:AB:12:86:21", RUN+="/storage/.kodi/userdata/favourites/scripts/audioscripts/switchtoHDMIprofile.sh"
ACTION=="add", SUBSYSTEMS=="input", ATTRS{name}=="E8:28:AB:12:86:21", RUN+="/storage/.kodi/userdata/favourites/scripts/audioscripts/switchtobluetoothprofile.sh"
ACTION=="remove", SUBSYSTEMS=="input", ATTRS{name}=="CD:63:90:94:A0:AA", RUN+="/storage/.kodi/userdata/favourites/scripts/audioscripts/switchtoHDMIprofile.sh"
ACTION=="add", SUBSYSTEMS=="input", ATTRS{name}=="CD:63:90:94:A0:AA", RUN+="/storage/.kodi/userdata/favourites/scripts/audioscripts/switchtobluetoothprofile.sh"
So I'm using those to start one of two shell scripts...
switchtoHDMIprofile.sh:
#!/bin/sh
/usr/bin/kodi-send --action="RunScript(script.audio.profiles,1)"
switch to bluetoothprofile.sh:
#!/bin/sh
/usr/bin/kodi-send --action="RunScript(script.audio.profiles,2)"
Obviously my shell script locations won't work for you - just edit 99-btautoconnect.rules to point to wherever you want to stick them, add your MAC address(es), and change the audioprofile in the shell script to the required one for BT / TV.