openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.58k forks source link

NullPointerException if a system variable is present in homegear #1437

Closed dschulte closed 7 years ago

dschulte commented 7 years ago

As soon as I add a system variable in homegear I see the following exception in the openhab log when scanning for new things in the homematic binding in paper ui:

2016-11-19 03:08:43.152 [ERROR] [very.HomematicDeviceDiscoveryService] - 
java.lang.NullPointerException
        at org.openhab.binding.homematic.type.MetadataUtils.createBigDecimal(MetadataUtils.java:251)[189:org.openhab.binding.homematic:2.0.0.b4]
        at org.openhab.binding.homematic.type.HomematicTypeGeneratorImpl.createChannelType(HomematicTypeGeneratorImpl.java:242)[189:org.openhab.binding.homematic:2.0.0.b4]
        at org.openhab.binding.homematic.type.HomematicTypeGeneratorImpl.generate(HomematicTypeGeneratorImpl.java:128)[189:org.openhab.binding.homematic:2.0.0.b4]
        at org.openhab.binding.homematic.handler.HomematicBridgeHandler.onDeviceLoaded(HomematicBridgeHandler.java:277)[189:org.openhab.binding.homematic:2.0.0.b4]
        at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.loadAllDeviceMetadata(AbstractHomematicGateway.java:389)[189:org.openhab.binding.homematic:2.0.0.b4]
        at org.openhab.binding.homematic.discovery.HomematicDeviceDiscoveryService$1.run(HomematicDeviceDiscoveryService.java:108)[189:org.openhab.binding.homematic:2.0.0.b4]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_65]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_65]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_65]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_65]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]

add a variable:

homegear -e 'runcommand $hg->setSystemVariable("maxValveStateBad", 42);'

delete variable:

homegear -e 'runcommand $hg->deleteSystemVariable("maxValveStateBad");'

I don't know which other information might be interesting. Please ask.

MHerbst commented 7 years ago

I have tested it with the latest binding and the Homematic CCU. With this combination everything works fine. Can you retest it with the latest Homematic binding?

drivin commented 7 years ago

Same problem here:

2016-12-14 18:42:26.545 [ERROR] [very.HomematicDeviceDiscoveryService] - java.lang.NullPointerException at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.createGatewayDevice(AbstractHomematicGateway.java:655)[181:org.openhab.binding.homematic:2.0.0.201612120809] at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.getDeviceDescriptions(AbstractHomematicGateway.java:420)[181:org.openhab.binding.homematic:2.0.0.201612120809] at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.loadAllDeviceMetadata(AbstractHomematicGateway.java:358)[181:org.openhab.binding.homematic:2.0.0.201612120809] at org.openhab.binding.homematic.discovery.HomematicDeviceDiscoveryService$1.run(HomematicDeviceDiscoveryService.java:108)[181:org.openhab.binding.homematic:2.0.0.201612120809] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_65] at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_65] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_65] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_65] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_65] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_65] at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]

But I think it have nothing to do with the system variables. I have deleted all my system variables, but the problem is not solved. The homegear instance will not discovered. New things too, if I add the homematic bridge manually.

dschulte commented 7 years ago

It seems that yours is another problem. My issue shows up only with a homegear variable present. Maybe you should submit a new issue.

I worked around that problem by using php scripts and the exec binding. I have installed the latest apt packages. As this is my live installation I want to avoid to get a broken system by installing "unstable" packages. From my side you can close this issue if no one else has the same error.

denkermatic commented 7 years ago

Same problem with homegear 6.7-1545 and openHab2-online 2.0.0~20161222170724. Looks like the homematic binding can't read the homegear system variables.

2016-12-22 20:46:07.515 [ERROR] [very.HomematicDeviceDiscoveryService] -
java.lang.NullPointerException
        at org.openhab.binding.homematic.type.MetadataUtils.createBigDecimal(MetadataUtils.java:254)[180:org.openhab.binding.homematic:2.0.0.201612221443]
        at org.openhab.binding.homematic.type.HomematicTypeGeneratorImpl.createChannelType(HomematicTypeGeneratorImpl.java:246)[180:org.openhab.binding.homematic:2.0.0.201612221443]
        at org.openhab.binding.homematic.type.HomematicTypeGeneratorImpl.generate(HomematicTypeGeneratorImpl.java:129)[180:org.openhab.binding.homematic:2.0.0.201612221443]
        at org.openhab.binding.homematic.handler.HomematicBridgeHandler.onDeviceLoaded(HomematicBridgeHandler.java:285)[180:org.openhab.binding.homematic:2.0.0.201612221443]
        at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.loadAllDeviceMetadata(AbstractHomematicGateway.java:400)[180:org.openhab.binding.homematic:2.0.0.2016122
21443]
        at org.openhab.binding.homematic.discovery.HomematicDeviceDiscoveryService$1.run(HomematicDeviceDiscoveryService.java:108)[180:org.openhab.binding.homematic:2.0.0.201612221443]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_65]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_65]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_65]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_65]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]
Andreas-Fink commented 7 years ago

Same problem here with OpenHAB 2.0.0~RC1-1 and Homegear 0.6.14-874. Are there any news related to this topic?

MHerbst commented 7 years ago

There have been lots of modifications for OH 2.0 and later. AFAIK there have been fixes regarding system variables. @gerrieg knows more.

gerrieg commented 7 years ago

Please test it with the latest snapshot version. If it still does not work, please post a full startup TRACE logfile, see Debugging and Tracing