openHAB 4.0 Milestone discussion

Running today’s build, it’s not possible to setup myopenhab.org-access. The portal connects successfully and shows online, the openhab.log shows the same.

However, when trying to load the local instance over https://home.myopenhab.org or the android app, it fails after a long time. In the browser it’s showing 504 gateway timeout.

openhab.log reveils:

2023-04-28 12:26:30.296 [ERROR] [io.socket.thread.EventThread        ] - Task threw exception
java.lang.ClassCastException: class org.json.JSONObject cannot be cast to class org.json.JSONObject (org.json.JSONObject is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @7127a6b2; org.json.JSONObject is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4e73eeb0)
        at org.openhab.io.openhabcloud.internal.CloudClient.lambda$15(CloudClient.java:358) ~[?:?]
        at io.socket.emitter.Emitter.emit(Emitter.java:117) ~[?:?]
        at io.socket.client.Socket.onevent(Socket.java:338) ~[?:?]
        at io.socket.client.Socket.onpacket(Socket.java:289) ~[?:?]
        at io.socket.client.Socket.access$100(Socket.java:24) ~[?:?]
        at io.socket.client.Socket$2$2.call(Socket.java:120) ~[?:?]
        at io.socket.emitter.Emitter.emit(Emitter.java:117) ~[?:?]
        at io.socket.client.Manager.ondecoded(Manager.java:431) ~[?:?]
        at io.socket.client.Manager.access$1600(Manager.java:30) ~[?:?]
        at io.socket.client.Manager$7.call(Manager.java:407) ~[?:?]
        at io.socket.parser.IOParser$Decoder.add(IOParser.java:105) ~[?:?]
        at io.socket.client.Manager.ondata(Manager.java:423) ~[?:?]
        at io.socket.client.Manager.access$1000(Manager.java:30) ~[?:?]
        at io.socket.client.Manager$2.call(Manager.java:374) ~[?:?]
        at io.socket.emitter.Emitter.emit(Emitter.java:117) ~[?:?]
        at io.socket.engineio.client.Socket.onPacket(Socket.java:551) ~[?:?]
        at io.socket.engineio.client.Socket.access$1000(Socket.java:36) ~[?:?]
        at io.socket.engineio.client.Socket$5.call(Socket.java:335) ~[?:?]
        at io.socket.emitter.Emitter.emit(Emitter.java:117) ~[?:?]
        at io.socket.engineio.client.Transport.onPacket(Transport.java:126) ~[?:?]
        at io.socket.engineio.client.Transport.onData(Transport.java:118) ~[?:?]
       at io.socket.engineio.client.transports.WebSocket.access$100(WebSocket.java:24) ~[?:?]
        at io.socket.engineio.client.transports.WebSocket$1$2.run(WebSocket.java:71) ~[?:?]
        at io.socket.thread.EventThread$2.run(EventThread.java:80) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

Any ideas? Thanks :slight_smile:

Can you please post the output of list -s -t 0 | grep -i json? And do you have the ambientweather binding installed?

I’ve just updated to Openhab 4.0 M2 from Openhab 3.
But I can’t get the Samsung binding to work.

have a look at the last line of the logs …org.openhab.binding.samsungtv_3.3.0.202112301538…
was the binding installed correctly? Because the version is still 3.3.x

2023-04-30 13:45:53.230 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'samsungtv:tv:f88b2309-44ad-4e5c-b2c1-2d61a1260cbe' changed from UNINITIALIZED (HANDLER_INITIALIZING_ERROR): org/openhab/core/service/AbstractWatchService to UNINITIALIZED
2023-04-30 13:45:53.236 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'samsungtv:tv:f88b2309-44ad-4e5c-b2c1-2d61a1260cbe' changed from UNINITIALIZED to UNKNOWN
2023-04-30 13:45:53.240 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'samsungtv:tv:f88b2309-44ad-4e5c-b2c1-2d61a1260cbe' changed from UNKNOWN to UNINITIALIZED (DISABLED)
==> /var/log/openhab/openhab.log <==
2023-04-30 13:45:54.543 [DEBUG] [tv.internal.handler.SamsungTvHandler] - 192.168.188.24: Create a Samsung TV Handler for thing 'samsungtv:tv:f88b2309-44ad-4e5c-b2c1-2d61a1260cbe'
2023-04-30 13:45:54.552 [DEBUG] [tv.internal.handler.SamsungTvHandler] - 192.168.188.24: Initializing Samsung TV handler for uid 'samsungtv:tv:f88b2309-44ad-4e5c-b2c1-2d61a1260cbe'
2023-04-30 13:45:54.557 [DEBUG] [tv.internal.handler.SamsungTvHandler] - 192.168.188.24: Updated artModeSupported: false and PowerState: true
2023-04-30 13:45:54.558 [DEBUG] [tv.internal.handler.SamsungTvHandler] - 192.168.188.24: Check and create missing services
2023-04-30 13:45:54.559 [DEBUG] [nternal.service.MediaRendererService] - 192.168.188.24: Creating a Samsung TV MediaRenderer service
2023-04-30 13:45:54.559 [DEBUG] [tv.internal.handler.SamsungTvHandler] - 192.168.188.24: Started service for: QE65Q80TATXXH, MediaRenderer (f88b2309-44ad-4e5c-b2c1-2d61a1260cbe)
2023-04-30 13:45:54.559 [DEBUG] [rnal.service.RemoteControllerService] - 192.168.188.24: Creating a Samsung TV RemoteController service: is UPNP:false
2023-04-30 13:45:54.560 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.samsungtv.internal.handler.SamsungTvHandler@1e9b85': org/openhab/core/service/AbstractWatchService
java.lang.NoClassDefFoundError: org/openhab/core/service/AbstractWatchService
	at org.openhab.binding.samsungtv.internal.protocol.RemoteControllerWebSocket.<init>(RemoteControllerWebSocket.java:177) ~[?:?]
	at org.openhab.binding.samsungtv.internal.service.RemoteControllerService.<init>(RemoteControllerService.java:95) ~[?:?]
	at org.openhab.binding.samsungtv.internal.handler.SamsungTvHandler.createNewService(SamsungTvHandler.java:637) ~[?:?]
	at org.openhab.binding.samsungtv.internal.handler.SamsungTvHandler.createService(SamsungTvHandler.java:607) ~[?:?]
	at org.openhab.binding.samsungtv.internal.handler.SamsungTvHandler.checkAndCreateServices(SamsungTvHandler.java:575) ~[?:?]
	at org.openhab.binding.samsungtv.internal.handler.SamsungTvHandler.initialize(SamsungTvHandler.java:443) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) ~[?:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: org.openhab.core.service.AbstractWatchService cannot be found by org.openhab.binding.samsungtv_3.3.0.202112301538

How did you install it? From the version it looks like a snapshot, maybe you installed it by dropping a file in the addons folder?

That aside: this version can’t run on OH4 because there is no AbstractWatchService in openHAB.

I installed it from the ui.

In the past I tried several Samsung Add-Ons from the Marketplac, maybe I’ve some kind of orphan here.

This is the installed Binding in the UI

And this is my current addon folder:

please show the output of list -s -u | grep -i samsung

I’ve just started again with my Backup of the openHAB 3.4.2 - Release Build.

I figured out, that I was using a beta version of the Samsung Binding from the marketplace:

Now I’ve removed the Samsung Binding Beta before upgrading to 4.0 M2.
After upgrading, I installed the Samsung Binding (not Beta, but the official) and now everthing concerning Samsung works.

But now I figured out, that the twinkly Binding from the Marketplace is vanished.

Hi all

I have one question regarding the removal of NashornJS, just to make sure I undestand it correctly.

I have several ECMA-2021 Edition 11 Scripts. (type: application/javascript;version=ECMAScript-2021)
For this scripts, do I have to switch the type to 5.1 and install the Nashorn Addon or should they run without issues after upgrade to OH4?

As part of the upgrade to OH 4 it should change the mime type accordingly. If not, you can manually change the type to application/javascript. It is now Nashorn that will have the non-standard mime type. I believe those should be application/javascript;version=ECMAScript-5.1 or something like that.

FWIW I have most of my rules of type application/javascript;version=ECMAScript-2021 from 3.x and they all seemed to continue to work without changing the type to remove the explicit version so I’m not sure if there’s a downside from leaving it but new java 11 rules should probably just be application/javascript

Hi,

My javascript JS Rule rules that use ‘GroupStateUpdateTrigger’ no longer fire since upgrading to OH4.
GroupStateChangeTrigger seems to work.
Has something changed? Or could something else be happening? I tried searching but couldn’t find an answer.

There’s a new GroupStateUpdatedEvent (or something like that) but my understanding is that the existing events should still work as they always have.

This should be fixed with Fix wrong event subscription in GroupStateTrigger and ItemStateTrigger by J-N-K · Pull Request #3533 · openhab/openhab-core · GitHub.

1 Like

Not sure if I diagnosed it wrong, or if I’m doing something different now, but it seems that both ‘GroupStateChangeTrigger’ and ’ GroupStateUpdateTrigger’ fire properly, but I can only get .name, .newState etc from ‘GroupStateChangeTrigger’

I’m on OH4.0.0M2
Should I have this fix now?

That contains the fix, but I believe it is still wrong. Unfortunately I don’t have a test environment at the moment. Would you like to test something?

Found my problem

Had this set wrong while I was using the 4.0.0 snapshot before it was working properly.

Things seem to be responding properly now I have things set as shown in the pic

The openhab-js version in your node_modules directory seems to be to old to include [rules] Adjust event object for recent core changes by florian-h05 · Pull Request #260 · openhab/openhab-js · GitHub which is required to adjust to that core change linked above.
If you use the internal version (as set up now), you don’t have to take care of such compatibility stuff, the addon always ships a the newest compatible and version as of openHAB release time.

since openhab 4M2 I got this error, when I log into cli console.

openhabian@openhabian:~ $ sudo openhab-cli console

Logging in as openhab
Password:
Failed to load native library:jansi-2.4.0-84cbb1dab62f27a6-libjansi.so. osinfo: Linux/arm
java.lang.UnsatisfiedLinkError: /var/lib/openhab/tmp/jansi-2.4.0-84cbb1dab62f27a6-libjansi.so: /var/lib/openhab/tmp/jansi-2.4.0-84cbb1dab62f27a6-libjansi.so: cannot open shared object file: No such file or directory
1 Like

A similar message was reported before and could be fixed by using “fix permissions” of openhabian-config. Did you try that?