Open Linux programs with App for Smartphone

Hi, I just met Openhab.

I would like to know, if I install Openhab on ubuntu, for example, if it is possible to somehow create commands on Openhab to open programs of the operating system itself through the smartphone app?

Would it be possible, for example, to open the system browser, with shell script or something?

Thank you very much in advance.

Hi Paulo, welcome to the community.

If I understand you correctly, you’re asking if you will be able to push a button on the phone app that then runs a program on the server running openhab. The answer to that is yes.

Have a look around the forums, there are many different solutions to this question. But, one of easiest, perhaps is with rules. From within openhab rules, which run in response to many things including actions performed in the phone app, you can run system commands.

1 Like

I believe with exec binding yes

1 Like

Thanks JustinG,

That’s what I want.

A friend of mine set up a media server with Xubuntu, and I’m helping him find a way to open the programs he uses to watch movies and everything, with his smartphone. And I ended up finding Openhab, and I was curious if I could use it for that.

I already managed to do this process with Triggercmd, but it is paid to use without restrictions.

I even tried exec binding, but I still haven’t been successful.

I don’t think I set it up correctly.

I have found it is easier to write out a shell script and exec that vs the command in OH. Another thing to consider you could leverage Ansible to interface to the server, I have a virtual item that controls a playbook to block/unblock YouTube from Habpanel its not fast but it saves me from opening up a laptop/power on the desktop to update the pihole that does some limiting controls to lock things down on younger audiences.

1 Like

I even made a simple script to open the system calculator, just for testing. I tried to execute it with exec binding, but I haven’t succeeded yet.

If you are not interested in things like the return status of your command then it is probably easier just to use the executeCommandLine function in the rule instead of the exec binding.

executeCommandLine("command to run your script here")

Just make sure, since you’re using Xubuntu, that if the command requires elevated privileges, you have some solution to that, (e.g., add the command to the sudoers file)