Hi,
Is there a way to see if music is playing using SSH please? I can swap SSH keys to bypass logins but is there a file / folder I can query to say “Music is playing” etc
Thanks
ActionParsnip
Hi,
Is there a way to see if music is playing using SSH please? I can swap SSH keys to bypass logins but is there a file / folder I can query to say “Music is playing” etc
Thanks
ActionParsnip
From the CLI you can query the playback status by executing volumio status
.
The output will look somewhat like this (I subsotuted most of the actual data with “…”):
{
"status": "stop",
"position": 0,
"title": "...",
"artist": "...",
"album": "...",
"albumart": "/albumart?cacheid=2...",
"uri": "...",
"trackType": "...",
"seek": ...,
"duration": ...,
"samplerate": "... kHz",
"bitdepth": "... bit",
"channels": ...,
"random": null,
"repeat": null,
"repeatSingle": false,
"consume": false,
"volume": ...,
"disableVolumeControl": false,
"mute": false,
"stream": "...",
"updatedb": false,
"volatile": false,
"service": "mpd"
}
The first key “status” reveals if Volumio is playing music.
Brilliant. Thank you !!!
I made this in PowerShell if people want to use (requires installation of plink):
while ($true)
{
$status = plink -batch -ssh username@servername -P 22 -pw yourpassword "volumio status | grep status | grep -o play"
if ($status -eq 'play') {
echo "Volumio is playing"
}
else {
echo "not playing"
}
Start-Sleep 3
clear
}