Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Dec 2020
    Posts
    1

    Simple possibility to get playing status via HTTP command?

    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:

    Code:
    [http address of LMS]/status.html?p0=pause
    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.
    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?
    Code:
    [http address of LMS]/status.html?p0=mode
    or
    Code:
    [http address of LMS]/status.html?p0=mode&p1=?
    or something like that doesn't work either...

    I can't believe that something so basic as retrieving the playing status is so complicated??

  2. #2
    jvromans@squirrel.nl
    Guest

    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

  3. #3
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,521

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •