Great post. It helped me set up the same thing on a Raspberry Pi. I enhanced your script a little so it no longer contains any ‘hard coded’ Bluetooth address nor volume levels. Instead, you specify these as part of the media player config in HA, and they are passed in to the script by HA.
You can see it on this thread:
https://community.home-assistant.io/t/tts-on-bluetooth-speaker-via-raspberry-pi/