From ba79844c56969ed977579b850562c29d00e8a787 Mon Sep 17 00:00:00 2001 From: Eric Pignet Date: Tue, 5 Dec 2017 23:05:18 +1100 Subject: [PATCH 1/4] Add service squeezebox_call_method to Squeezebox doc --- .../media_player.squeezebox.markdown | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/_components/media_player.squeezebox.markdown b/source/_components/media_player.squeezebox.markdown index d091d13b6d9c..0c2065cd7f12 100644 --- a/source/_components/media_player.squeezebox.markdown +++ b/source/_components/media_player.squeezebox.markdown @@ -33,3 +33,20 @@ Configuration variables: - **password** (*Optional*): The password, if password protection is enabled.

This platform now uses the web interface of the Logitech Media Server to send commands. The default port of the web interface is 9000. It is the same port that you use to access the LMS through your web browser. Originally, this platform used the telnet interface, which defaults to 9090. If you previously specified the port in your configuration file, you will likely need to update it.

+ +### {% linkable_title Service `squeezebox_call_method` %} + +Call a custom Squeezebox JSONRPC API. +See documentation for this interface on http://HOST:PORT/html/docs/cli-api.html?player= where HOST and PORT are the host name and port for your Logitech Media Server. + +| Service data attribute | Optional | Description | +| ---------------------- | -------- | ----------- | +| `entity_id` | no | Name(s) of the Squeezebox entities where to run the API method. +| `method` | no | Array of positional parameters to pass to Logitech Media Server. + +This service can be used to integrate any Squeezebox action to an automation. +It can also be used to target a Squeezebox from IFTT (or DialogFlow, Alexa...). +For example, to play an album from your collection, create an IFTT applet like this: +- Trigger: Google assistant, with sentence: `I want to listen to album $` +- Action: JSON post query with such JSON body: `{ "entity_id": "media_player.squeezebox_radio", "method": ["playlist", "loadtracks", "album.titlesearch={{TextField}}"] }` +This can work with title search and basically any thing. The same wouldn't have worked by calling directly Squeezebox server as IFTT cannot escape the text field. From d904917bc03674cd910b0b856912f042a1467cc1 Mon Sep 17 00:00:00 2001 From: Eric Pignet Date: Tue, 5 Dec 2017 23:08:28 +1100 Subject: [PATCH 2/4] Update media_player.squeezebox.markdown --- source/_components/media_player.squeezebox.markdown | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/_components/media_player.squeezebox.markdown b/source/_components/media_player.squeezebox.markdown index 0c2065cd7f12..dbffaca5fff8 100644 --- a/source/_components/media_player.squeezebox.markdown +++ b/source/_components/media_player.squeezebox.markdown @@ -37,6 +37,7 @@ Configuration variables: ### {% linkable_title Service `squeezebox_call_method` %} Call a custom Squeezebox JSONRPC API. + See documentation for this interface on http://HOST:PORT/html/docs/cli-api.html?player= where HOST and PORT are the host name and port for your Logitech Media Server. | Service data attribute | Optional | Description | @@ -45,8 +46,11 @@ See documentation for this interface on http://HOST:PORT/html/docs/cli-api.html? | `method` | no | Array of positional parameters to pass to Logitech Media Server. This service can be used to integrate any Squeezebox action to an automation. + It can also be used to target a Squeezebox from IFTT (or DialogFlow, Alexa...). + For example, to play an album from your collection, create an IFTT applet like this: - Trigger: Google assistant, with sentence: `I want to listen to album $` -- Action: JSON post query with such JSON body: `{ "entity_id": "media_player.squeezebox_radio", "method": ["playlist", "loadtracks", "album.titlesearch={{TextField}}"] }` +- Action: JSON post query with such JSON body: +`{ "entity_id": "media_player.squeezebox_radio", "method": ["playlist", "loadtracks", "album.titlesearch={{TextField}}"] }` This can work with title search and basically any thing. The same wouldn't have worked by calling directly Squeezebox server as IFTT cannot escape the text field. From fd1cb69e678a148df273ea3003fff04a1ac5c445 Mon Sep 17 00:00:00 2001 From: Eric Pignet Date: Tue, 5 Dec 2017 23:10:37 +1100 Subject: [PATCH 3/4] Add Squeezebox as supporting shuffle_set --- source/_components/media_player.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_components/media_player.markdown b/source/_components/media_player.markdown index 18350ce1326d..5e19cf34e9c8 100644 --- a/source/_components/media_player.markdown +++ b/source/_components/media_player.markdown @@ -58,7 +58,7 @@ Available services: `turn_on`, `turn_off`, `toggle`, `volume_up`, `volume_down`, #### {% linkable_title Service `media_player/shuffle_set` %} -Currently only supported on [Spotify](/components/media_player.spotify/), [MPD](/components/media_player.mpd/), [Kodi](/components/media_player.kodi/), and [Universal](/components/media_player.universal/). +Currently only supported on [Spotify](/components/media_player.spotify/), [MPD](/components/media_player.mpd/), [Kodi](/components/media_player.kodi/), [Squeezebox](/components/media_player.squeezebox/) and [Universal](/components/media_player.universal/). | Service data attribute | Optional | Description | | ---------------------- | -------- | ---------------------------------------------------- | From 143397c391ed1d015a384170629689716f041345 Mon Sep 17 00:00:00 2001 From: Eric Pignet Date: Mon, 25 Dec 2017 21:36:07 +1100 Subject: [PATCH 4/4] Adapted to component's pull request feedback --- source/_components/media_player.squeezebox.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/_components/media_player.squeezebox.markdown b/source/_components/media_player.squeezebox.markdown index dbffaca5fff8..b226960e31ba 100644 --- a/source/_components/media_player.squeezebox.markdown +++ b/source/_components/media_player.squeezebox.markdown @@ -43,7 +43,8 @@ See documentation for this interface on http://HOST:PORT/html/docs/cli-api.html? | Service data attribute | Optional | Description | | ---------------------- | -------- | ----------- | | `entity_id` | no | Name(s) of the Squeezebox entities where to run the API method. -| `method` | no | Array of positional parameters to pass to Logitech Media Server. +| `command` | no | Command to pass to Logitech Media Server (p0 in the CLI documentation). +| `parameters` | yes | Array of additional parameters to pass to Logitech Media Server (p1, ..., pN in the CLI documentation). This service can be used to integrate any Squeezebox action to an automation. @@ -52,5 +53,5 @@ It can also be used to target a Squeezebox from IFTT (or DialogFlow, Alexa...). For example, to play an album from your collection, create an IFTT applet like this: - Trigger: Google assistant, with sentence: `I want to listen to album $` - Action: JSON post query with such JSON body: -`{ "entity_id": "media_player.squeezebox_radio", "method": ["playlist", "loadtracks", "album.titlesearch={{TextField}}"] }` +`{ "entity_id": "media_player.squeezebox_radio", "command": "playlist", "parameters": ["loadtracks", "album.titlesearch={{TextField}}"] }` This can work with title search and basically any thing. The same wouldn't have worked by calling directly Squeezebox server as IFTT cannot escape the text field.