Custom Widget: Spotify Player

Hi,

thanks to these nice widgets

which I combined - or took as template - I came up with this widget for spotify.

I tried to be as close as possible to the Windows App in the layout of the controls.

Some changes had to be done (or I didnt know how to do them)* though

  • volume control is below player control
    • as I didn’t want to make to controls too small
    • or too wide
  • The current Spotify Binding unfortunately does not provide a Mute property.
    • So I added a volume control next to the volume slider
    • if someone knows how to
      • save the last volume on press of the mute button,
      • restore on next press
        please let me know
  • I used official spotify icons whereever I could find them but some icons I could not find in the spotify developer pages
    • mute
    • queue
    • available devices

features to come (if I find a nice way how to put it in)

  • support for playlists
  • support for favorites
  • mute control (see above)
  • hoverover for the controls - to make them green :slight_smile:

Screenshot

How to install

  • enable the Spotify Binding
  • make sure it works
  • enable to following items in the Spotify Player Bridge
    • Volume
    • Active Device Shuffle
    • Media Control
    • Repeat Mode
    • Media Title
    • Track Progress (ms)
    • Track Duration (ms)
    • Album Image
    • Media Artist
  • add the widget to your library
  • add the icons to the html directory of your openHAB installation - in subfolder spotify.
    • Linux
      • /etc/openhab2/html/spotify
    • Windows
      • C:\openHAB2\conf/html/spotify
    • others see here

I hope you like this widget.

10 Likes

Hi great work.
Any chance to get a button for switching the “Active Device” in? I am not familiar in programming that stuff.

1 Like

Hi @MadMaxCGN,

thanks for using my Widget and providing feedback.

Unfortunately I’m not using Spotify on my OH-Setup anymore. So give me some time to set up the test environment.

1 Like

hello, thanks fr tutorial! one stupid question: if i setup widget on openhab installed on RPI, if i open the mainui from another device (example from my tablet/smartphone) the audio comes out from device speakers or do i need to connect speakers on RPI?

Hi @rubenfuser,
the music keeps playing whereever it is playing. So no need to add speakers to your pi.

If you have multple players (google assistent, mobile, …) the audio stays at where it is.

Hope this helped.

1 Like

yes thank you for explanation! i will try this widget soon :wink:

thanks!

edit: duuuu this binding need to have premium spotify account :frowning: