State refresh after changing an item

Yes, I already have SSL client certs up and running. Even my crl works.
It’s just the refresh issue with App, Basic UI and Paper UI.

Debugging the REST API in openHab I saw that Classic is using SSE (which is working) and Basic UI does not.

I’m not using client certs nor am I using apache or nginx (I use HAProxy as that’s what’s on pfSense) but…

I frequently see this when I use BasicUI through the proxy.

image

And I can confirm that if I modify an element (e.g. a setpoint) that the commands are received but the UI does not update immediately. It will update eventually though.

I’ve only set this up to learn so I don’t really use it and will likely shut it down soon so I never really paid attention to this. But I can confirm the behavior at least with HAProxy.

NOTE: this is through Chrome on a Windows machine. I access OH through VPN on my Android so can’t say what the app behavior would be.

So this looks like it is not a proxy problem with apache but, as confirmed when setting the log level for the REST API to debug, a different way of subscribing to events in Basic and Classic UI.

But … both these methods work for other people. Both these methods work for you locally. The BasicUI (and I expect likely other UIs) give you a problem with remote access. I wouldn’t know if its proxy or firewall or whatever, but the problem lies in your setup somewhere.

I’m experiencing the same problem with basic UI with my PC when from outside I access through apache as reverse proxy.

I thought was related to my apache misconfigured and I postpone it to further investigations.

I think could be related to the SSE protocol (or whatever the basic UI is using to receive messages without reloading the page) not passing the reverse proxy…maybe some missing module/directive in apache for that protocol…or maybe the basic authentication I have in place blocking some anonymous calls made by that protocol…just guessing.

I cannot tell for the Android app because I use myopenhab.org as external url.

I’m going to dig deeper soon.
There are differences in the way, the UIs and the App subscribe for event notification.
There is a difference in using the local reverse port 80 with user/password auth from a local PC compared to a local access over a VPN tunnel.
There is a difference in using port 80 or port 443, but not for all UIs.

I think it will take some time to analyze all the different debug logs.

1 Like

Please do. Thanks. I didn’t mean to say the reason for the faulty behavior is in your Apache setup alone. Just that it’s not there all the time. But of course it can be in the page contents, browser, server, …
SSE is a prime candidate IMHO.
Checking the default openHABian nginx config, I saw this mentioned:
# proxy_buffering off; # openHAB supports non-buffering specifically for SSEs now

So please try nginx to see if that works.
If no check out these to see if that helps.
Not sure how to make OH/jetty set headers, though but there’s nginx-only variants, too.

1 Like

Yes. Classic UI uses long polling, Basic UI uses SSE. The app uses SSE when talking to OH2 and long polling when talking to OH1.