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

Homebridge crashes every time #48

Open iPhilBln opened 6 years ago

iPhilBln commented 6 years ago

Hey. I want to send the following command line sh /home/pi/Haustür/haustür.sh ht on with homebridge. But every time i turn the button on in Homekit homebridge crashes. Normally it works in the terminal.

This is my config.json:

{
    "platform":"cmdSwitch2",
    "name":"Haustür",
    "switches":[
       {
          "name":"Haustür",
          "on_cmd":"sh /home/pi/Haustür/haustür.sh ht on"
       }
    ]
 }

And thats the error message:

child_process.js:383 throw new TypeError('"file" argument must be a non-empty string'); ^

TypeError: "file" argument must be a non-empty string at normalizeSpawnArguments (child_process.js:383:11) at exports.spawn (child_process.js:496:38) at Object.exports.execFile (child_process.js:212:15) at exports.exec (child_process.js:142:18) at cmdSwitchPlatform.setPowerState (/usr/lib/node_modules/homebridge-cmdswitch2/index.js:222:3) at emitMany (events.js:147:13) at Characteristic.On.emit (events.js:224:7) at Characteristic.On.Characteristic.setValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:320:10) at Service.Switch.Service.setCharacteristic (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Service.js:183:32) at Timeout._onTimeout (/usr/lib/node_modules/homebridge-cmdswitch2/index.js:237:12)

So what did I wrong?

florian-aa commented 5 years ago

This issue seems to be reported by several users. Is there a solution available ?

iPhilBln commented 5 years ago

I have solved it with an empty bash Script in the off line.