REST API volume command issue

I’m having an issue with the REST API volume command.
The volume command works correct from the browser:

http://volumio.local/api/v1/commands/?cmd=volume&volume=30

Result:

volumio@volumio:~$ curl localhost:3000/api/v1/getState {"status":"pause", "position":0, "albumart":"/albumart", "uri":"http://radiostream.co.za:9104", "trackType":"webradio", "seek":19859192, "samplerate":"", "bitdepth":"", "channels":0, "random":null, "repeat":null, "repeatSingle":false, "consume":false, "volume":30, "disableVolumeControl":false, "mute":false, "stream":"webradio", "updatedb":false, "volatile":false, "service":"webradio"} volumio@volumio:~$

But when I’m executing from an SSH session on the Volumio host Raspberry Pi the volume goes to null:

curl localhost:3000/api/v1/commands/?cmd=volume&volume=20

Result

volumio@volumio:~$ curl localhost:3000/api/v1/getState {"status":"pause", "position":0, "albumart":"/albumart", "uri":"http://radiostream.co.za:9104", "trackType":"webradio", "seek":20198183, "samplerate":"", "bitdepth":"", "channels":0, "random":null, "repeat":null, "repeatSingle":false, "consume":false, "volume":null, "disableVolumeControl":false, "mute":false, "stream":"webradio", "updatedb":false, "volatile":false, "service":"webradio"} volumio@volumio:~$

Sometimes the volume would go to “0” but mostly it goes to “null”
The same happens with the volume plus and volume minus commands.

I’m trying to make a simple clock radio using cron to start playing a radio stream and set the volume.
Playing and stopping the radio stream works correct, but I’m having trouble setting the volume.
Probably something simple I’m doing wrong… I’m not a programmer, so please excuse my ignorance…

I can confirm this problem with Version 2.657
calling

curl <host>/api/v1/commands/?cmd=volume&volume=58 or curl <host>/api/v1/commands/?cmd=volume&volume=+5

both via localhost and ssh or remotly from another computer results in a volume of zero (or NaN)
Control via webinterface and other commands like pause do work.

Getting it to work would be great because this is a very convenient way how to control remotely via keyboard shortcuts…

I created a Bug here: github.com/volumio/Volumio2/issues/1843

there are quotes missing… as I leaned from the bug ticket:

$ curl ‘localhost:3000/api/v1/commands/?cmd=volume&volume=20’

rather than

curl localhost:3000/api/v1/commands/?cmd=volume&volume=20

for increasing / decreasing:
$ curl ‘localhost:3000/api/v1/commands/?cmd=volume&volume=plus’

$ curl ‘localhost:3000/api/v1/commands/?cmd=volume&volume=minus’