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…