Please help test fix for image and chart refresh in classic web UI

I’ve made some changes to the classic UI (for both openHAB 1.8 and 2.0 beta) that should fix the web client’s failure to respect the refresh= parameter on Chart and Image widgets in sitemaps. In both openHAB 1.8.1 and Eclipse SmartHome, the Classic UI will only refresh images and charts under very specific circumstances, and usually only briefly. With this change, all images and charts should refresh at the rates given in the sitemap.

I would like help testing this fix, in order to be completely certain it solves the problem and does not introduce new issues.

openHAB 1.8 (code changes)

  1. Stop the server
  2. Move the file server/plugins/org.openhab.ui.webapp_1.8.*.jar to a temporary directory.
  3. Download org.openhab.ui.webapp-1.8.2-SNAPSHOT.jar and put it in your addons directory.
  4. Restart the server
  5. Point your browser to a sitemap that has images and/or charts that are set to refresh.
  6. Exercise the sitemap thoroughly, comparing observed refreshes and network traffic to expected behavior.

openHAB 2 beta (Eclipse SmartHome) (code changes)

  1. Issue the command bundle:list | grep WebApp at the openhab> prompt.
  2. Uninstall the bundle “Eclipse SmartHome WebApp UI” by its ID using bundle:uninstall XXX, where XXX is the bundle ID from step 1.
  3. Shutdown the openHAB 2 server using the shutdown command at the openhab> prompt.
  4. Download org.eclipse.smarthome.ui.classic-0.8.0-SNAPSHOT.jar and put it in your addons directory.
  5. Restart the server
  6. Using the Classic UI, point your browser to a sitemap that has images and/or charts that are set to refresh.
  7. Exercise the sitemap thoroughly, comparing observed refreshes and network traffic to expected behavior.

Please report all problems here.

Thanks very much for helping test this potential fix!

Thank you very much @watou. I encountered this issue the last days as I integrated my network cameras into openHAB 1.8.1. The refresh is working well on the android app for all my 4 camera images. On the iOS app only the first image is updating and on my chrome browser no image will be refreshed.

I will give the 1.8.2 snapshot a try tonight.

Unfortunately the webapp does not start for me (OH1 1.8.1#202) at all.

Was there anything different about the steps to try it than what I outlined? To which directory did you move the file server/plugins/org.openhab.ui.webapp_1.8.1.jar? Is the file ownership and permissions on the test JAR suitable? What appears in the log, anything?

The MD5 hashes for the test JAR files are:

MD5 (org.eclipse.smarthome.ui.classic-0.8.0-SNAPSHOT.jar) = 863791effada01bf78c7731997ed3c4c
MD5 (org.openhab.ui.webapp-1.8.2-SNAPSHOT.jar) = 4d9c655dec610f000e1608509ddd1c33

(Updated JARs and MD5 hashes to match here.)

I put the old .jar far away :slightly_smiling: to ~/
But for org.eclipse.smarthome.ui.classic-0.8.0-SNAPSHOT.jar, there is no such a file in my ./server/plugins folder

In fact, I have exactly two files with .ui in the name at this place,

org.openhab.ui_1.8.0.201601090202.jar
org.openhab.ui.webapp_1.8.0.201601090202.jar

So maybe I have to update to the most recent nightly, but sadly this would break my Classic UI dimmer Sliders.

That JAR is only for openHAB 2. I provide two different JARs, one for each of the current runtimes. If you are running openHAB 1.8, you only want to put org.openhab.ui.webapp-1.8.2-SNAPSHOT.jar in your addons folder. Regarding the recently reverted dimmer and KNX, is there an issue open on this?

Ah, my mistake :slightly_smiling: MD5 for org.openhab.ui.webapp_1.8.2-SNAPSHOT.jar is correct, ownership and permissions are the same as of org.openhab.ui.webapp_1.8.0.201601090202.jar

This line does only appear with the old version in openhab.log:
2016-02-29 11:12:49.663 [INFO ] [.o.u.w.i.servlet.WebAppServlet] - Started Classic UI at /classicui/openhab.app
Even with start_debug.sh there is no line from [.o.u.w.i.servlet.WebAppServlet] when using the 1.8.2-file

for dimmer issue, see here and here

So what do you get in the browser, a 404?

So issue #635 could have been closed after the new slider was implemented, and now that the new slider was reverted, #635 is now important again for dimmers to work with KNX?

If ever a dimmer should be dimmed with increase/decrease, this would fail for knx dimmers which need start/stop-dimming, so I think, issue#635 should be fixed anyway. Since the Sliders dimmed absolute, the issue didn’t matter but does now.

for the updated ui.webapp I get a 404 :expressionless:

I don’t know why that is. I didn’t think it would matter if you were using an earlier nightly build of 1.8 (the JAR replacement works here for me on 3 different openHAB 1.8.1 systems, and the other JAR works on openHAB 2). The file org.openhab.ui.webapp_1.8.2-SNAPSHOT.jar ought to be picked up in your addons folder as long as the equivalent bundle isn’t in server/plugins.

Argh…

That was the point I really missed :scream: I put the new file at server/plugins so this couldn’t work. Now as I read the instructions more carefully the openhab.app works properly - of course without the sliders :confused: so no luck for me :wink:
But I can confirm that the images and charts are refreshed as expected

1 Like

Thanks very much, @Udo_Hartmann. Hopefully 1) others will help test this, and 2) there is a solution for your KNX dimmers.

I will test this evening.

1 Like

Here is my feedback with the patch applied to openHAB 1.8.1.
My charts are now refreshed (so that is already clearly better) but:

  • when refresh occurs, an old chart (always the same) is first displayed and then few second after the new chart with the correct values is displayed
  • my refresh rate (5s) seems to not be the one applied. I have 3 visible charts in the page with different refresh rates so it is not not obvious to check. By the way, a refresh is triggering a scroll at top of the page and I can confirm that it does not occur every 5 seconds.

In this page, I have several visible and invisible charts. I should create a more basic page to give a more precise feedback.

This is possibly due to issues with cache busting in the /chart URLs not being very robust. I can see if I can improve that.

You could view your browser’s Developer Tools, switch to the Network tab, and watch the chart requests, to see if they seem to match the intended refresh cycle.

OK, but exercising possibly complex real-world sitemaps is very important. I have a very similar set of chart period buttons and different visibility= parameters in my sitemap, and it worked properly here, but if you have any chance of a problem, let’s find it!

Thanks for your help testing.

The chart that is first displayed before being replaced by the correct one at each refresh is apparently the chart that was first displayed when opening the page.
I am using Firefox.

I’ve updated org.openhab.ui.webapp-1.8.2-SNAPSHOT.jar to perform better cache busting for image and chart URLs. This might fix what you witnessed with older charts appearing briefly, @lolodomo.

There is also the issue with the sitemap page refreshing in the browser, right around every minute and when the image could be refreshing, so it ends up hitting the /chart servlet twice in quick succession. But with working cache busting in this new JAR, it should not be noticeable now (more than the flicker of the page as it reloads, which is a different subject).

MD5 (org.openhab.ui.webapp-1.8.2-SNAPSHOT.jar) = 4d9c655dec610f000e1608509ddd1c33

I can confirm that with this last jar the chart is first erased and then displayed few seconds later, probably the time required to download the png (my server is running on a RPI 1). This point is OK now.

What remains strange could be the refresh rate.
I have first to understand the timings in the Network tab of the developer tools !

By the way, I realize that it makes no sense to define a refresh rate to 5s when rrd4j only save data every minute !

Just for information, I just tested with a RPI 2 and chart loading is really faster;