luisiam / homebridge-cmdswitch2

CMD Plugin for HomeBridge (API 2.0): https://github.com/nfarina/homebridge
Apache License 2.0
176 stars 29 forks source link

Start stop Status *.jar file ? #37

Closed ThomasBoettner closed 6 years ago

ThomasBoettner commented 6 years ago

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

theend92 commented 6 years ago

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

ThomasBoettner commented 6 years ago

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