Is the piXtend binding available for OpenHab2?

Anyone using or have experience with the piXtend binding? I have the piXtend board built and openHab2 installed and ready to go. But I’m not seeing the binding in the Paper’s UI Extensions anywhere?

You might need to enable the experimental bindings in the Configrations -> System -> Manage Extensions (or something like that) in PaperUI. If it still isn’t listed, follow the “Installing Unofficially Supported openHAB 1.x Addons” section of the Migration tutorial.

Thanks @rlkoshak! I can’t find the source code to the pixtend binding? It seems to me like it was never finished. I’ve looked in the 1.x bindings, it’s oddly not there. @rlkoshak I’ve seen you reply a lot, and I’ve learned a lot from your posts, so thank you!!!

There is a nice java library that is pointed to on the wiki site for the pixtend binding, but again I can’t find the actual source code for the binding itself, anywhere.

I guess I’m leaning on developing a pixtend binding myself, unless you can point me in a better direction. The PiXtend expansion board is awesome! The board comes with some command-line linux tools, written in C, but I have to execute them with ‘sudo ./’ and for some reason I can’t get the EXEC binding to reply anything from it. It’s a lazy approach anyways, I’d rather use actual binding code.

for example:
{exec="<[sudo ./opt/ppixtend/pixtend-pxdev/pixtendtool/pixtendtool -di:60000:REGEX((.*?))]"}

not sure how sudo works in exec binding either…

any thoughts, would be greatly appreciated!

If it isn’t listed anywhere in cloudbees or the openhab1-addons repository it never made it to “official binding” status. If that is the case it is anyone’s guess where or even if the binding source code is anywhere. If it was left unfinished that is almost certainly the case.

Remember the Exec binding is running as the openhab user. Is openhab in sudoers? If you actually want to see the output from the script, particularly if it fails, use val results = executeCommandLine(<cmd>, <timeout>) where <cmd> is the script to execute and <timeout> is the amount of time in milliseconds to wait for the command to finish before giving up on it. You can then log results.

The ./ is standard Linux path stuff. You don’t have the current directory in your path, which is pretty standard. However, from looking at your path of what you are actually executing I don’t think the ./ is appropriate here. I honestly don’t know from what directory openhab is running from when started standardly, but assuming your script is located in /opt, you should drop the . and just use /opt/ppixtend/.... This is the full path as opposed to a relative path.

Could you please explain further how to do this?

Create a Rule that triggers on some Item.

rule "Some rule"
    Item MyTriggerItem received command
    val results = executeCommandLine("sudo ./opt/ppixtend/pixtend-pxdev/pixtendtool/pixtendtool -di", 5000)
    logInfo("Test", results)