Exec binding 2.0 over Windows

Hello All,

I have a little tool to control my sony device which is based on C# app.

I am also using OH2 over a windows machine (previously OH1)

I was normally using item as below in OH1:

Switch sonyTV “Living Room TV” { exec=“ON:exefiles/Sony/SonyRemote.exe PowerOn,OFF:exefiles/Sony/SonyRemote.exe PowerOff” }

After moving to exec 2.0 on OH2, it doesn’t work anymore.

Is there any specific requirements for scripts on OH2?

Thanks in advance for help in such basic stuff.

Ok, the thread here covers my question:

But now i have another one, what is input channel used for?
I thought it would act as command arguments, but it doesn’t (at least in the way i tested it).

Hi @Mohamed_Negm,

I am not sure if I get your point.

The things (exec:command:licht_on and light_off) mentioned above are the representatives to execute the script.
To be able to switch the light (or Sony TV) on AND off with one switch the two things (channel “run” which executes the script) are monitored by the rule and set the third switch according to the usage of the on and of things.
The Switch licht_sofa is just a switch without a direct funtion. It only works if the rule is in place.
So it actually looks like this (icon and group are optional):
Switch licht_sofa (Group)

Does this answer your question?

Hello Gerland,
Thanks for answering.
That answers the first question :smiley:

Im now wondering what is the use of the input channel in the exec 2.0 ?

My initial thought was to use it as a command arguments.
For example my script is called sonyRemote.exe and it is waiting for ON or OFF in the arguments,
command shall be : sonyRemote.exe
Input shalle be: “ON” or “OFF” based on a selection on the sitemap for example.

But this is not working…

Sorry if it is not clear enough :neutral_face:

That´s not how it works, as NCO already stated . You need to trigger run, not input. And you need two things, one for ON and one for OFF. In the things you put the matching argument for the script.

Hello Alexander,

Thanks for details, i implemented it as you and Gerland described and now it is working (Y)

But do you have any idea what is the input channel used for?