Need to get nice GUI on Android

He There. Sorry if this topic was raised already. The problem is that I feel Habdroid as a bit too less user friendly as I want it to be. I’m trying to automize my house with OpenHAB and want to put simple controls on the entrance to each room to switch on and off lightning, setup heating and blinds, but since Habdroid has a bit primitive GUI, it will be complex for my family members (some of them are 70 years old, aome are just 3) to use the panel.
So my quiestion - can you suggest the best way to customize the GUI on Android? I want to have different main screen with couple of big buttons, then some special menus for heating and so on. Maybe custom icons.
If it’s done within Habdriod - well, but I need some hints where to start. If it is an external app - also OK.
Oh, forget - The problem of WebBased GUIs - I want to disable all other Android functionality in order to avoid switching to some other apps. So It should constantly show the home controls. But I tested Web connection and it seems it breaks connection to OpenHAB server after some time - so not really useable.
Thanks. Perhaps this thread can be used as a guide to create customized GUI for openHAB.

1 Like

I haven’t used it myself, but here is what looks like a project that is consistent with your objectives. The github project is here.

Thank you. Tried to test this one, Web Interface launched, but I stucked with connection problem to OpenHAB - it throws exception in Firefox -
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at (Reason: CORS-Header ‘Access-Control-Allow-Origin’ missing). I’m using OpenHab with security enabled.

Is this happening with openHAB 1.7.1? I know there was a fix in 1.7.1 for cross-origin requests.

I have the latest version of Openhab, got via apt-get. So I believe it’s 1.7.0, as 1.7.1 not released yet, right?

I tried it with 1.7.0, too, with the same results.
After 1.7.1 was released, it started working…

Bye, Frido.

Did you take a look at something like iRule?

or maybe even another home automation software that has a nice UI that you are looking for and then make it talk to OphenHAB using REST? A hairbain scheme i know but you still be using the powerful OpenHAB engine behind the scenes…

Not yet, but looks good. I like this concept of GUI Builders.
I’m evaluating iRidium Mobile now - but this is far expensive for DIY home automation. Maybe they will change their price politics.
Anyway I’m ready to give away some money for nice and customized GUI, which would work without lags. My evaluation of web-based Interfaces shows, that some lags there are always possible, so I don’t think that way would be right to go.

CommandFusion looks very nice… but i think its a little expensive too

Thank you for this also. But I would appreciate if with proposal you could provide experience feedback if that GUI is working with OpenHAB and how.
What I see, is that in most cases appropriate Driver/Binding for REST is missing and one needs to create it manually. It’s not a problem with commands, as POST/GET requests are usually supported from the box, but becomes a challenge with statuses feedback - you need to write special listener scripts, and each GUI has it’s own language…

Not wishing to plug my own thread :slight_smile: but in case you are interested, I have a dashboard running on Android using the REST API. Discussion here: Dashboard UI suitable for tablets.

1 Like

Any experience with ? It looks like a nice engine for building GUIs, which runs on Raspberry also

I’m really hoping for a nice Android UI as well. Material Design can look so great but the OpenHab approach of Material looks awful. :confounded:

I started to evaluate
Free Designer UI looks to work quite nice for iOS and Android.
For the interface I used HTTP and REST API description of OpenHAB.
In principle it works as follows:
To send command:
Option 1: use HTTP Protocol and select GET method. The URL then should look like this: http://openhab_IP:8080/CMD?item=state,
Option 2: use HTTP Protocol and select POST Method. The URL should look like this: http://openhab_IP:8080/rest/items/item
Content type: text/plain
Workload: state, e.g ON, or OFF.
I don’t know which option is better - both work OK.

To get status: create commend and use HTTP Protocol and select GET Method. The URL should look like this: http://openhab_IP:8080/rest/items/item/state
The polling interval should be set as required - openremote just polls the link periodically. Works quite OK, but probably will overload openHAB with requests if too many polls will be used.
There should be some better solutions - one would be a UDPListener in Openremote and UDP binding in openhab. This might work. Another one could be use of REST API streaming function, but I don’t know if it works with openremote.

Sliders are also work quite well - with feedbacks.

Done with OpenRemote - not really interesting, as in order for HMI to work I had to install OpenRemote Controller on Raspberry in addition to OpneHAB. Quite strange solution just for transfering commands from GUI to OpenHAB. Also it did not started on my RP2 from the beginning. So dropped it as too complex.

Alternative is CommandFusion and here, I think, I got luck. For standard panel UIs it’s completely free and not complex to setup, when you know the hints. I spent two days making it work, and finally got success. Using REST API I got:

  • Fully operational buttons with feedbacks
  • Indicators and text displays from OpenHAB measurements
  • Sliders with feedbacks.
    Everything works pretty smooth on iOS and Android. I can post here some instruction on how to make it work. Below is some example of already working features.

Please post your instructions on how to make it work on OH.


I did experiment with different UI’s on the tablet as well - but in the end came back to HABDroid. Anyhow, ImperiHome did also work well and might be a candidate for you:

So here is some instruction to make CommandFusion work with OpenHAB. It works using MQTT publish/subscribe mechanism(to avoid polling), so you need to setup MQTT broker and connect OpenHAB to it.

Link to a current version of MQTT Javascript.
It needs some improvements:

  • packet length is calculated a bit primitive way, and not according to MQTT standard
  • Security/Authorization to be added

Usage is quite simple:

  1. Add attached MQTT.js file to Project Script Manager of CF guiDesigner Project
  2. Create TCP System with link and port of your MQTT Broker. (Standard MQTT port is 1883). For Periodical Ping add \xC0\x00 as heartbit transmit command and \xD0\x00 as heratbeat receive command. Heartbeat mode should be Initiate Mode
  3. Create first two commands - MQTT_Connect and MQTT_Subscribe. Those should only have appropriate javascript code(example in script)
  4. Create a macro - MQTT_Start, which should call two commands above with 100ms Interval(first connect, then subscribe). Assign this macro to Startup macro in System Properties.
  5. Create single feedback with (.*) regex.

Use Add Command to generate publish messages. Just put MQTT_Publish function in Javascript field,according to example in script.
For example:

For switch:
Field Javascript: MQTT_Publish("/myhome/command/Light_FF_Bath_Ceiling/state",“ON”, system)

For slider:
Field Command Value:{{[sliderval]}}
Field Javascript: MQTT_Publish("/myhome/command/Temperature_Setpoint/state",data, system)
Do not forget to set “Javascript sends command value” flag

To process feedbacks:

  1. Create a UDP Socket Loopback system with IP
  2. As End Of Message Character define \x0D in System Properties of this system
  3. For each feedback create new feedback and in regex provide appropriate regex assuming that your incoming data in this case will have a look ike topic=value.For example:

That’s it.