HTML layouts in OH2

Hi everyone,

I just changed from 1.8 to OH2 and I am trying to set up the weather html layout.

In OH2 apparently there is not webapp folder, so how is it done then? Where do we have to move our layout?

I read some other topic where someone say it is on conf/html/ but in I am not able to make it work, and if this is the right place, the structure inside keeps being the same? (images folder, and layouts folder).

In other words, how can we have an HTML view for our weather?

Thanks for your help.

same for me. The wiki even says:

Using the layout file:
You must specify a locationId and a layout parameter, iconset is optional (default=colorful)
Either directly:
or in a sitemap:
Webview url="/weather?locationId=home&layout=example&iconset=colorful" height=7

(This does not work for OpenHAB2 and this WIKI needs an update for how to use this on OH2)

I get the error about the layout file not being found:


Problem accessing /weather. Reason:

Server Error

Caused by:

javax.servlet.ServletException: File with weather layout ‘example.html’ does not exist, make sure it is in the layouts folder ./webapps/weather-data/layouts
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.eclipse.jetty.servlet.ServletHolder.handle(
at org.eclipse.jetty.servlet.ServletHandler.doHandle(
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.eclipse.jetty.server.session.SessionHandler.doHandle(
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(
at org.eclipse.jetty.servlet.ServletHandler.doScope(
at org.eclipse.jetty.server.session.SessionHandler.doScope(
at org.eclipse.jetty.server.handler.ContextHandler.doScope(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at org.eclipse.jetty.server.Server.handle(
at org.eclipse.jetty.server.HttpChannel.handle(
at org.eclipse.jetty.server.HttpConnection.onFillable(
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
at org.eclipse.jetty.util.thread.QueuedThreadPool$
Powered by Jetty://

I run OH2 as a service with an installation via apt-get. So, my configurations live in “/etc/openhab2”, and the runtime is in “usr/share/openhab2”. Neither of those locations have a webapps folder, so I tried adding this to both locations with no success. As suggested, I also put the “weather-data” folder in “etc/openhab2/html”, but the error stays. Any ideas on the correct locations and the correct webview url?

You definitely want the weather.html file in the conf/html folder. In the sitemap try somethign like:

Webview url="/static/weather.html"

Or it might be url=http://localhost:8080/static/weather.html

Either way, I’m pretty sure that’s what I have done with my test bed setup of OH2

would be wonderful if you could take a look at how you set it up if you still have the system available. None one the suggestions you had solved the problem for me.


Hey, I have:
Webview url=“” height=11

But that isn’t viewable from a remote connection (I haven’t set up my.openhab) so it needs review.

Right. How did you set up the folder structure under /html? In the wiki for the weather binding, there is a zip which has “weather-data” as the top folder with “images” and “layouts” as the subfolders. None of them have a “weather.html” so that url is probably not going to work,

Here comes my try:

Just to be sure I copied the folders under /html/ and under /html/weather-data/

In the file README.TXT it says that the right way to make the call is:

In my case this is what happens:

The binding says that the “example.html” file can not be found on /webapp/weather-data/layout (which is the old path for OH 1.8)

I tried what @pahansen wrote using the following ulr: 

And this is what I get:

I can display the “example.html” but is not bound to any information.

First big question, is this even working in OH2.** Has somebody it working?**

Fair call, I didn’t use any css and just dumped the html file in the html folder. I don’t use this in my sitemap at the moment so never spent any time making it pretty.

Which means it never worked for you on OH2…?

My map.html file works/ed fine for my mqtt owntracks setup in OH2. I just assumed the weather html worked too, but don’t think I ever actually loaded it up, before deciding I wanted to start my weather items from scratch.

not sure if this is the right way, but I created an Issue just now:

I’m guessing this needs fixing in the html layout files.


Don’t you think this issue should be in OH2 or OH2-addons distro? Right now you created the issue in OH1 distro.

I believe I put this in the general openhab source issues. You are right, This might be more specifically addressed in the OH2 addons section. I guess the maintainers can move it accordingly.

openhab/openhab is the right place, because this is where code of the weather binding is located.

whew :wink:

the issue doesn’t generatea lot of interest though. Is the binding orphaned?

I put html to /conf/html folder, and included it in sitemap as:
Webview url="/static/example.html"
As far as i can see, the content is just static HTML, it does not replace dynamic content.

I experimented with this tonight and found that placing a “webapps” directory containing the “weather-data” directory under userdata gets the right weather values populating. eg.


The images aren’t being loaded, however. I guess that could be a proxy problem in OH2 ?

So, it turns out you can fix the image problems by dropping all the static content off in the conf/html directory and update the layout file with the correct paths:


It still dosn’t work for me - html layout is shown on sitemap but without item value. Can you explain your method once again ? What is the trick to get item values ?