Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


change volume via web command line
#1
I cannot find how to change volume using volume as an argument addressing to moode.local or so. May I ask to write this or forum page where it is explained? Are there other arguments to pass, besides the volume?
Reply
#2
The web api can be accessed via

Code:
http://moode/command?cmd=

Examples
Code:
http://moode/command?cmd=play
http://moode/command?cmd=next
http://moode/command?cmd=stop
http://moode/command?cmd=vol.sh up 1
http://moode/command?cmd=vol.sh dn 1
http://moode/command?cmd=vol.sh mute
http://moode/command?cmd=vol.sh 25


Via SSH
Code:
pi@rp3:~ $ /var/www/vol.sh --help
Usage: vol.sh [OPTION] [VOLUME]
Change the volume and update the knob.

With no OPTION or VOLUME, print the current volume.
With just VOLUME, set current volume to VOLUME.

-up            VOLUME  value between 1 and 100
-dn            VOLUME  value between 1 and 100
-mute          mute or unmute the volume
-restore       set volume to current knob volume
--version      print the program version
--help         print this help text
pi@rp3:~ $
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(02-03-2019, 01:51 PM)gmarins Wrote: I cannot find how to change volume using volume as an argument addressing to moode.local or so. May I ask to write this or forum page where it is explained? Are there other arguments to pass, besides the volume?

Thank you, this is what I sought for.
Reply
#4
(02-03-2019, 02:55 PM)Tim Curtis Wrote: The web api can be accessed via

Code:
http://moode/command?cmd=

Examples
Code:
http://moode/command?cmd=play
http://moode/command?cmd=next
http://moode/command?cmd=stop
http://moode/command?cmd=vol.sh up 1
http://moode/command?cmd=vol.sh dn 1
http://moode/command?cmd=vol.sh mute
http://moode/command?cmd=vol.sh 25


Via SSH
Code:
pi@rp3:~ $ /var/www/vol.sh --help
Usage: vol.sh [OPTION] [VOLUME]
Change the volume and update the knob.

With no OPTION or VOLUME, print the current volume.
With just VOLUME, set current volume to VOLUME.

-up            VOLUME  value between 1 and 100
-dn            VOLUME  value between 1 and 100
-mute          mute or unmute the volume
-restore       set volume to current knob volume
--version      print the program version
--help         print this help text
pi@rp3:~ $

I have been using this with success for a while. I was wondering if it is possible/easy to add custom command. I need a command to restart the librespot daemon, or another way to stop spotify playback from a "shell" command (i.e. not he gui and not spotify app). I created a script spotreload in /var/www/(command), that kills librespot and then restarts it but this command does not get executed when I try to:
Code:
http://moode/command?cmd=spotreload

So there must be something else.
Reply
#5
Have a look at /var/www/command/index.php
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: