EXEC Binding 2.5.2 => 'Format specifier '%2$s'' problem

Hi,
I’m using the “exec-binding - 2.5.2”. I configured:

.things

Thing exec:command:relaycard_slot1_CH1 [command="/etc/openhab2/transform/Mainboard_FW/Mainboard_FW.out -w2 01 01 00 %2$s", timeout=5, autorun=false]

.items

Switch RelayCard_Test "Relay_Test RUN" {channel="exec:command:relaycard_slot1_CH1:run"}
String RelayCard_Test_Args "Relay_Test INPUT" { channel="exec:command:relaycard_slot1_CH1:input" }
String RelayCard_Test_Out "Relay_Test OUTPUT" { channel="exec:command:relaycard_slot1_CH1:output" }

.sitemaps

Switch item=RelayCard_Test label="Test" mappings=[ON="ON", OFF="OFF"]

In LogFile there always comes up the warning:

[WARN ] [ng.exec.internal.handler.ExecHandler] - An exception occurred while formatting the command line with the current time and input values : 'Format specifier '%2$s''

I don’t know what’s going on. It seems that the ON/OFF command is not passed to the command. The ‘%2$s’ seems to bee ignored. Any idea what I can do?

Best regards, Jens

Find out what those are.

%2 here refers to the last command sent to your input channel Item, RelayCard_Test_Args.
It’d be helpful to know what that was (NOT the state).
If you have never sent it a command, %2 will fail.

Hi,
thank you very much. It was my misunderstanding of the exec-binding. So for all of you working at the same topic, the final configuration for me is:

.things

Thing exec:command:relaycard_slot1_CH1 [command="/etc/openhab2/transform/Mainboard_FW/Mainboard_FW.out -w2 01 01 00 %2$s", interval=0, timeout=5, autorun=true]

.items

Switch RelayCard_Test "Relay_Test RUN" {channel="exec:command:relaycard_slot1_CH1:run"}
String RelayCard_Test_Args "Relay_Test INPUT" { channel="exec:command:relaycard_slot1_CH1:input" }
String RelayCard_Test_Out "Relay_Test OUTPUT" { channel="exec:command:relaycard_slot1_CH1:output" }

.sitemaps

Switch item=RelayCard_Test_Args label="RelayCard_Test" mappings=[ON="ON", OFF="OFF"]

:+1:
Best regards, Jens

If I have this correct… to use the input channel you need a string type. Changes to the string type trigger the command to run but the input ‘value’ itself does not get used…and the output therefore does not change. To get the input changes to be used a command needs to be sent as well just changing the value eg from sitemap by setting the string type as a switch item. Then when triggering the ON/OFF the associated values are used as input.

It all seems uncessessarily obscure!!

To be precise, you must send the String type Item linked to the input channel a command. Item state irrelevant here.
Item commands are invariable used for “do something” instructions, and are what activates most bindings, so this fits the general model.

Clicking widgets in the UI sends commands to Items. See above - command for “do something” instruction, which is what user clicks are.
A state change may or may not later result from a command.

Seems simple enough.

The ‘weird trick’ that exec binding does pull on users - if you are relying on autorun, it only fires when the command sent to input is different from the previous.