I’m trying my hand at exec binding but I can’t get it to work. I have searched both in the exec documentation and here in the forum, but i can’t really figure out the entries. What have I missed, what am I doing wrong?
What I have done:
created an exec thing with the command: /bin/echo %2$s
created one channel each for run (switch), input (string) and output (string)
entered the command in the whitelist: /bin/echo %2$s
created a blockly script, which set the input value with TEST and then send the command:
the message appears in the log:
2023-03-13 19:46:40.924 [WARN ] [ng.exec.internal.handler.ExecHandler] - An exception occurred while formatting the command line '/bin/echo %2$s' with the current time 'Mon Mar 13 19:46:40 CET 2023' and input value 'null': Format specifier '%2$s'
What are the rest of the exec binding Thing’s configs? Click on the code tab and paste that. How it behaves depends on how it’s configured.
Note, the way it’s supposed to work is you sendCommand to the Input Channel Item when you want to trigger the script to run. The binding will update the Running Channel Switch Item to show that the script is running.
You only sendCommand to the Running Channel Item when you are not using the Input Channel.
It’s subtle but covered in the docs:
the current (or last) command to the input channel (see below, example: %2$s)
I added the emphasis.
The binding never sees updates so you must send command.