luisiam/homebridge-cmdswitch2

Start stop Status *.jar file ?

ThomasBoettner opened this issue · 2 comments

I like to use the cmdswitch2 to Control my abilight via Siri, but dont get it working.
my config is the following:
"name" : "Abmilight",
"on_cmd": "java -jar ~/Programme/ambihue.jar -start -tvIP 192.168.X.X -hueIP 192.168.X.X -hueUser XXXBsj1rXXX -map Tisch:Right1:100",
"off_cmd": "pkill -f 'java.*ambihue.jar'",
"state_cmd": "ps aux | grep -i 'ambihue.jar'"

Problem:
Status ist always ON but abilight is not on.

thx for helping
Thomas

Try this:
"state_cmd": "if pgrep -i 'ambihue.jar'; then exit 0; fi; exit 1"

Sorry das ich jetzt erst antworte, deine Line funktioniert 1A, vielen dank dafür!!!