Volumio CLI commands

Hello,

I am trying to control Volumio from my home automation server and am only having limited success.
The standard MPD commands are allowing me to change volume and pause etc…but I cannot yet select a playlist or a song.

Is Volumio compatible with the standard list of MPD commands or is it different? Do I need a new command list? Many commands do not return any result.
I seem to need an integer vaue to refer to particular playlists, how do I doscover the integer value corresponding to the playlists in Volumio?

Thank you,

btw - I am attempting to integrate Volumio with both FHEM and Loxone systems

You should try mpc commands. Mpc is a commandline mpd controller.
With “mpc lsplaylists” you can list the playlists and “mpc load [playlist]” loads the playlist. For more see the man page

Wow, that’s pretty interesting! To reply to your question, don’t use MPC. You’ll just communicate with MPD and not with Volumio.
Volumio uses socket.io for communication, and a partial documentation of Volumio’s API is here:
volumio.github.io/docs/API/WebSocket_APIs.html

Also, it would be much easier for you to write a plugin, so you’ll be able to dig into the code and achieve way better results. The guide is not complete yet but you should be able to get started in no time:

volumio.github.io/docs/Plugin_S … rview.html

Please update me on this one, I’m really interested

thanks michelangelo
unfortunetaly writing a plugin is a bit beyond my level of knowledge and abilities…I would need a lot of help to do it. Instead, I am hoping for the MPD emulation. FHEM contains an MPD module which already works to some small extend (volume, pause,play etc…).

Hi okenny,

did you have any Success integrating Volumio to Loxone?

Hi,

I moved instead to Logitech Media Server - that works very well!
I never continued to work with Volmio, just wasn’T worth the trouble, LMS isn’T as pretty but it works well.

Good luck!

With the new Volumio Release, I can see in the Changelog that a Rest Api has been implemented.
Would this enable us to use the old Commands already again?

Tried lots of different commands, als had a Look at the Rest Api at Github but couldn’t get anything worked out.
Looking at the Changelog of the current Version, it looks that it should work already
Maybe someone has a hint for me, or is it simply not working at the moment?

A little hint that helped me:

  1. sudo npm install socket.io-client
  2. sudo npm install connect

From there, you can use the command node to start json-scripts, ie:

node /volumio/app/plugins/system_controller/volumio_command_line_client/commands/setvolume.js 80

to set the volume to 80%.

More commands can be found in the https://volumio.github.io/docs/API/WebSocket_APIs.html
(I managed to stop playing and load my custom playlists at set times with a few lines in crontab using the node-command)

.Nico

We’ve not documented rest api yet, but its available on our latest builds.
You can see the js file here:
github.com/volumio/Volumio2/blo … i/index.js

basically you can invoke it with volumioip/api/v1/commands/play

Thanks Michelangelo,

that helped me a lot. Play, Pause, Stop, Next, Previous are all working
but I am clueless how to control the Volume.

for all controls I am using volumioip/api/v1/commands/?cmd=play

Using only the command volume I get a success message resulting in setting the Volume to 0. (+1 , -1) would be good for control.

In Volumio1.55 I was able to use the “Pause” control to toggle the music, maybe a toggle command would also be possible in v2.

Thanks again for your great Work.

Any news on this?
thanks

Today I found the new Documentation, and I am finally able to set the Volume to a fixed %.
But I still can’t find the way how to set the Volume per plus & minus.

In the Documentation:

volumio.local/api/v1/commands/?cmd=volume&volume=80
where volume can be: mute, unmute, plus, minus (plus and minus will increase\decrease as per parameter one click volume steps)

So using: volumio.local/api/v1/commands/?cmd=volume&volume=mute / unmute
works, but trying all Variations of plus and minus (also + & -),
it resets the Player to NaN

Any Suggestions?

Nobody?

I’ve resorted to writing my own scripts.