Hi,
I was searching for a way to use the exec-binding (openHAB 1.x) together with the setpoint element to create an easy way to show a value and modify it, e.g for volume control, temperture-set, etc.
The posts I found where always referring to a combination of number items and rules to make this work.
After some more research I found the following way which I would like to share:
Create php file and hand over parameters via argument $argv[x] to carry out the actual command for the change:
<?php
$Raum = $argv[1]; //FixedArgument1
$SollTemp = $argv[2]; //Variable Argument handed over by openHAB via %2$s
.....
?>
Create number-item using the hand-over parameter %2$s used by openHAB:
Number TemperaturBadSollSet "Bad Soll Set [%.1f °C]" {exec="<[php /data/.apps/Controme/ContromeTempSoll.php Bad:5000:REGEX((.*?))] >[*:php /data/.apps/Controme/ContromeTempSet.php Bad %2$s]"}
Note that <[php file.php:5000:REGEX((.?))] is used to get the actual value of the parameter to be set and >[:php file.php FixedArgument1 %2$s] is used to execute the change command together with the newly set parameter by setpoint in the sitemap.
The actual sitemap element looks like this:
Setpoint item=TemperaturBadSollSet step=0.5 minValue=15 maxValue=26 icon="TemperaturSensor"
The syntax of openHAB to carry out this command is found under https://github.com/openhab/openhab1-addons/wiki/exec-binding and looks like this:
exec=">[<openHAB-command>:<commandLine to execute>]
Here the openHAB-command is simply replaced by a *.
Maybe it helps someone.
Cheers