How to restart Volumio by http /URL request?

Hello,

I cannot find answer to my issue.
I plan to make a button in Home Assistant as the URL action to shortcut restart Volumio when needed.
I have tried to check the Firefox developer mode to find out what is the URL directing after the pressing ‘‘Restart’’ button. Could not found as looks like is directing to JavaScript command.
Is there someone who knows who could guide me?
http://local.host/XXXXXXXX???

I can’t think of any url function to do the equivalent of the shell command ‘volumio restart’. You can do this with an IR remote command.

Hi Simon, by the IR command do you mean IR- RC5 infrared code?

I mean using the IR plugin. I have buttons on a physical remote that can turn the Pi off, or do ‘volumio vrestart’. That may not be the type of solution that you’re looking for though.

Hi Simon,
Thanks for answer, I can’t see command for IR to restart Volumio, either under API. Only SSH has a restart functionality feature.

built a bash script:

reboot.sh
sudo shutdown now -r

call these scripts via the ir command in lircrc like:

begin
prog = irexec
button = KEY_X
config = /usr/local/bin/volumio vrestart
end

begin
prog = irexec
button = KEY_Y
config =sudo /bin/bash <path to script>/reboot.sh
end

Hi Wheaten,

Is it posibble to run the script base on url request ? I do not have an IR transmitter set up from Home Assistant yet and would like to avoid if that can be arranged in easier way fo mh set-up.
Anyway thanks!

Not familiar with Home Assistant, I am using Domoticz.

If Home assistant can execute shell scripts, you coud try something like this:

ssh volumio@ip-address <<'ENDSSH'
<path to script>/reboot.sh
ENDSSH

Hi Wheaten,

That works for me!
Even Home Assistant script is slightly different, pushing through SSH was the solution.

I was using Domoticz for years, just this year moved to Home Assistant as is much more complex, advanced with endless opportunities.

I found Domoticz quite restricted with the “plugins” policy. Even is more lightweight and I used to it the HA is a different level.

Thank you for you help.