In openhab 1 I had a switch to control my mediacenter. ON connected to the OpenWRT router and issued a command for etherwake (mu), OFF connected to the mediacenter and issued a shutdown command:
As far as I know, if you want to send different commands through exec, you would have to use channel exec:command:yourthing:input and define the thing like
Apparently, nothing happens when I operate the switch. /tmp/mediacenter stays empty. The script works and can be run on the shell. (Permissions are correct.)
As usual, there is not the slightest hint of anything helpful in the logs. (There wasn’t even when I accidentally had an uneven number of quotation marks in the item line … I am seriously irritated by OpenHABs error handling …)
That executes only for ON apparently, but only when I remove the %2$s from the thing. I get this error in the log:
22:05:32.318 [ERROR] [hab.binding.exec.handler.ExecHandler] - An exception occurred while formatting the command line with the current time and input values : 'Format specifier '%2$s''
As soon as it is there, nothing gets executed. I also tried to remove the commas from the thing definition, with no change.
I seriously wonder how other people work with openHAB. I am constantly frustrated because there doesn’t seem to be a reasonable way find to errors.