I just switched from OH 1 to OH 2.and currently have the problem that executeCommandLine statements in rules aren’t executed like they were in OH 1.
I installed OH 2 from apt-repository (raspbian) and created all items, things, etc. new (no migration from OH 1).
The item simply looks like that:
In the sitemap the item is used as following:
Selection item=light_hue_light_2_num label="hue 2 level" mappings=[0="OFF", 25="25%", 50="50%", 75="75%", 100="100%"]
The part of rule which should be executed is this:
val results = executeCommandLine("/etc/openhab2/scripts/hue_set_level.pl@@2@@50") logInfo("Exec", "Results from level to 50:\n" + results)
I can see that the rule is executed, but its result shown by
logInfo is always
null - even if a execute
The user itself can run the script successfully.
Has the function of
executeCommandLine been removed from OH 2 ?
Another approach would be to use the Exec-Binding. But do I understand correctly, that its purpose is to run system commands repeatedly and not on demand?
It would be great, if you could help me. Thanks and regards,