Seite 1 von 1

Kommunikationsfehler im Widget

Verfasst: 12. Feb 2024 19:46
von lukima61
Hallo Community,
ich habe seit der Umstellung von openHAB 3.4 auf 4.1.1 Probleme mit einem Widget. Das Widget dient dazu, ein numerisches Item schrittweise zu verändern, sowohl im positiven als auch im negativen Bereich. Ich setze das Widget dafür ein, um die aktuelle Temperatur eines Thermostates zu kalibrieren (-3 bis +3, Schrittweite 0.5).
Es funktioniert alles so wie geplant, aber von -0.5 zu 0 und von +0.5 zu 0 kommt die Meldung "Kommunikation fehlgeschlagen" auf dem Bildschirm.

Im Logfile wird folgendes ausgegeben:

2024-02-12 19:32:47.521 [ERROR] [rg.apache.cxf.jaxrs.utils.JAXRSUtils] - No message body reader has been found for class java.lang.String, ContentType: application/octet-stream
2024-02-12 19:32:47.743 [ERROR] [internal.JSONResponseExceptionMapper] - Unexpected exception occurred while processing REST request.
javax.ws.rs.WebApplicationException: HTTP 415 Unsupported Media Type
at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1581) ~[bundleFile:3.6.2]
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processRequestBodyParameter(JAXRSUtils.java:1058) ~[bundleFile:3.6.2]
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:989) ~[bundleFile:3.6.2]
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:215) ~[bundleFile:3.6.2]
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:79) ~[bundleFile:3.6.2]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) ~[bundleFile:3.6.2]
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) ~[bundleFile:3.6.2]
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) ~[bundleFile:3.6.2]
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) ~[bundleFile:3.6.2]
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) ~[bundleFile:3.6.2]
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) ~[bundleFile:3.6.2]
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225) ~[bundleFile:3.6.2]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:304) ~[bundleFile:3.6.2]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:217) ~[bundleFile:3.6.2]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:517) ~[bundleFile:4.0.4]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:279) ~[bundleFile:3.6.2]
at org.ops4j.pax.web.service.spi.servlet.OsgiInitializedServlet.service(OsgiInitializedServlet.java:102) ~[bundleFile:?]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656) ~[bundleFile:9.4.52.v20230823]
at org.ops4j.pax.web.service.spi.servlet.OsgiFilterChain.doFilter(OsgiFilterChain.java:100) ~[bundleFile:?]
at org.ops4j.pax.web.service.jetty.internal.PaxWebServletHandler.doHandle(PaxWebServletHandler.java:320) ~[bundleFile:?]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:234) ~[bundleFile:9.4.52.v20230823]
at org.ops4j.pax.web.service.jetty.internal.PrioritizedHandlerCollection.handle(PrioritizedHandlerCollection.java:96) ~[bundleFile:?]
at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:722) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) ~[bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) [bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) [bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) [bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [bundleFile:9.4.52.v20230823]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [bundleFile:9.4.52.v20230823]
at java.lang.Thread.run(Thread.java:840) [?:?]

Ich kann damit leider nichts anfangen und habe auch nichts in den Foren gefunden.

Die Buttons sind wie folgt codiert:

- component: oh-button
config:
action: command
actionCommand: "=(items[props.itemZahl].state === props.Max ? items[props.itemZahl].state : (items[props.itemZahl].state + props.Step))"
actionItem: =props.itemZahl
style:
font-family: u2400
font-size: 150%
text: ▶

- component: oh-button
config:
action: command
actionCommand: "=(items[props.itemZahl].state === props.Min ? items[props.itemZahl].state : (items[props.itemZahl].state - props.Step))"
actionItem: =props.itemZahl
style:
font-family: u2400
font-size: 150%
text: ◀

Ich habe auch schon mit der Funktion Number() probiert, bekomme aber das gleiche Ergebnis. Hat jemand eine Idee, woran es liegen kann?

Re: Kommunikationsfehler im Widget

Verfasst: 12. Feb 2024 22:25
von udo1toni
Versuche bitte mal numericState statt state

Re: Kommunikationsfehler im Widget

Verfasst: 12. Feb 2024 22:51
von lukima61
Leider das gleiche Ergebnis, im Logfile auch wieder die gleiche Meldung ;)

Re: Kommunikationsfehler im Widget

Verfasst: 12. Feb 2024 23:17
von lukima61
Ich habe jetzt mal ein kleines Script zur Kontrolle geschrieben:

var i;

var thread = Java.type('java.lang.Thread')


items.getItem('TestBerechnung').postUpdate(1.5);
console.info(items.getItem('TestBerechnung').state);
for (i = 1; i <= 5; i++) {
thread.sleep(1000);
items.getItem('TestBerechnung').postUpdate((parseFloat(items.getItem('TestBerechnung').state) - 0.5));
thread.sleep(1000);
console.info(items.getItem('TestBerechnung').state);
}


Die Ausgabe ist wie erwartet so:

2024-02-12 23:12:51.745 [INFO ] [g.openhab.automation.script.ui._Test] - 1.5
2024-02-12 23:12:53.764 [INFO ] [g.openhab.automation.script.ui._Test] - 1.0
2024-02-12 23:12:55.766 [INFO ] [g.openhab.automation.script.ui._Test] - 0.5
2024-02-12 23:12:57.768 [INFO ] [g.openhab.automation.script.ui._Test] - 0.0
2024-02-12 23:12:59.769 [INFO ] [g.openhab.automation.script.ui._Test] - -0.5
2024-02-12 23:13:01.771 [INFO ] [g.openhab.automation.script.ui._Test] - -1.0

An dem Item liegt es also nicht, irgendwas stimmt mit der Widget-Engine nicht. :?