Shell_command not working

Hi!

I’m new to Home-Assitant, i’ve spent almost one week trying to solve this issue on my own, but now i need your help.

I’m running Hass.io and it seems i’m not able to run commands from the shell, both using shell_command and command_on/off.

This is my configuration.yaml:

shell_command:
shutdown_pc: ‘net rpc shutdown -I 192.168.X.X -U user%pass’

switch:

  • platform: wake_on_lan
    name: “Desktop”
    host: “192.168.1.4”
    mac_address: “XX-XX-XX-XX-XX-XX”
    turn_off:
    service: shell_command.shutdown_pc

  • platform: command_line
    switches:
    kitchen_light:
    command_on: “touch /tmp/on.txt”
    command_off: “/usr/bin/net rpc shutdown -I 192.168.X.X -U user%pass”

Noting seems working, no file is created in /tmp/ and no shutdown.
If i run them from a SSH shell (root user) everything is working fine, but from the GUI they are not working.
If i look into the logs i see:

2017-10-07 16:23:24 ERROR (SyncWorker_15) [homeassistant.components.switch.command_line] Command failed: /usr/bin/net rpc shutdown -I 192.168.X.X -U user%pass

Could you please help me? It is a permission error?

EDIT: i don’t know how to make the code looks good on the forum, sorry

Same problem here, trying to make this countdown work:

but there are a couple of shell commands not woking on my hassio

Same here, I’m unable to run any PHP scripts through a shell command. Please help
EDIT: Found a workaround - I downloaded the compiled “php” binary from this link, extracted it and placed it in the same location as my PHP scripts → works! :slight_smile:

Where did you get the php binary