Squeezebox Configuration for media_player

OK. So the devs have located my Squeezebox, given me an interface card allowing me to view album covers, artist, and title, change tracks, etc. Nice tease. So I’ve spent the last few days trying to expand controls to allow changing of source to one of several tunein radio stations with no success. I’ve looked through discussions, examples, and lots of trial and even more error.

I’m on a RPi3 running Hass.io 0.87.0. The LMS v.7.9.0 is running on a separate Pi (Ovation Solo). I can navigate from the LMS web interface. I’ve got the mysqueezebox and tunein accounts created and linked, if necessary. It’s likely I don’t understand exactly how to get this to work. I can do an Lovelace IFrame card, but experience problems on the iOS client 1.5 when i do. IFrame card works as expected on the Mozilla PC-based browser.

Based on the examples I attempted to follow, I created an input_select list and supporting automatons. I’d welcome

In the configuration file:

  - platform: squeezebox
    host: !secret oms_IP
    name: Ovation

In the input_selects file:

station_select:
  name: Radio Stations
  options:
    - Asterisk
    - HD Radio
    - Tunein Classic
  initial: Asterisk
  icon: mdi:radio

I made two attempts at automatons. First this:

- id: 'ovation_asterisk'
  alias: Asterisk
  initial_state: 'on'
  trigger:
    - platform: state
      entity_id: input_select.radio_select
      to: "Asterisk"
  action:
    - service: media_player.media_play
      data:
        entity_id: media_player.ovation
        media_content_id:  http://opml.radiotime.com/Tune.ashx?id=s188877&formats=aac,ogg,mp3&partnerId=16&serial=5db1cfdebfec48be64648ce4a793aa41
        media_content_type: 'music'

- id: 'ovation_hd'
  alias: HD Radio
  initial_state: 'on'
  trigger:
    - platform: state
      entity_id: input_select.radio_select
      to: "HD Radio"
  action:
    - service: media_player.media_play
      data:
        entity_id: media_player.ovation
        media_content_id:  http://opml.radiotime.com/Tune.ashx?id=s281107&formats=aac,ogg,mp3&partnerId=16&serial=5db1cfdebfec48be64648ce4a793aa41
        media_content_type: 'music'
        
- id: 'ovation_classic'
  alias: Tunein Classic
  initial_state: 'on'
  trigger:
    - platform: state
      entity_id: input_select.radio_select
      to: "Tunein Classic"
  action:
    - service: media_player.media_play
      data:
        entity_id: media_player.ovation
        media_content_id:  http://opml.radiotime.com/Tune.ashx?id=s249994&formats=aac,ogg,mp3&partnerId=16&serial=5db1cfdebfec48be64648ce4a793aa41
        media_content_type: 'music'

then this:

- alias: Stream Radio - Template
    trigger:
      - platform: state
        entity_id: input_select.radio_select
    action:
      - service: media_player.play_media
        data_template:
          entity_id: >
            {% if is_state("input_select.radio_select", "Asterisk") %}
              media_player.ovation
            {%-elif is_state("input_select.radio_select", "HD Radio") %}
              media_player.ovation
            {%-elif is_state("input_select.radio_select", "Tunein Classic") %}
              media_player.ovation
            {% else %}
              none
            {% endif %}
          media_content_id: >
            {% if is_state("input_select.radio_station", "Asterisk") %}
              http://opml.radiotime.com/Tune.ashx?id=s188877&formats=aac,ogg,mp3&partnerId=16&serial=5db1cfdebfec48be64648ce4a793aa41
            {%-elif is_state("input_select.radio_station", "HD Radio") %}
              http://opml.radiotime.com/Tune.ashx?id=s281107&formats=aac,ogg,mp3&partnerId=16&serial=5db1cfdebfec48be64648ce4a793aa41
            {%-elif is_state("input_select.radio_station", "Tunein Classic") %}
              http://opml.radiotime.com/Tune.ashx?id=s249994&formats=aac,ogg,mp3&partnerId=16&serial=5db1cfdebfec48be64648ce4a793aa41
            {% else %}
              none
            {% endif %}
          media_content_type: 'music'

My understanding is that scripts aren’t needed. No errors are reported to the log and no effect on the LMS when attempting to switch from music to radio or switch radio stations. I haven’t figured out how to switch input sources. I started a scripts, but didn’t know how to proceed.

media_player_select_source_radio:
  alias: Radio Source
  sequence:
    - service: media_player.select_source
      data:
        entity_id: media_player.ovation
        source: Radio

Maybe a companion to switch back to music?

I haven’t done this (although a firm squeezebox fan, I am using the web browser on my laptop or orangesqueeze on my phone to actually change music).

However my understanding is that you need to play a playlist, so that would involve making a number of playlists, each with one radio station.

Hello,

Old thread but if you are still having troubles you might want to try to change the media content type to ’audio/mp4’

You also have media_player.media_play as a service when it should be media_player.play_media

That’s very useful, what reference did you get that from (I just want to read more)
Thanks

Interesting, the media player docs say the service is media_play, the squeezebox docs use play_media in their example.

https://www.home-assistant.io/integrations/media_player/ cf https://www.home-assistant.io/integrations/squeezebox/

It must be someone with lexdixia :rofl:

LMS Controls (see here) is a Home Assistant project with contains scripting all sorts of commands to the LMS server to allow changing and selection of music, players, sync status, etc… using HA or google home voice commands.

If you review / download the github project you can see lots of examples or simply implement and modify the project.

Hello
Stupid question…
My squeezeboxes are showing up as new devices, but I have no idea what to put in for user name and password!
Tried the mysqueezebox.com email and password, but it did not work.
Also tried my WHS 11 Server credentials that is hosting LMS, but that did not work either.
I tried searching the web, but didn’t find an answer. Thanks in advance!

Edit: Under the LMS web interface - settings - advanced - security, i have “no password protection” and I have I have username / password fields blank (never used them in the last 10 years).

image

Leave them blank

That was the first thing I did, and it gives me the error of “Failed to Connect”

UPDATE:
I figured it out. I already had the LMS integration installed and working because on initial setup a few weeks ago, it found my LMS server on my home server and from there it identified the 3 squeezeboxes.
The “found new devices” notification that gives the error is coming from the integration finding the actual hardware IPs of the three devices.
The lesson I learned is that you access the 3 devices through the LMS interface on the server, not directly by IP address.
Now I got to figure out the automations!
I want the squeezeboxes to play BBC news on a schedule when we are out of the house to make it seem like there are peeps at home in case someone is casing out the joint!

@GaryK Have you ever finished this? I’m at the beginning of getting audio into my mushroom based dashboard. Done the Spotify setup and now get to the LMS side of things. I listen to radio and local music via the LMS/Squeezebox (both hardware and software players in the house).

The idea is to integrate the LMS favorites etc. into the same player I have Spotify on and your attempt looks like it’s the way to go hence the question whether you ever got this up on your Home Assistant instance.

image

I’m not using LMS/Squeezebox for audio. Haven’t gotten over the configuration issues in my setup. The Ovation Solo platform died without support, so I had to move on. Still searching for a Control4 replacement scheme. Good Luck and keep us posted with your progress.

1 Like