Host custom html page to trigger items out of openHAB

Hi, I’m looking for a solution to host a little webapp / html page directly out of openHAB, i.e. without the need of an additional webserver. It shall be used for a digital door plate / door station by showing the family name, a door bell icon to be pressed / touched and some small additional icons for the car charger, parcel box, etc.
The items to be controlled (incl. security measures) are all implemented in dedicated KNX hardware, which means I need to trigger an openHAB item via the REST-API, such as the door bell; or send a pin code which is then evaluated on the KNX side.
Long story short: Can I use openHAB to host a web page?

Thanks,
Klayman

To be honest that sounds like a standard openHAB UI ( either BasicUI or HABPanel).

Function wise for sure, but can I also have my own design? I don’t want the standard look and feel…

Using HABPanel there should be virtually no limit.

Normal html will run if placed in the html folder. Css works, javascript works, no php thou. Using js you can hit up the OpenHAB rest and do whatever you need

1 Like

Ok, will have a deeper look into it. Is it also possible to have different designs, e.g. one for the main visualisation and another one for the door station?

Speaking for HABPanel you could have a main setup, which is saved on the server and a setup used for a specific device which is saved on that device locally.

Have you tried placing your html files in.

/etc/openhab2/html

Then use the URL

{Host}:8080/static

??

If html site can use the rest API, you just use the url …/doc/

yesss, thanks. That was what I was looking for. Just started experimenting in etc/openhab2/html :slight_smile:

Best,
Klayman

1 Like

at a boy…

you can do just about anything you can do on a web page
also… you may want to check out HabPanel Viewer

I use both a custom web page for one display and HPV running on tablets

1 Like

Hi,
Can we display item states on the html page or change item states from the html page?
Can we have a text box that will update an item? For example, temperature/humidity setpoint
Can we have a button to trigger the beginning or end of something? For example, start/end a process that lasts for certain days/weeks.

I am aware of habpanel but for now I am exploring the use of html files, which would give me more flexibility imo.

I have worked with OH2.5 a little bit and comfortable working with things, items, rules, sitemaps etc. But I am a beginner working with html, css, javascript and also combining them with OH. Any help, examples, tutorials would be highly appreciated!

Study how BasicUI works if you want to write your own UI.

Sure. The UI manages a button, the rest is the business of OH rules.