I can execute the script from the BasicUI and it works fine - openHab can turn it on and off again. The strange thing is, that e.g. I have turned it on, it gets automatically turned off 20-30sec later and turned on again after the same time.
I executed my script without openhab and this is not the cause of this.
Could it be there is a loop defined ?
this could be for 2 reasons.
You press 1 button but actually 2 things trigger the script.
Some sort of loop inside your script ?
do you have 1 script for on and 1 script for off?
What exec binding version you use ?
That´s a good hint - I can see that events get triggered without me doing something:
2017-09-08 11:23:07.559 [ItemStateChangedEvent ] - Date_Time changed from 2017-09-08T11:22:07.537+0200 to 2017-09-08T11:23:07.537+0200
2017-09-08 11:23:15.492 [ItemStateChangedEvent ] - ST changed from OFF to ON
2017-09-08 11:23:21.802 [ItemStateChangedEvent ] - ST changed from ON to OFF
2017-09-08 11:24:07.557 [ItemStateChangedEvent ] - Date_Time changed from 2017-09-08T11:23:07.537+0200 to 2017-09-08T11:24:07.537+0200
2017-09-08 11:24:21.814 [ItemStateChangedEvent ] - ST changed from OFF to ON
2017-09-08 11:24:28.121 [ItemStateChangedEvent ] - ST changed from ON to OFF
I actually ran into the same issue and asked for some help here and after more fiddling found that the solution was to add interval=0 to the end of the thing entry. Included is an example from my own things file.