Hello community,
I am controlling my LMS from my Android device via the Android app "Tasker". Works really well. I just send HTTP requests for pause/unpause, volume up & down and previous / next track. Example:
Now, because I trigger these requests by finger gestures on the screen of the Android device, I want to make sure that I can make volume and track changes ONLY when any music is playing at that moment, not when the player (Squeezelite) is paused.Code:[http address of LMS]/status.html?p0=pause
For that, I need the current playing status (play/pause/stop) of the player.
Of course I can just do:
,Code:[http address of LMS]/status.html
but that gives me a whole webpage with a lot of information so that I would have to process that by a script to extract the one information I need. That's really cumbersome.
Is there any SIMPLE possibility?orCode:[http address of LMS]/status.html?p0=modeor something like that doesn't work either...Code:[http address of LMS]/status.html?p0=mode&p1=?
I can't believe that something so basic as retrieving the playing status is so complicated??
Results 1 to 3 of 3
-
2020-12-14, 23:17 #1
- Join Date
- Dec 2020
- Posts
- 1
Simple possibility to get playing status via HTTP command?
-
2020-12-15, 00:49 #2jvromans@squirrel.nlGuest
Simple possibility to get playing status via HTTPcommand?
On Tue, 15 Dec 2020 06:17:17 +0000, hasenbein
<hasenbein.9twt80 (AT) no-mx (DOT) forums.slimdevices.com> wrote:
> I can't believe that something so basic as retrieving the playing status
> is so complicated??
Using the JSON API it is very straightforward, see Help > Technical
information > Command line interface
For example, to get the status of player 01:02:03:04:05:06: perform a
request to http://your.server/jsonrpc.js with data
{"id":2,"method":"slim.request","params":["01:02:03:04:05:06",["status","-"]]}
This will return something similar to
{"params":["01:02:03:04:05:06",["status","-"]],
"method":"slim.request",
"id":2,
"result":{
"mode":"stop",
"player_name":
"SqueezeLite 3",
"player_connected":1,
"power":1,
"seq_no":0,
"playlist mode":"off",
"playlist repeat":0,
"signalstrength":0,
"playlist_tracks":0,
"playlist shuffle":0,
"player_ip":"192.168.1.251:59478",
"mixer volume":50,
"digital_volume_control":1
}}
HTH, Johan
-
2020-12-15, 00:53 #3
Simple possibility to get playing status via HTTPcommand?
> I am controlling my LMS from my Android device via the Android app
> "Tasker". Works really well. I just send HTTP requests for
> pause/unpause, volume up & down and previous / next track. Example:
Can't you do POST requests? You should be using /jsonrpc.js with the
status or other query (as documented in
http://htmlpreview.github.io/?https:...s/cli-api.html)
--
Michael