Sonos Play Overlay Audio Clips using local websockets

I’ll have a look if I can see anything Linux specific, but won’t promise anything since I don’t have any Windows system myself to verify against.

BR S

Hey @Seaside, any luck with look over for windows? im happy to be the ginny pig and test it out if needed :slight_smile:

There is nothing Linux specific in the addon anymore. You could test installing latest version of jrule (download jar file and place in addons folder), then install this addon. Chances are that it works.

@Seaside
i cant see any jar files that are from the last 3 months. only ones i can find are from 9th april

This error has to do with JRule not jrule-sonos. It might be fixed already. Can you test with the latest release of Jrule?

just tried the jars.(jrule-4.x.x-BETA21.jar in addons and jrule-sonos in openhab\conf\automation\jrule\rules-jar\jrule-sonos-alpha4.jar) but as i said. the jars in github for both are from back in april. before i posted the issue.
still getting the same issue as before.

2024-10-16 06:53:53.208 [INFO ] [on.jrule.internal.engine.JRuleEngine] - [JRuleEngine] Initializing Java Rule Engine with Separate Thread Executors min: 2 max: 10
2024-10-16 06:53:58.281 [INFO ] [tomation.jrule.internal.JRuleFactory] - [JRuleFactory] Initializing Java Rules Engine v4.0.0.202404081933
2024-10-16 06:53:58.281 [INFO ] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] Initializing Start Initializing JRule Automation
2024-10-16 06:53:58.282 [INFO ] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] Initializing JRule writing external Jars: C:\Program Files\openhab\conf/automation/jrule\jar
2024-10-16 06:53:58.282 [ERROR] [.internal.compiler.JRuleJarExtractor] - [JRuleJar] Failed to extract jar due to uri exception jarFilePath: C:\Program Files\openhab\conf/automation/jrule\jar\jrule.jar to: C:\Program Files\openhab\conf/automation/jrule\jar\jrule.jar
2024-10-16 06:53:58.283 [ERROR] [.internal.compiler.JRuleJarExtractor] - [JRuleJar] Failed to extract jar due to uri exception jarFilePath: C:\Program Files\openhab\conf/automation/jrule\jar\openhab-core.jar to: C:\Program Files\openhab\conf/automation/jrule\jar\openhab-core.jar
2024-10-16 06:53:58.368 [INFO ] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] Compiling generated sources

now that i see it and you have said it. it is with jrule not jrule-sonos the the errors are coming from. i will move the issue to the right git and post then :slight_smile:

I have a text based installation, running openhab 4.2.2 and installed JRule and the jar-file alpha4.
The following messages show up in openhab.log:

openhabian@Raspi4:/var/log/openhab $ grep jrule openhab.log
2025-06-08 17:47:55.117 [WARN ] [core.karaf.internal.FeatureInstaller] - The automation add-on 'jrule' does not exist - ignoring it.
2025-06-08 17:53:54.267 [INFO ] [on.jrule.internal.engine.JRuleEngine] - [JRuleEngine] Initializing Java Rule Engine with Separate Thread Executors min: 2 max: 10
2025-06-08 17:53:59.528 [INFO ] [tomation.jrule.internal.JRuleFactory] - [JRuleFactory] Initializing Java Rules Engine v4.0.0.202404081933
2025-06-08 17:53:59.529 [INFO ] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] Initializing Start Initializing JRule Automation
2025-06-08 17:53:59.537 [INFO ] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] Initializing JRule writing external Jars: /etc/openhab/automation/jrule/jar
2025-06-08 17:53:59.540 [INFO ] [.internal.compiler.JRuleJarExtractor] - [JRuleJar] Extracting jar: /etc/openhab/automation/jrule/jar/jrule.jar to: /etc/openhab/automation/jrule/jar/jrule.jar
2025-06-08 17:53:59.559 [INFO ] [.internal.compiler.JRuleJarExtractor] - [JRuleJar] Extracting jar: /etc/openhab/automation/jrule/jar/openhab-core.jar to: /etc/openhab/automation/jrule/jar/openhab-core.jar
2025-06-08 17:54:00.066 [INFO ] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] Compiling generated sources
2025-06-08 17:54:18.466 [INFO ] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] Creating jrule-generated.jar
2025-06-08 17:54:19.150 [INFO ] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] Compiling rules
2025-06-08 17:54:19.159 [WARN ] [rule.internal.compiler.JRuleCompiler] - [JRuleCompiler] Found no java rules to compile and use in folder /etc/openhab/automation/jrule/rules/org/openhab/automation/jrule/rules/user/
2025-06-08 17:54:19.212 [INFO ] [rule.internal.compiler.JRuleCompiler] - [JRuleCompiler] Number of classes to load in to memory: 175 folder: /etc/openhab/automation/jrule/gen
2025-06-08 17:54:19.495 [INFO ] [.jrule.internal.handler.JRuleHandler] - Instantiated JRuleItems class
2025-06-08 17:54:19.504 [INFO ] [.jrule.internal.handler.JRuleHandler] - Instantiated JRuleThings class
2025-06-08 17:54:19.511 [INFO ] [.jrule.internal.handler.JRuleHandler] - Instantiated JRuleActions class
2025-06-08 17:54:19.514 [INFO ] [rule.internal.compiler.JRuleCompiler] - [JRuleCompiler] Found no classes to load into memory in folder: /etc/openhab/automation/jrule/rules
2025-06-08 17:54:19.516 [INFO ] [rule.internal.compiler.JRuleCompiler] - [JRuleCompiler] Found java rules to load into memory in folder: /etc/openhab/automation/jrule/rules-jar
2025-06-08 17:54:19.568 [WARN ] [openhab.automation.jrule.rules.JRule] - [SonosLan] Failed to get IP for Thing: Port Wohnen2 may attempt later to get ip
        at org.openhab.automation.jrule.internal.compiler.JRuleCompiler.loadClass(JRuleCompiler.java:151) ~[?:?]
        at org.openhab.automation.jrule.internal.compiler.JRuleCompiler.lambda$1(JRuleCompiler.java:110) ~[?:?]
        at org.openhab.automation.jrule.internal.compiler.JRuleCompiler.loadClassesFromJar(JRuleCompiler.java:94) ~[?:?]
        at org.openhab.automation.jrule.internal.handler.JRuleHandler.createRuleInstances(JRuleHandler.java:312) ~[?:?]
        at org.openhab.automation.jrule.internal.handler.JRuleHandler.initialize(JRuleHandler.java:220) ~[?:?]
        at org.openhab.automation.jrule.internal.JRuleFactory.init(JRuleFactory.java:95) ~[?:?]
        at org.openhab.automation.jrule.sonos.SonosWsClient.<init>(SonosWsClient.java:52) ~[?:?]
        at org.openhab.automation.jrule.rules.user.SonosCoordinator.<init>(SonosCoordinator.java:29) ~[?:?]
        at org.openhab.automation.jrule.rules.user.SonosCoordinator.get(SonosCoordinator.java:44) ~[?:?]
        at org.openhab.automation.jrule.rules.user.SonosRuleModule.fetchThingAttributes(SonosRuleModule.java:96) ~[?:?]
        at org.openhab.automation.jrule.rules.user.SonosRuleModule.lambda$fetchSonosThingAttributes$5(SonosRuleModule.java:85) ~[?:?]
        at org.openhab.automation.jrule.rules.user.SonosRuleModule.fetchSonosThingAttributes(SonosRuleModule.java:85) ~[?:?]
        at org.openhab.automation.jrule.rules.user.SonosRuleModule.<init>(SonosRuleModule.java:26) ~[?:?]
        at org.openhab.automation.jrule.internal.handler.JRuleHandler$JRuleClassLoader.loadClass(JRuleHandler.java:545) ~[?:?]
        at org.openhab.automation.jrule.sonos.SonosWsClient.<init>(SonosWsClient.java:52) ~[?:?]
        at org.openhab.automation.jrule.rules.user.SonosCoordinator.<init>(SonosCoordinator.java:29) ~[?:?]
        at org.openhab.automation.jrule.rules.user.SonosCoordinator.get(SonosCoordinator.java:44) ~[?:?]
        at org.openhab.automation.jrule.rules.user.SonosRuleModule.fetchThingAttributes(SonosRuleModule.java:96) ~[?:?]
        at org.openhab.automation.jrule.rules.user.SonosRuleModule.lambda$fetchSonosThingAttributes$5(SonosRuleModule.java:85) ~[?:?]
        at org.openhab.automation.jrule.rules.user.SonosRuleModule.fetchSonosThingAttributes(SonosRuleModule.java:85) ~[?:?]
        at org.openhab.automation.jrule.rules.user.SonosRuleModule.<init>(SonosRuleModule.java:26) ~[?:?]
2025-06-08 17:54:19.651 [INFO ] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] JRule Engine Initializing done!
openhabian@Raspi4:/var/log/openhab $ 

I have several Sonos devices, and some are Offline (when the socket is without power), Sonos Thing “Port Wohnen2” is one of those.
No items or rules seem to be created, how can I further debug what is not working?

Can the items and rules alternativly be manually created, and how would an example for one Sonos Box look like?