[SOLVED] EXEC Binding simple example not working

Sorry, getting a little confused here:

Is it the right approach?

.things
Thing exec:command:apc [command="python /etc/openhab2/scripts/led.py %2$s", interval=0, timeout=5, autorun=true]

.items
String yourcommand_Args {channel="exec:command:apc:input"}
Switch python_test {channel="exec:command:apc:run"}

.rules
rule “Your Execution”

when

Item python_test changed

then

if(python_test.state == ON)

{

yourcommand_Args.sendCommand(IFWI)

}

end

This doesn’t work :frowning:

PS: IFWI is the argument which I want to pass!

There is a near infinity that could be “This doesn’t work”. Logs?

Looking at the code you have a misunderstanding how the Channels work. There are two ways to kick off a shell script.

  1. Send an ON command to the Item linked to the run Channel
  2. Send a String command to the Item linked to the input Channel

You are doing both.

Remove the link to the run Channel in python_test.

What is IFWI? A global String variable? If not and it’s an Item you need to use IFWI.state.toString.