there are alot of questions already around this issue, but none seem to solve my problem, i am running OH 2.5 M2 and try to configure Spotify with Sonos as device.
I have the spotify bridge running and configure including the authorization.
Now i want to configure the device according to the documentation liek this
<- snip ->
Do you mean it won’t get discovered in PaperUI? It could mean the Sonos devices are not exposed by the Spotify API and than it’s not possible to control them with the binding. This can be found out by seeing what the Spotify API returns. (If you enable TRACE logging on the binding (org.openhab.binding.spotify) it will show the list returned by Spotify).
ok, i went for a different solution - openhab -> spotifyd -> mkchromecast
I documented the installation, here it is, it is not perfect and not finished
you can not select different rooms for the output (need more daemons for that) - but following the spotify addon documentation you will see how to do it
there is a noticable delay in the output (also volume control)
no proper startup for both, spotifyd and mkchromecast
but i think this is a good start
Spotify and Sonos with OpenHAB
Installation of spotifyd to be used as spotify connect client within the OpenHAB spotify addon.
mkchromecast for the audio output to sonos (and if you want to a chromecast)
OpenHAB: 2.5.0 M2 on Fedora 30 installed as a virtual machine
Virtualization: Proxmox 5.4
Audio Server for spotifyd and mkchromecast: Ubuntu Server 18.04.x
All systems should obviously be updated to the latest version.
1. Install mkchromecast and test output to Sonos
Install mkchromecast, it is un the repos
#> apt-get install mkchromecast-pulseaudio
Install python dependencies as packages (thats why i chose Ubuntu and not RPM based Distros)
#> apt-get install python3.6 python3-pip python3-pychromecast python3-flask python3-psutil python3-setuptools python3-mutagen python3-gi vorbis-tools sox lame flac faac opus-tools
Install ffmpeg (if not already there)
#> apt-get install ffmpeg
Install PyQt5 (only necessary for GUI - i do not need that)
#> apt-get install python3-pyqt5
should suffice, after that use pavucontrol to select the mkchromecast audio sink, this is NOT necessary on a virtual machine, since there will only be this one audio sink and it is selected already
Test your output with something like
#> mpg123 SOME_MP3.mp3
Audio should play on your sonos.
If you have several devices or sonos and chromecast, you can use "-n" to define your device or "-s" to select interactively.
2. Install spotifyd
Just follow the instructions here
but install this firstfloor_play3
#> apt-get install libpulse-dev
and use this commandline for use with pulseaudio
#> cargo build --release --features="pulseaudio_backend"
Basically no need to explain more here, the spotifyd documentation is diningroom_pendant_down
- i can not start mkchromecast in the background, also it does not work with the "-n" flag, i have to use "-s" - Solution: use screen for now
- i can not start spotifyd in the background, it fails - Solution: use screen for now