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

Scanning Fibaro devices or scenes not working with 5.0.0 #809

Closed
AlfAlex opened this issue Nov 26, 2017 · 13 comments
Closed

Scanning Fibaro devices or scenes not working with 5.0.0 #809

AlfAlex opened this issue Nov 26, 2017 · 13 comments

Comments

@AlfAlex
Copy link

AlfAlex commented Nov 26, 2017

I get these exceptions:
2017-11-26 12:52:11,260 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 3 with response address: 192.168.177.16:9000 to address: /192.168.177.48:39832 2017-11-26 12:52:21,149 [qtp9344866-49] INFO com.bwssystems.HABridge.plugins.fibaro.FibaroInfo - Found: 26 rooms 2017-11-26 12:52:21,452 [qtp9344866-43] ERROR spark.http.matching.GeneralError - com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 39045 path $[67].triggers.events[0] at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.Gson.fromJson(Gson.java:879) at com.google.gson.Gson.fromJson(Gson.java:844) at com.google.gson.Gson.fromJson(Gson.java:793) at com.google.gson.Gson.fromJson(Gson.java:765) at com.bwssystems.HABridge.plugins.fibaro.FibaroInfo.getScenes(FibaroInfo.java:150) at com.bwssystems.HABridge.plugins.fibaro.FibaroHome.getScenes(FibaroHome.java:60) at com.bwssystems.HABridge.plugins.fibaro.FibaroHome.getItems(FibaroHome.java:82) at com.bwssystems.HABridge.devicemanagmeent.DeviceResource.lambda$11(DeviceResource.java:244) at spark.ResponseTransformerRouteImpl$1.handle(ResponseTransformerRouteImpl.java:47) 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.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) Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 39045 path $[67].triggers.events[0] at com.google.gson.stream.JsonReader.nextString(JsonReader.java:831) at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:422) at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:410) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216) ... 28 common frames omitted 2017-11-26 12:52:21,825 [qtp9344866-48] INFO com.bwssystems.HABridge.upnp.UpnpSettingsResource - Traceupnp: request of description.xml from: 192.168.177.37:9000 filled in with address: 192.168.177.16:9000 2017-11-26 12:52:21,944 [qtp9344866-45] INFO spark.http.matching.MatcherFilter - The requested route [/(null)] has not been mapped in Spark for Accept: [null] 2017-11-26 12:52:22,629 [qtp9344866-49] ERROR spark.http.matching.GeneralError - java.lang.NumberFormatException: empty String at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1842) at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110) at java.lang.Double.parseDouble(Double.java:538) at com.google.gson.stream.JsonReader.nextDouble(JsonReader.java:918) at com.google.gson.Gson$3.read(Gson.java:277) at com.google.gson.Gson$3.read(Gson.java:271) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.Gson.fromJson(Gson.java:879) at com.google.gson.Gson.fromJson(Gson.java:844) at com.google.gson.Gson.fromJson(Gson.java:793) at com.google.gson.Gson.fromJson(Gson.java:765) at com.bwssystems.HABridge.plugins.fibaro.FibaroInfo.getDevices(FibaroInfo.java:111) at com.bwssystems.HABridge.plugins.fibaro.FibaroHome.getDevices(FibaroHome.java:46) at com.bwssystems.HABridge.plugins.fibaro.FibaroHome.getItems(FibaroHome.java:80) at com.bwssystems.HABridge.devicemanagmeent.DeviceResource.lambda$10(DeviceResource.java:238) at spark.ResponseTransformerRouteImpl$1.handle(ResponseTransformerRouteImpl.java:47) 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) 2017-11-26 12:52:44,843 [qtp9344866-46] INFO com.bwssystems.HABridge.upnp.UpnpSettingsResource - Traceupnp: request of description.xml from: 192.168.177.37:9000 filled in with address: 192.168.177.16:9000 2017-11-26 12:52:44,957 [qtp9344866-43] INFO spark.http.matching.MatcherFilter - The requested route [/(null)] has not been mapped in Spark for Accept: [null]

And at the web frontend I get this message:
Get Fibaro Devices Error: undefined with status: Server Error - 500

I have entered the proper IP and login data.
For me it looks like scanning works but the JSON parser has a small bug.

@AlfAlex
Copy link
Author

AlfAlex commented Nov 26, 2017

Bug with scenes:
2017-11-26 12:52:21,452 [qtp9344866-43] ERROR spark.http.matching.GeneralError - com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 39045 path $[67].triggers.events[0] at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.Gson.fromJson(Gson.java:879) at com.google.gson.Gson.fromJson(Gson.java:844) at com.google.gson.Gson.fromJson(Gson.java:793) at com.google.gson.Gson.fromJson(Gson.java:765) at com.bwssystems.HABridge.plugins.fibaro.FibaroInfo.getScenes(FibaroInfo.java:150) at com.bwssystems.HABridge.plugins.fibaro.FibaroHome.getScenes(FibaroHome.java:60)

It is this scene:
{"id":145,"name":"Button WZ","type":"com.fibaro.luaScene","roomID":3,"iconID":6,"runConfig":"TRIGGER_AND_MANUAL","alexaProhibited":true,"autostart":false,"protectedByPIN":false,"killable":false,"killOtherInstances":false,"maxRunningInstances":2,"runningInstances":0,"instances":[],"runningManualInstances":0,"visible":false,"isLua":true,"properties":"","triggers":{"properties":[],"globals":[],"events":[{"deviceId":1091,"eventName":"CentralSceneEvent","args":[]}],"weather":[]},"actions":{"devices":[],"scenes":[],"groups":[]},"liliStartCommand":"","liliStopCommand":"","sortOrder":281},

At Character 39045 is the 'e' of "events:":

I hope this helps

@AlfAlex
Copy link
Author

AlfAlex commented Nov 26, 2017

Problem is with CentralSceneActivated-Scenes.

@AlfAlex
Copy link
Author

AlfAlex commented Nov 26, 2017

SceneTriggerd.java is missing trigger "weather"

@AlfAlex
Copy link
Author

AlfAlex commented Nov 26, 2017

ANd the bug at modules is somewhere here:
{"id":45,"name":"Rauchmelder SZ","roomID":6,"type":"com.fibaro.FGSS001","baseType":"com.fibaro.smokeSensor","enabled":true,"visible":true,"isPlugin":false,"parentId":310,"remoteGatewayId":0,"interfaces":["battery","fibaroBreach","fibaroFirmwareUpdate","tamper","zwave","zwaveConfiguration","zwaveWakeup"],"properties":{"batteryLevel":100,"parameters":[{"id":1,"lastReportedValue":0,"lastSetValue":0,"size":2,"value":0},{"id":2,"lastReportedValue":3,"lastSetValue":3,"size":1,"value":3},{"id":5,"lastReportedValue":255,"lastSetValue":255,"size":1,"value":255},{"id":7,"lastReportedValue":255,"lastSetValue":255,"size":1,"value":255},{"id":10,"lastReportedValue":0,"lastSetValue":0,"size":2,"value":0},{"id":12,"lastReportedValue":30,"lastSetValue":30,"size":1,"value":30},{"id":13,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0},{"id":14,"lastSetValue":26277637,"size":0,"value":26277637},{"id":73,"lastReportedValue":0,"lastSetValue":0,"size":2,"value":0},{"id":80,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0},{"id":81,"lastReportedValue":54,"lastSetValue":54,"size":1,"value":54},{"id":82,"lastReportedValue":2,"lastSetValue":2,"size":1,"value":2},{"id":83,"lastReportedValue":2,"lastSetValue":2,"size":1,"value":2},{"id":84,"lastReportedValue":10,"lastSetValue":10,"size":1,"value":10},{"id":85,"lastReportedValue":5,"lastSetValue":5,"size":1,"value":5},{"id":86,"lastReportedValue":360,"lastSetValue":360,"size":2,"value":360},{"id":87,"lastReportedValue":360,"lastSetValue":360,"size":2,"value":360},{"id":88,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0},{"id":89,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1}],"pollingTimeSec":0,"wakeUpTime":21600,"zwaveCompany":"Fibar Group","zwaveInfo":"3,3,52","zwaveVersion":"","batteryLowNotification":"true","configured":true,"dead":"false","defInterval":"0","deviceControlType":"0","deviceIcon":"69","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","firmwareUpdate":"{\"info\":\"\",\"progress\":0,\"status\":\"UpToDate\",\"updateVersion\":\"\"}","lastBreached":"0","liliOffCommand":"","liliOnCommand":"","log":"Warte auf Wecken","logTemp":"TxtGreen","manufacturer":"","markAsDead":"true","maxInterval":"0","minInterval":"0","model":"","nodeId":"28","parametersTemplate":"263","productInfo":"1,15,12,0,16,0,2,1","pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","serialNumber":"","smokeSensitivityMode":"2","smsNotificationID":"0","smsNotificationType":"0","stepInterval":"0","tamper":"false","updateVersion":"","useTemplate":"true","userDescription":"","value":"false"},"actions":{"associationGet":1,"associationSet":2,"forceArm":0,"getParameter":1,"meetArmConditions":0,"reconfigure":0,"setArmed":1,"setInterval":1,"setParameter":2,"updateFirmware":1},"created":1511449790,"modified":1511449790,"sortOrder":14}

or

{"id":312,"name":"Temperatur SZ R","roomID":6,"type":"com.fibaro.temperatureSensor","baseType":"com.fibaro.multilevelSensor","enabled":true,"visible":true,"isPlugin":false,"parentId":310,"remoteGatewayId":0,"interfaces":["zwave"],"properties":{"batteryLevel":100,"parameters":[{"id":1,"lastReportedValue":0,"lastSetValue":0,"size":2,"value":0},{"id":2,"lastReportedValue":3,"lastSetValue":3,"size":1,"value":3},{"id":5,"lastReportedValue":255,"lastSetValue":255,"size":1,"value":255},{"id":7,"lastReportedValue":255,"lastSetValue":255,"size":1,"value":255},{"id":10,"lastReportedValue":0,"lastSetValue":0,"size":2,"value":0},{"id":12,"lastReportedValue":30,"lastSetValue":30,"size":1,"value":30},{"id":13,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0},{"id":14,"lastSetValue":26277637,"size":0,"value":26277637},{"id":73,"lastReportedValue":0,"lastSetValue":0,"size":2,"value":0},{"id":80,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0},{"id":81,"lastReportedValue":54,"lastSetValue":54,"size":1,"value":54},{"id":82,"lastReportedValue":2,"lastSetValue":2,"size":1,"value":2},{"id":83,"lastReportedValue":2,"lastSetValue":2,"size":1,"value":2},{"id":84,"lastReportedValue":10,"lastSetValue":10,"size":1,"value":10},{"id":85,"lastReportedValue":5,"lastSetValue":5,"size":1,"value":5},{"id":86,"lastReportedValue":360,"lastSetValue":360,"size":2,"value":360},{"id":87,"lastReportedValue":360,"lastSetValue":360,"size":2,"value":360},{"id":88,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0},{"id":89,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1}],"pollingTimeSec":0,"wakeUpTime":21600,"zwaveCompany":"Fibar Group","zwaveInfo":"3,3,52","zwaveVersion":"","configured":true,"dead":"false","deviceControlType":"0","deviceIcon":"30","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","liliOffCommand":"","liliOnCommand":"","log":"Warte auf Wecken","logTemp":"TxtGreen","manufacturer":"","markAsDead":"true","model":"","nodeId":"28","offset":"0.00","parametersTemplate":"263","productInfo":"1,15,12,0,16,0,2,1","pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"false","serialNumber":"","showFireAlarm":"true","showFreezeAlarm":"false","smsNotificationID":"0","smsNotificationType":"0","unit":"C","useTemplate":"true","userDescription":"","value":"18.00"},"actions":{"reconfigure":0},"created":1511449792,"modified":1511449792,"sortOrder":76}

If I unselect these two modules everything is working fine.

@AlfAlex
Copy link
Author

AlfAlex commented Nov 26, 2017

After a device soft configuration this worked.

@rems02
Copy link

rems02 commented Dec 1, 2017

@AlfAlex how did you do ?

@AlfAlex
Copy link
Author

AlfAlex commented Dec 1, 2017

@rems02 What exactly do you mean? It worked perfectly for me after doing some changes.
First of all I did create a new test user and added more and mroe devices and scenes to this user.
So I figured out what scenes and what devices did make troubles.
Another approach would be taking the whole JSON output of fibaro and compaüres the column number that the exception gives you.
After I have found aproblematic scene or device I checked this one.
For the scenes I could only figure out that scenes having CentralSceneEvent in their header are making troubles. So I decided to remove them from this user (also I don't need them to be accessable by habridge).
The problematic device I found out that some informations were missing the the habridge-json-parser wanted to read an integer value that does not exist. Now I have just made a soft reconfiguration of this module and afterwards scanning this module did work perfectly.

@rems02
Copy link

rems02 commented Dec 1, 2017

@AlfAlex ok, thanks,
how do you see the logs in habridge ?

@AlfAlex
Copy link
Author

AlfAlex commented Dec 1, 2017

You can start habridge right from console or have a look an nohup.out or habridge.log in your habridge directory.

@klccjeremy
Copy link

Hi I'm facing another problem with Fibaro.
HA Bridge is able to scan all device that I have, but when I click "Build Item", nothing happens, "Bulk Add" does nothing too.

Any advice?

Thanks!

@AlfAlex
Copy link
Author

AlfAlex commented Dec 3, 2017

The drop down box in the text above must have a value.
(This version has lots of bugs... at least the Fibaro part :( )

@bwssytems
Copy link
Owner

@klccjeremy The build items is a bug referenced in #801. This will be fixed in the next release.

@bwssytems
Copy link
Owner

There is an actual decoding error in scenes within the code. This will be fixed in the next release.

@bwssytems bwssytems added the bug label Jan 23, 2018
@bwssytems bwssytems added this to the 5.2.0 milestone Jan 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants