When I use the spotify app on my phone while also logged into spotify on my pc I can use my phone as remote while the music is outputted on my laptop. I want to do the same with my raspbian running mopidy. I can already play music via the ncmpcpp aplication so that is working properly. But if I start my spotify on my phone/laptop then I don’t see the raspberry pi as a device to play my music on.
I am properly logged in on my mopidy since when I play a song on my laptop the music stops on my mopidy with the notion that spotify is paused since my account is used elsewhere.
Has anyone an idea how to set mopidy up such that this will work?
This feature of Spotify is called “Spotify Connect”. Unfortunately Spotify stopped developing libspotify (the underlying library that mopidy-spotify uses) a long time ago, well before they came up with Spotify Connect. Spotify Connect functionality is therefore not available in mopidy-spotify. Ideally Spotify would release a new version of libspotify but they have shown absolutely no interest in doing so.
However, you could have a look at running https://github.com/Fornoth/spotify-connect-web alongside Mopidy. This is an entirely separate program that allows you to play Spotify music on your Raspberry Pi and control it with the native Spotify apps via Spotify Connect. Note that spotify-connect-web won’t do anything to help you control Mopidy through native Spotify apps due to the reason I explained above. I’ve never used spotify-connect-web myself and it looks tricky to set up so it might depend on how keen you are, You’ll also probably run into the issue that both Mopidy and spotidy-connect-web will both be trying to use the same sound device but you should be able to define an alsa dmix device so they can share it. Good luck!