After many years of using OpenHab1 and carefully avoiding OpenHab2 because of the exec binding, I gave it a shot today.
Unfortunately I am already stuck after a couple of hours.
I want to run a php script which hand over a parameter. I hoped to use “things”, “items” and “sitemaps” in such a way that in things I would define the hand over parameter as %2$s in things and either in items or in sitemaps I would define this parameter to receive the status of an item (in this case a temperature).
Thank you for your fast reply.
Unfortunately the input parameter does not change but is defined differently in individual positions in sitemaps.
Maybe I could not explain myself fully, so I try again:
I want to hand over a parameter one time (name of room) and this parameter shall be defined in sitemap or items. This parameter defines the room where I want to have the temperature from. However, the status of this room temperature shall be updated regularly.
Could I express myself?
Thank so so much.
(Stuart Hanlon, UK importer of Velbus hardware)
I’m sorry, I don’t understand what you’re trying to achieve.
Your question implied that you wanted to pass an input to an script, via the exec binding.
Or are you trying to get the output of your script to display in your UI?
There is absolutely nothing preventing you from continuing to use the Exec1 binding.
You can’t link the same Item to both the Input and the Output Channel of the Thing. You need one Item linked to the input channel. Anything that Item gets set to will replace the %2$s in the command. The result from calling the script will be set to a separate Item linked to the Output Channel.
The interval and autorun parameters can only be defined on the Thing. You cannot define them on the link in the Item.
Then you must write Rules to pass these parameters to the Item linked to the Input channel. This will kick off the script and the result will be set to the Item linked to the Output Channel.