How do I set the squeezebox volume through the SqueezeJS framework and JSON format CLI request?
Is there away to get a complete list of all the properties and objects they are associated to?
I am trying via IFTTT JSON webhook:
{ "entity_id": "media_player.playername", "command": "volume", "parameters": "0"}
Results 1 to 10 of 16
-
2018-12-03, 05:11 #1
- Join Date
- Aug 2012
- Posts
- 162
SqueezeJS.Controller.playerRequest([JSON formatted CLI request])
-
2018-12-03, 05:57 #2
SqueezeJS.Controller.playerRequest([JSON formattedCLI request])
> How do I set the squeezebox volume through the SqueezeJS framework and
> JSON format CLI request?
Relative change (-1):
SqueezeJS.Controller.setVolume(1, '-')
Absolute:
SqueezeJS.Controller.setVolume(50)
> Is there away to get a complete list of all the properties and objects
> they are associated to?
What Objects? Properties of what?
--
Michael
-
2018-12-03, 06:16 #3
- Join Date
- Aug 2012
- Posts
- 162
-
2018-12-03, 07:14 #4
SqueezeJS.Controller.playerRequest([JSON formattedCLI request])
> Thanks as in, is there a list or documentation where I can see for
> example:
>
> Controller . SetVolume
> ^ ^
> "Object" "Property"
No, there's not a complete list. Some basics are covered in
http://wiki.slimdevices.com/index.php/SqueezeJS.
Other than that, there's the source :-). Base.js has the controller methods:
https://github.com/Logitech/slimserv...S/Base.js#L248
--
Michael
-
2019-03-12, 05:51 #5
I have incorporated a script into a custom "Now Playing" screen which allows control of some Squeezebox functions via keyboard:
Code:<!-- Binding arrow keys to functions: https://craig.is/killing/mice --> <script type="text/javascript" src="/html/ext/mousetrap.js"></script> <script type="text/javascript"> Mousetrap.bind ('up', function() {SqueezeJS.Controller.setVolume(1, '+')}); Mousetrap.bind ('down', function() {SqueezeJS.Controller.setVolume(1, '-')}); Mousetrap.bind ('space', function() {SqueezeJS.Controller.playerControl(['pause'])}); Mousetrap.bind ('left', function() {SqueezeJS.Controller.playerControl(['playlist index -1'])}); Mousetrap.bind ('right', function() {SqueezeJS.Controller.playerControl(['playlist index +1'])}); </script>
-
2019-03-12, 05:56 #6
SqueezeJS.Controller.playerRequest([JSON formattedCLI request])
> Mousetrap.bind ('left', function() {SqueezeJS.Controller.playerControl(['playlist index -1'])});
> Mousetrap.bind ('right', function() {SqueezeJS.Controller.playerControl(['playlist index +1'])});
>
> The final two "playlist index" commands, however, do not work. I'm
> thinking it may not be a "SqueezeJS.Controller.playerControl" command,
> but I can't find any alternative. Any suggestions on how to correct
> this? Thanks.
Make the parameters separate elements of the list:
['playlist', 'index', '+1']
--
Michael
-
2019-03-12, 06:59 #7
Thanks Michael, that works well! One follow-up if I may: if I want the "left" arrow to first return to the beginning of the currently playing track rather than go to the previous track, what would be the proper command for that? Essentially, I want to duplicate the behavior of the "back" arrow on the front of the Touch.
Last edited by Apesbrain; 2019-03-12 at 07:14.
-
2019-03-12, 07:13 #8
SqueezeJS.Controller.playerRequest([JSON formattedCLI request])
> Thanks Michael, that works well! One follow-up if I may: if I want the
> "left" arrow to return to the beginning of the currently playing track
> rather than go to the previous track, what would be the proper command
> for that?
Check out what the Default web UI would send ;-). I think it's "button rew".
--
Michael
-
2019-03-12, 08:58 #9
Thanks for the suggestion. ['button', 'rew'] duplicates the effect of the ['playlist', 'index', '-1'] command, but does not return to the start of the currently playing track as does the web UI button. The source for the web UI assigns [id="ctrlPrevious"] to the "Previous" button, but I can't find a definition for this element. Any other suggestions are welcome.
-
2019-03-12, 09:55 #10
SqueezeJS.Controller.playerRequest([JSON formattedCLI request])
> Thanks for the suggestion. ['button', 'rew'] duplicates the effect of
> the ['playlist', 'index', '-1'] command, but does not return to the
It shouldn't, when you're well in to a track. See the networking tab in
your browser's dev tools. You should see the exact request the web UI is
sending to the server.
--
Michael