LMS Controls - Google Home / Home Assistant Voice Command for Squeezebox Players

As per the troubleshooting document on the GitHub, perhaps you can provide the full output of the shell command so I can see what’s actually going on, which curl command is not working.

Haven’t used the Nabu Casa service but I would expect you can make it work but may require changing the post command to either work with Nabu Casa as opposed to Duckdns or possibly even call it directly if you’re LMS server and HASSIO are on the same network.

If you don’t feel comfortable posting the results here you can send them to me directly at [email protected]

When I use the TTS on the media player, the music silences, the message is announced but the music does not return, its just silence after the announcement and I have to reselect the playlist. Any ideas how I can get the playlist to restart again please.

Thanks for this guide!!
Have everything up and running after making a few small changes.

In the shell scripts I changed to curl -k because I was too lazy to solve the problem with my certificate.

In the env.sh script I use my LAN IP as mydomain because I could not make myduckdns.org available from inside my network, some Cisco router limitations.

But anyway, all is working perfect. Now I’m thinking about translating all this to Dutch language. Where do I have to start to do this?

Btw, are you planning to make it work with API v2 in DF?

Hi, Just finished the translation to Dutch. If someone is interested, contact me or reply and I will provide the files.
All credits go to @ynot I only translated the files.

1 Like

Glad to hear it worked for you. I am basically offline for the summer but will look to address API V2 in DF provided it’s supported by HA in the fall. Might be a good idea to bump the HA developer’s as a reminder.

1 Like

Hi Dave,

I will send you a message after my vacation. I’m interested because I’m using 5 max2play devices at home.

Greetings Thetmar

I also have a few players running PiCorePlayer which is similar to max2play, works great.

I’ve found that LMS in HA doesn’t work so well as it throws an error every 10 seconds if I take player offline. Has anyone managed to find a workaround for this? Or does this method not use HA’s ‘squeezebox’ integration?

For now I’m controlling my LMS players with a mixture of NodeRED and squeeze-alexa, and while it works it can be a little clunky and it would be nice to do it all in HA. :sunglasses:

Could you possible share your NodeRED flows to control your LMS players? I am struggeling to get it to work. (in PM maybe to not go off-topic too much)

Sure, It’s all done using the HTTP request node, you need to send JSON to your LMS server.

This flow sets the volume of a player to 25%:

[
    {
        "id": "2943f10c.775616",
        "type": "comment",
        "z": "1366ffd3.8803e",
        "name": "Volume 25 on Orange",
        "info": "",
        "x": 340,
        "y": 140,
        "wires": []
    },
    {
        "id": "8600693f.710ca8",
        "type": "comment",
        "z": "1366ffd3.8803e",
        "name": "JSON over HTTP",
        "info": "",
        "x": 120,
        "y": 260,
        "wires": []
    },
    {
        "id": "d0a62293.16cd18",
        "type": "debug",
        "z": "1366ffd3.8803e",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "x": 530,
        "y": 160,
        "wires": []
    },
    {
        "id": "2dafbf3a.3567b",
        "type": "inject",
        "z": "1366ffd3.8803e",
        "name": "test",
        "topic": "test",
        "payload": "",
        "payloadType": "date",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 110,
        "y": 180,
        "wires": [
            [
                "173b3995.9e609e"
            ]
        ]
    },
    {
        "id": "173b3995.9e609e",
        "type": "function",
        "z": "1366ffd3.8803e",
        "name": "Set HTTP headers",
        "func": "// Volume 25 on Orange\nmsg.payload = '{\"id\":1,\"method\":\"slim.request\",\"params\":[ \"b8:27:eb:aa:c2:4a\", [\"mixer\", \"volume\", \"25\"] ]}';\nmsg.headers = {};\nmsg.headers['Content-Type'] = 'application/json';\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "x": 330,
        "y": 180,
        "wires": [
            [
                "d0a62293.16cd18",
                "bb6d290d.71e5a"
            ]
        ]
    },
    {
        "id": "83fd7656.b84c48",
        "type": "debug",
        "z": "1366ffd3.8803e",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "x": 530,
        "y": 260,
        "wires": []
    },
    {
        "id": "bb6d290d.71e5a",
        "type": "http request",
        "z": "1366ffd3.8803e",
        "name": "",
        "method": "POST",
        "ret": "txt",
        "paytoqs": false,
        "url": "http://lms.local:9002/jsonrpc.js",
        "tls": "",
        "proxy": "",
        "authType": "",
        "x": 340,
        "y": 260,
        "wires": [
            [
                "83fd7656.b84c48"
            ]
        ]
    }
]

You’ll need to change the LMS server address and mac address of the player for it to work for you. :slight_smile:

Thank you so much!

1 Like

No problem, you can do many more things than just change the volume, look up the LMS command line interfact docs for many more controls - you can even put messages on the screen of you squeezebox if it has a screen.

Just set this up and using ui-Lovelace page for testing have ability to control volume, track, etc…, however the search doesn’t seem to work using LMS command, the ‘query result’ displays ‘unknown’ and remains as this when attempting a media search…, any ideas as to what may stop this working and an explanation to what differ between this and the device control comms as they appear to function OK…

Hi, this will likely be a problem with the shell commands. There is a troubleshooting document here: https://github.com/ynot123/LMS_Controls/blob/6bae4c90f410c4596821e7da038c4f017a6241d4/troubleshooting.md on the github that you can refer too. Run the shell commands as outlined and the output should help diagnose the problem. If you wish to send the output for my review you can try my email [email protected]

LMS Controls Project Updated - Dialogflow Support for V2 - October 24, 2019

Dialogflow V1 api will be deprecated on October 23, 2019. If you are still using the V1 API, it is recommended to change your settings in Dialogflow to use the V2 API. No changes to your intents yaml configuration need to take place after upgrading to the V2 API.

To update the dialogflow project, in Dialogflow console, simply press the gear icon and change from V1 to V2. Give it a try.

Please note, with the upgrade of HA from 0.99 to 0.101 I had to re-create my long lived tokens for the shell scripts (env_var.sh) and in the fulfillment section of Dialogflow to ensure proper authentication with Home Assistant.

Guys, I wonder if somebody share the experience how to determine the list of HA media players that currently are synced with specified media player. I use sync function of LMS Controls to sync players, but doesn’t understand how to “read” sync status in HA.

There is no simple way to determine the syc status. But you could use a query against LMS server to return the status similar to the methods used in LMS Controls shell scripts. I believe the LMS command is something like:

Request: “04:20:00:12:23:45 sync ?”
Response: “04:20:00:12:23:45 sync 04:20:00:12:23:21”

Because its not trivial, it was not implemented in the LMS controls project. Ynot

Could you advise an example of bash syntax of such a command? I can try to use it.

Not sure if you’re using this project or not but… The shell script "qry_player_stat.sh" returns the status of the player being queried including it’s sync status. You can run the shell script stand alone in a terminal window with something like:bash qry_player_stat.sh macadress_of_player" The output would look something like below and then you could parse the sync slave or master status and display it I suppose. If I ever get around to updating the project I will try to include that feature. Note mac address needs to be lower case (aa:bb:00:11:22:33)

Query is: cc%3Acc%3A85%3A05%3A60%3A07 status player_name%3ABathroom player_connected%3A1 player_ip%3A192.168.0.20%3A58670 power%3A1 si
gnalstrength%3A0 mode%3Astop remote%3A1 current_title%3A time%3A0 rate%3A1 duration%3A139.6 can_seek%3A1 sync_master%3Acc%3Acc%3A98%3A
d4%3A2b%3A59 sync_slaves%3Ab8%3A27%3Aeb%3A94%3A76%3Aaa%2Ccc%3Acc%3A85%3A05%3A60%3A07 mixer%20volume%3A40 playlist%20repeat%3A0 playlis
t%20shuffle%3A0 playlist%20mode%3Aoff seq_no%3A0 playlist_cur_index%3A7 playlist_timestamp%3A1574907388.90986 playlist_tracks%3A9 digi
tal_volume_control%3A1 remoteMeta%3AHASH(0x5584a0b8bd70)

@ynot Thanks a lot for your answer! I rewrited the LMS Control code and successfully integrated synchronization feature to it.