OpenHABian: Control/Webserver + Custom UI possibilites?

Dear all,
I’m just starting with OH2, to see if it’s the right fit I tried to read as much in the forum as possible but would like to ask also for your feedback/inputs.
Set-Up Goal:
Home-Network with:

  • RaspberryPie 3+ running OpenHABian OR Raspbian as a Control/Webserver
    • Remote Access capability via reverse proxy
  • Running a separate Media-Server (e.g. Plex, Emby,…)
    • Controlling media-server via OpenHAB
  • Controlling various devices (lights, …) via MQTT
  • Creating own custom UI for the overall Home-Network (Media, Control, …)

My questions are related to the capabilities of OpenHAB as a Control Server as well as a Webserver:

  • If I understood this post (Advice about making a custom UI) well, any custom UI can communicate with OpenHAB via the REST APIs, correct?
    • What would be the advantages/disadvantages of REST API vs. a MQTT communication?
  • Assuming having an own Custom UI (probably written in React), would OpenHABian being able to host a react webapp? Or would I need to install (a full) nginx?
  • Reading about the reverse proxy with nginx (https://www.openhab.org/docs/installation/security.html#running-openhab-behind-a-reverse-proxy) it is already included in OpenHABian. Can this instance of nginx also be configured as a Webserver (hosting React)?

Or would you rather recommend to use Raspbian on the Pi and install OpenHAB in parallel to NGINX?

Thank you in advance for your feedback/inputs!

I strongly recommend against using a reverse proxy for remote access unless you are willing and able to do the sorts of monitoring and mitigation of the constant barrage of attacks you will experience simply by exposing a port to the Internet.

There are plenty of other options including:

  • myopenhab.org
  • running your own instance of the openHAB Cloud Server on AWS, Azure, etc.
  • OpenVPN using password and certificate authentication
  • SSH using password and certificate authentication

Yes.

You get REST for free. To use MQTT will require significant amount of configuration and perhaps some Rules. So MQTT will be significantly more work for this. And because pretty much all of the UIs that work with OH are web based UIs, REST is a much more native method of interacting with the server than MQTT.

It’s important to understand the differences between some of the nouns used here. openHABian (the “o” in openHAB is always lower case) is just a bunch of scripts that will configure a stock Raspbian Lite (or if you use the manual instructions any Debian based Linux distro) by installing and configuring OH and related third party apps like Mosquitto and Ngnx.

openHAB is the actual home automation server.

So yes, openHABian can of course host a React webapp. It’s just a slightly customized stock Raspbian OS. I don’t know enough about React to say whether or not openHAB can host it natively or whether you would need to run it on a separate web server like Node.js or Ngnx. I think PaperUI might use React so you can look at how it works for ideas perhaps.

Since you are talking about using Nginx as a reverse proxy, you may as well host your UI there since you will be running it anyway.

It’s just a stock Ngnx with a configuration already deployed to reverse proxy OH. So there is no reason why it wouldn’t be able to host anything else that you might want to on it.

That almost literally is exactly what openHABian is.

1 Like

Hi rlkoshak,
thank you very much for the detailed answer and helpful inputs.

I will have a look at the options mentioned by you for the remote access, I thought since the reverse proxy option is already provided in openHABian, it would be the “go-to” solution. Thanks.

The infos about openHABian helped also quite a lot to understand the build structure, which I must have missed reading the Documentation about it.

I will have a look at the webserver options, but using nginx for hosting the React webapp seems to be the simplest solution for the moment. “Just” need to make the REST API work then :wink:

Thanks again!

Well, my opinion about exposing ports to the Internet are not universal. I would like to think that given my credentials and career as a computer security professional my opinion would carry some weight.

But at the same time, a number of users are able and willing to take on the task of monitoring and dealing with the constant attacks and I see no reason why not to provide an easy way for them to set it up.

The openHABian docs I believe take no stand on whether it’s a good idea or not.

The go-to approach for remote access is myopenhab.org.