Glad I could help! For me, (when streaming to the integrated music player with BubbleUPNP) automatic switching works ok.
I am still looking for a more elegant solution though… But it would require Kodi to be able to use multiple audio devices at the same time I guess - any chance?
Otherwise doing it on OS level might be an alternative (as with spotify-connect-web)