Logitech Squeezebox - examples of how to use the API in HA

I was just writing a reply when I saw your new edit. It does still work for me as I wrote it. Glad you got it to do what you wanted…thanks for sharing your solution!

Thanks anyway Anwen,
I don’t quite understand why your method does not do anything here but at least there is another way to do it.

I am quite surprised how well voice assistant does it’s job even on a pi.
It struggles a bit with band names and album titles but overall does a great job.

1 Like

If anybody can think of a way to search for just one song by an artist and play that , based on a voice command, that would be great.
So far I have not managed to rebuild the search functionality of the squeezeserver in Home Assistant.

Hi @Kabala, did you ever find out how to do this? I would like Home Assistant to notice when a Squeezebox Player is playing and then trigger the appropriate amplifier to switch on. I don’t know how to have HA monitor LMS for players’ playing/not-playing status.

Is there a reason you don’t just install the integration?

@ozpac I think I used the DLNA integration to allow the players to show up in HA as a media player. As soon as the player shows as playing it triggers the automation below to switch on the amp. Use Developer Tools to check the media_player.kitchen shows up and is working correctly. Works really well for me. I found the DLNA was the fastest response than alternative integrations. From memory in LMS you MIGHT need to install one of the bridges to allow the player to show in DLNA.

alias: Kitchen Amp Turn On
description: ""
trigger:
  - platform: state
    entity_id:
      - media_player.kitchen_2
    to: playing
condition: []
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.kitchen_amp_power
mode: single

edit: I run my LMS separately from HA as it works so well and my family after ten years has almost got comfortable with the lovely material interface!!! “Over my dead body” is anything going to change!

do you have any hint how can i ask HA to play something from apps in Logitech Media Server integration?

Hello,

I using LMS and squeezelite addons running on Raspberrypi 4 with homeassistant.

I have added my music folder to lms, the songs plays fine.

Please guide how to play a particular folder/album using automation.

Kindly reply

I would advise you to try some of the examples in this tread.

Thanks a lot for this example.

Can you you please guide me how to play a music folder ?

service: squeezebox.call_method
target:
  entity_id:
    - media_player.squeezelite_ha_addon_2_2
  device_id: []
  area_id: []
data:
  command: playlist
  parameters: 
     - musicfolder
     - Enigma

I tried this but it didnt work.

In order to help you, please read this.

You will need to know the full path to your given music folder item as seen by Logitech Media Server (LMS). This will derive from whatever you added to the basic settings as your media folder when you set LMS up:

service: squeezebox.call_method
target: 
  entity_id: media_player.<your_player_here>
data:
  command: playlist
  parameters:
    - add # Adds folder to end of playlist. Can also be 'play' (clears entire playlist), or 'insert' (inserts it as next item)
    - "/path/to/your/music/folder/Enigma"

To be extra sure, wrap your folder path in quotes if it contains spaces.

1 Like

Thank you… it worked…

I ran into a related problem and wrote a long read about it with examples of how to use the LMS API in HA. Maybe it can help you.

How to play random mix from a specific folder using Home Assistant

1 Like

Hello everyone,

Plz guide how to sort a playlist by title using homeassistant service call?

Hi @python, i just implemented the HA Squeezebox integration and connected it to my LMS. This seems to be working fine.
But currently i’m missing “Favorites” and “My Apps”. I see in your screenshot that you were able to add “Favourites”. Can you help me how to achieve this.
I’m new to HA so only
experience via the web console so far.

I have no idea why would you miss favourites, i have not done anything special to see it.

What you see in the screenshot is not the Home-Assistant gui but the LMS material desktop gui.

1 Like

OK, i got confused, it’s clear now.

In HA i see this when i let the LMS plugin add the different players and i select one:

And in here, if i select “Browse Media (Blader door Media)” i cannot see my LMS “favorites” or “my apps” like i have on the players or via SqueezePlay.

Anyone using the HA LMS integration knows if this is possible?

No at the moment lms favorites are not supported.
There is a featurerequest and here to do so.