I am still migrating my system from oh34 to oh40.
Now I’m facing problems with the screen.viewAreaWidth property at openhab4.
It is often not working properly working, especially for smaller screens. In this case it is simply set to undefined / nothing.
I don’t use screen.viewAreaWidth much, but a quick test simulating several different mobile screens didn’t demonstrate any problems.
You’re going to need to see if you can narrow down/replicate the problem. Does this just happen with a browser (if so which do you use)? Does it happen only in the mobile APP (again, which one)?
Can you post the code of one of the widgets where it doesn’t work?
The label is correctly showing the width.
But as soon as the width is getting lower then 600 the value gets undefined and the label is showing nothing.
I see that sometimes I get the correct values for example 1660, sometimes I just get 0 even if it should be 1660. I have this problem on my desktop computer in Chrome, in Firefox and at my Android tablet.
The problems comes and goes with a simpel page refresh (F5).
The side I have the problem on is pretty complex. It looks for me like the variable screen is not set at the time the widget is build sometimes.
If I refresh the page I sometimes see the value printed at 0 and then just changing to 1660 before the widget is then shown on firefox and chrome.
So we are three users with the problem now.
Something needs to make sure that the widgets are not build before the variable is set.