2oh1
March 10, 2018, 9:49pm
1
A simple command will let me lower the volume:
curl 'MY_IP_ADDRESS:3000/api/v1/commands/?cmd=volume&volume=minus'
…but how do I get the volume? I’d like to create a script that tells me what the volume is… and I’d really like to have a simple toggle on/off for mute.
Adrii
March 15, 2018, 6:56am
2
Could you extract it from
volumio.local/api/v1/getstate
e.g.
curl -s 'volumio.local/api/v1/getstate' | sed -r 's/^.*"volume":([[:digit:]]*).*/\1/p'
Get volume using
amixer
mute using
amixer -c X cset 0%
X is device ID, the default is 0
Easier:
volumio volume
will print the current volume
See here:
volumio.github.io/docs/Good_to_ … lient.html
2oh1
April 9, 2018, 2:51am
5
Adrii:
Could you extract it from
volumio.local/api/v1/getstate
e.g.
curl -s 'volumio.local/api/v1/getstate' | sed -r 's/^.*"volume":([[:digit:]]*).*/\1/p'
Oh oh OH, that’s it! Rather than extracting the volume, I’ll extract whether or not it is muted (true/false) and create a toggle.
Thanks!