Moode Forum
REST API or HTTP commands? - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: REST API or HTTP commands? (/showthread.php?tid=4004)



REST API or HTTP commands? - acresp - 07-10-2021

Hello,
I read some threads and found some http commands like play, stop, volume, etc.

Actually I'm using an ESP32 in wall, on which I put some push buttons (vol+/vol-)

Is there a command to force a playlist, or a radio ? How can I achieve that ?

I'm also looking for a command which can disconnect AirPlay or Spotify users.

The goal is to have a "master button" to force a webradio instead of anything else.

Thanks a lot for your help


RE: REST API or HTTP commands? - Tim Curtis - 07-10-2021

Disconnect airplay or spotify
Code:
moodeutl -R --airplay
moodeutl -R --spotify


Play control - use any of the mpc commandsl
Code:
mpc help

Loading a radio station 
Code:
mpc load <playable URL>

Volume control
Code:
pi@rp2:~ $ /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 level
--version      print the program version
--help         print this help text



RE: REST API or HTTP commands? - acresp - 07-10-2021

(07-10-2021, 09:40 PM)Tim Curtis Wrote: Disconnect airplay or spotify
Code:
moodeutl -R --airplay
moodeutl -R --spotify


Play control - use any of the mpc commandsl
Code:
mpc help

Loading a radio station 
Code:
mpc load <playable URL>

Volume control
Code:
pi@rp2:~ $ /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 level
--version      print the program version
--help         print this help text

Thanks a lot
Is it possible to action the airplay/spotify through an url ?


RE: REST API or HTTP commands? - Tim Curtis - 07-10-2021

Not possible.

ETA: but would be a good project for a dev that would be interested in creating a uniform API for controlling moOde. My TODO list backlog is already quite long so something like this is not on my radar.