No worries, the script takes ony a few milli seconds.
Now I’ve added a new item:
String execTestOutput {channel="exec:command:execTestThing:output"}
and a new rule:
rule "rule_exec_output"
when
Item execTestOutput changed
then
logWarn("rule_exec_output", "script echo:" + execTestOutput.state)
end
When the exec argument changes the output shows the echo from the script (the script starts with an echo of the current date and time):
2019-09-08 18:43:00.029 [ome.event.ItemCommandEvent] - Item ‘execTestItem’ received command 299,222
2019-09-08 18:43:00.039 [nt.ItemStatePredictedEvent] - execTestItem predicted to become 299,222
2019-09-08 18:43:00.060 [vent.ItemStateChangedEvent] - execTestItem changed from 299,221 to 299,222
2019-09-08 18:43:00.201 [vent.ItemStateChangedEvent] - execTestOutput changed from timestamp = 08.09.2019;18:37:00 to timestamp = 08.09.2019;18:43:00==> /var/log/openhab2/openhab.log <==
2019-09-08 18:43:00.056 [WARN ] [rthome.model.script.rule_exec_test 1] - update Logfile: 299,222
2019-09-08 18:43:00.210 [WARN ] [rthome.model.script.rule_exec_output] - script echo:timestamp = 08.09.2019;18:43:00
When the exec argument has not changed the output looks like this (the echo is missing):
2019-09-08 18:38:00.024 [ome.event.ItemCommandEvent] - Item ‘execTestItem’ received command 299,221
2019-09-08 18:38:00.029 [nt.ItemStatePredictedEvent] - execTestItem predicted to become 299,221==> /var/log/openhab2/openhab.log <==
2019-09-08 18:38:00.025 [WARN ] [rthome.model.script.rule_exec_test 1] - update Logfile: 299,221
This looks to me like the script is not executed when the argument has not changed.