Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When switching FHEM Devices: ERROR spark.http.matching.GeneralError - java.lang.UnsupportedOperationException: JsonObject #1029

Closed
scat70 opened this issue Dec 11, 2018 · 3 comments · Fixed by #1085
Assignees
Milestone

Comments

@scat70
Copy link

scat70 commented Dec 11, 2018

When configuring FHEM device manually as HTTP Devices everything works well. When trying to use the automatically created FHEM device the URL is replaced by a JSON Object, e.g.

{"url":"http:https://192.168.2.42:8088/fhem?cmd=set%20Licht_Gartenhaus%20","command":"on"}

The JSON object ist valid, but when trying to switch the device the above error occurs. spark.http.matching and com.bwssystems.HABridge.plugins.fhem are set to DEBUG but without any additional information.

I use the raspi docker version 5.2.1 of HA Bridge.

Log:
2018-12-11 23:08:56,588 [qtp22247559-20] ERROR spark.http.matching.GeneralError -
java.lang.UnsupportedOperationException: JsonObject
at com.google.gson.JsonElement.getAsString(JsonElement.java:191)
at com.bwssystems.HABridge.plugins.fhem.FHEMHome.deviceHandler(FHEMHome.java:50)
at com.bwssystems.HABridge.hue.HueMulator.callUrl(HueMulator.java:1465)
at com.bwssystems.HABridge.hue.HueMulator.changeState(HueMulator.java:1220)
at com.bwssystems.HABridge.hue.HueMulator.lambda$39(HueMulator.java:444)
at com.bwssystems.HABridge.hue.HueMulator$$Lambda$124/27315945.handle(Unknown Source)
at spark.RouteImpl$1.handle(RouteImpl.java:72)
at spark.http.matching.Routes.execute(Routes.java:61)
at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:130)
at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1568)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:564)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:673)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:591)
at java.lang.Thread.run(Thread.java:745)

@bwssytems
Copy link
Owner

will take a look

@bwssytems bwssytems self-assigned this Dec 12, 2018
@scat70
Copy link
Author

scat70 commented Dec 16, 2018

By the way same issue with 5.2.2RC

@scat70
Copy link
Author

scat70 commented Dec 23, 2018

Just figured out, that I can create devices in HA-Bridge using a REST API. That's perfect, as I have to rewrite the device names I used in FHEM a little to make them more easily usable for Alexa. Thus I just wrote a litte sync script which sychronizes the FHEM switches with HA-Bridge and on the fly rewrites the devices names for Alexa. As I create simple httpDevices instead of FHEMdevices, HA-Bridge works fine for me now. So the bug I raised is not really critical for me any longer. However for other fixing it might still be important.

@bwssytems bwssytems added the bug label May 3, 2019
@bwssytems bwssytems added this to the v5.2.2 milestone May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants