[Release - Updated 03/06/2019] Squeezebox Integration (Logitech Media Server)


#1

I have built an integration to Squeezebox Server (Logitech Media Server).

It takes the form of a Connect app, and a child driver for the Squeezebox Players.

I still think the Squeezebox is a fantastic bit of audio kit and if there's still a few of you out there using them then I hope this code is of some use. :notes: :grin:

The driver supports all the Music Player and Speech Synthesis capability functions so this also enables Squeezeboxes to be used for announcements using the Hubitat built in text-to-speech.

[Update 13/10/2018] Added support for password protection

[Update 14/10/2018] Added support for player synchronization - example provided in README to create sync group switches for a dashboad

[Update 14/10/2018] Add transferPlaylist method

[Update 15/10/2018] Add child switch device, optional for each player, to allow enabling/disabling alarms

[Update 16/10/2018] Add methods to allow playing an album, artist or song using the squeezebox built in search. Also add methods for controlling repeat and shuffle mode.

[Update 17/10/2018] Add method to look for an artist's albums in the library and speak their names.

[Update 09/02/2019] Change server polling to use asynchronous HTTP call

[Update 05/04/2019] Add simple sync mechanism to prevent server polling requests building up

[Update 10/04/2019] Replace sync mechanism with warning message if server polling requests overlap.

[Update 03/06/2019] Fix bug in playFavorite command preventing direct use, Add speakCurrentTrack() command, Resume currently playing track after speaking

If you are updating it should be enough to overwrite the app and device handler code with the latest versions from Github and then click through the setup screens in the app again. You shouldn't need to delete all your devices and re-add them. (You may need to also add the new child switch device if you haven't already.)

The code (+ instructions on how to install and configure) is at:


Inexpensive voice notifications
App and driver porting to Hubitat
#2

@bikesquid thanks for the help testing it, I've also adjusted the prefix/suffix addition as you suggested.


#3

@xap - You bet, shout if I can help again!

I'll just say, for me integrating this is huge. LMS and squeezebox is an outstanding audio package, regardless of price, for those that don't want subscriptions and streaming to be the only way to get music, tho you can,... and it's all free.

Now if I could just figure out how to control all the amp I'd be fully where they promised I'd be back in 1999!!


#4

I have a number of squeeze touch and players, if you're interested in one heck of a deal, please pm me.


#5

This looks very promising. I too have several - and have resurrected a couple of the touches recently as ROON endpoints (as have many of the old squeezebox community seem to have found themselves). But moved onto HEOS system so that I could get better integration with Denon/Marantz amps and they have a well documented CLI.

Looking at the code here it seems a good basis for attempting to incorporate this as a music player device - what I really want to do is display album art and basic controls on the main dashboards. Maybe time to take the plunge and try a little coding . Its been a few years.


#6

I use a Harmony Hub, allows me to control the amp that my SB Touch is plugged into, combined with a smart outlet so the amp is only powered on when in use.


#7

You should be able to just add a player device as a music player to the dashboard to get music controls. In terms of displaying the cover art, you can access the current cover art on your LAN using the following URL:
http://{serverHostAddress}/music/current/cover.jpg?player={playerMAC}
e.g.
http://192.168.1.100:9000/music/current/cover.jpg?player=00:04:20:27:a5:c2
Although, that is only local network access.

I can get that to appear on the Hubitat dashboard although there's no auto-refresh of the image currently. If you were able to stand up your own simple HTTP server and serve up a page that references that link but with a meta-refresh set, that might work.

Alternatively:
You can use the sharptools.io dashboard. It works and allows you to set auto-refresh but I would expect the album art will only render if you are accessing the dashboard from your home network. I tried setting one up to test it and it works. Although currently the controls it exposes on the music player are a bit limited (no volume, mute etc.). However, the guys at SharpTools are really responsive to feature requests and suggestions so you could always ask them to add more controls :slight_smile:

Here's a screenshot:


#8

Thanks - exactly how I was thinking. I have a dream of each room having a dashboard that brings these elements together with lighting and environmental controls displayed. Triggered update for the image tile (rather than auto refresh IMO). I'll play a little when I get back home this weekend.


#9

I tried the Harmony Hub,... no go in my case. The hub wants to be an only child and doesn't (didn't when I was trying anyway) like being in a 2 or 3 hub environment... so given I have amps sprinkled like salt around the house I couldn't control several from one location, some using IR some using ethernet.


#10

Any way to modify this to get it to work with a password protected lms server? I suppose I can take the password protection down...


#11

I think there is, doing some googling I think I may be able to perform login and acquire an authentication token to include in the headers when I'm making a request. If you take the password protection off for now and I'll have a look at adding in the support for security.


#12

Tanks man! Yeah I took it down and it works beautifully! I think this is the best Logitech integration I have ever seen!


#13

also do i have to do anything to get the speak function to work... I tried typing something in the fields and clicking send my player stops playing and switches to playing some obscure mp3 with no sound output


#14

That's strange, have you tried setting the "Default Text To Speech (TTS) Voice" in the Hubitat Settings page?


#15

I didn't change it from the default... right now it says mathew, male us english


#16

Can you try getting the URI for the speech mp3 and paste it into a browser address bar to see if it's valid?


#17

yeah that played


#18

As far as my logiteh setup its a raspberry pi3b+ running max2 play as the server and all my players are pis with max2play.


#19

I'll PM you so we don't fill up the thread with this :slight_smile:


#20

Phoa, this is a sweet surprise. :crazy_face:
I've now got some original Slim Devices Squeezeboxes and a Logitech Boom appearing on a new "Music" Dashboard. Wicked.
Thank you.