Controlling Squeezebox from Home Assistant

Tags: #<Tag:0x00007fc3f1c817e0>

I’ve managed to mash together an Input Select card that chooses between streams to play on the Squeezebox. It’s a bit contrived and needs cleaning up but I can write up the notes if anyone wants 'em.

Basic operation: the HA input select has four options, two of which are Icecast streams, one of which is a local radio station’s Internet stream, and an option to turn the box off. They’re all just text entries. The trigger is configured to send that text, via an MQTT message, to Node-Red, which selects a Python script based on the stream name. The Python script makes a call to the Squeezy utility, which passes a command to LMS and LMS tells the Squeezebox to play the selected stream. See what I mean about contrived? It does work though.

I’m also working on a way to implement a “bump” script for the two local Icecast streams. I have it working in a Node-Red dashboard (as well as an artist/title displays for both streams) but, because HA doesn’t have buttons, I need to come up with a work around. Any suggestions?

Basic operation is: a custom Perl script receives a MQTT message, which telnets to port 1234 on a Liquidsoap server and tells Liquidsoap to skip to the next song. Not sure how to do this in HA. (I’m still reading docs.)

1 Like

The stream switching can be managed through automation inside HA, by just watching the state of the input select.

Input Select
Radio Select:
  name: Radio Select
    - None
    - Radio Test 1
    - Radio Test 2
  initial: None
- alias: Play Radio Test 1
    - platform: state
      entity_id: input_select.radio_select
      to: "Radio Test 1"
    - service: media_player.play_media
        entity_id: media_player.dining_room
        media_content_type: audio/mp3

Thanks much! Will try next weekend.