homebridge-cmdswitch2
homebridge-cmdswitch2 copied to clipboard
can't run off command within service
I have a switch setup with this as the off command:
"off_cmd": "/home/pi/venv/bin/xbox-poweroff --address 192.168.1.35 --liveid FXXXXXXXXXXXXXXX"
this works fine if I run it from a terminal in PuTTy. if I put it in the off_cmd line on cmdswitch2 it fails. do I need to put it in a virtual environment (source venv/bin/activate) first? how do I make this work?
I used to run Homebridge straight from PuTTy, but i got tired of manually having to launch it if it crashed. now I set hb-service up and i'm running into all kinds of problems. this is the only one I can't seem to figure out.
i figured out how to make the 'on' command work by giving the full path. that didn't work with the off command.
any help appreciated!
` ``
{
"name": "TEST",
"on_cmd": "python /home/pi/xbox-remote-power/xbox-remote-power.py -a 192.168.1.35 -i FXXXXXXXXXXXXXXX",
"off_cmd": "/home/pi/venv/bin/xbox-poweroff --address 192.168.1.35 --liveid FXXXXXXXXXXXXXXX8",
"state_cmd": "ping -c 2 -W 1 192.168.1.35 | grep -i '2 received'",
"timeout": 200,
"manufacturer": "Microsoft",
"model": "XBOX ONE",
"serial": "XXXXXXXXXXX"
}
I got a similar problem. I want to run a c++ code. Works fine on the terminal of the machine. But when I execute it through homebridge-cmdswitch2 nothing happens.
Did you try the full path?
It was a problem with the permissions. I could fix it.
It was a problem with the permissions. I could fix it.
I also guess this is the permission problem. may I know how to fix it?