HomeMatic NullPointerException OH2

Hi there - I’ve created a github issue but I think it belongs here:

I successfully used homegear with HM-LAN-CFG and Thermostate in openhab1 as a test. Then switched to openhab2. The bridge is recognized as a thing, the thermostate as well. All the configuration seems to be read correctly also.

However, I cannot seem to get any data out of it, and I noticed in the logs:

2017-02-02 07:49:03.725 [ERROR] [ternal.communicator.HomematicGateway] -
java.lang.NullPointerException
        at org.openhab.binding.homematic.handler.HomematicBridgeHandler.updateThing(HomematicBridgeHandler.java:221)[184:org.openhab.binding.homematic:2.0.0]
        at org.openhab.binding.homematic.handler.HomematicBridgeHandler.onNewDevice(HomematicBridgeHandler.java:243)[184:org.openhab.binding.homematic:2.0.0]
        at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.newDevices(AbstractHomematicGateway.java:609)[184:org.openhab.binding.homematic:2.0.0]
        at org.openhab.binding.homematic.internal.communicator.server.BinRpcCallbackHandler.handleNewDevice(BinRpcCallbackHandler.java:143)[184:org.openhab.binding.homematic:2.0.0]
        at org.openhab.binding.homematic.internal.communicator.server.BinRpcCallbackHandler.handleMethodCall(BinRpcCallbackHandler.java:90)[184:org.openhab.binding.homematic:2.0.0]
        at org.openhab.binding.homematic.internal.communicator.server.BinRpcCallbackHandler.run(BinRpcCallbackHandler.java:62)[184:org.openhab.binding.homematic:2.0.0]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
2017-02-02 07:51:05.808 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:0#RSSI_DEVICE'
2017-02-02 07:51:05.816 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#ACTUAL_TEMPERATURE'
2017-02-02 07:51:05.819 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#BATTERY_STATE'
2017-02-02 07:51:05.822 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#BOOST_STATE'
2017-02-02 07:51:05.825 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#CONTROL_MODE'
2017-02-02 07:51:05.827 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#FAULT_REPORTING'
2017-02-02 07:51:05.830 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#PARTY_START_TIME'
2017-02-02 07:51:05.833 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#SET_TEMPERATURE'
2017-02-02 07:51:05.835 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#VALVE_STATE'
2017-02-02 07:53:30.304 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:0#RSSI_DEVICE'
2017-02-02 07:53:30.310 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#ACTUAL_TEMPERATURE'
2017-02-02 07:53:30.313 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#BATTERY_STATE'
2017-02-02 07:53:30.316 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#BOOST_STATE'
2017-02-02 07:53:30.319 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#CONTROL_MODE'
2017-02-02 07:53:30.321 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#FAULT_REPORTING'
2017-02-02 07:53:30.324 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#PARTY_START_TIME'
2017-02-02 07:53:30.327 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#SET_TEMPERATURE'
2017-02-02 07:53:30.329 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#VALVE_STATE'
2017-02-02 07:55:40.305 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:0#RSSI_DEVICE'
2017-02-02 07:55:40.312 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#ACTUAL_TEMPERATURE'
2017-02-02 07:55:40.315 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#BATTERY_STATE'
2017-02-02 07:55:40.323 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#BOOST_STATE'
2017-02-02 07:55:40.329 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#CONTROL_MODE'
2017-02-02 07:55:40.335 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#FAULT_REPORTING'
2017-02-02 07:55:40.341 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#PARTY_START_TIME'
2017-02-02 07:55:40.347 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#SET_TEMPERATURE'
2017-02-02 07:55:40.350 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#VALVE_STATE'

Can anyone tell me what causes this or how I can debug it?

You can activate debug resp. trace settings in the Karaf console. Enter either log:set DEBUG org.openhab.binding.homematic resp. log:set TRACE org.openhab.binding.homematic and restart openHAB.

I can’t seem to get into this console - can I set it in the config files somewhere?

Found it

I’m getting this now:

2017-02-02 22:33:04.790 [DEBUG] [ternal.communicator.HomematicGateway] - Received new (Double) value '22.2' for 'LEQ0782160:4#ACTUAL_TEMPERATURE' from gateway with id '17b78d3e'
2017-02-02 22:33:04.792 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#ACTUAL_TEMPERATURE'
2017-02-02 22:33:04.793 [DEBUG] [ternal.communicator.HomematicGateway] - Received new (Double) value '2.5' for 'LEQ0782160:4#BATTERY_STATE' from gateway with id '17b78d3e'
2017-02-02 22:33:04.795 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#BATTERY_STATE'
2017-02-02 22:33:04.797 [DEBUG] [ternal.communicator.HomematicGateway] - Received new (Integer) value '0' for 'LEQ0782160:4#BOOST_STATE' from gateway with id '17b78d3e'
2017-02-02 22:33:04.799 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#BOOST_STATE'
2017-02-02 22:33:04.800 [DEBUG] [ternal.communicator.HomematicGateway] - Received new (Integer) value '0' for 'LEQ0782160:4#CONTROL_MODE' from gateway with id '17b78d3e'
2017-02-02 22:33:04.802 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#CONTROL_MODE'
2017-02-02 22:33:04.804 [DEBUG] [ternal.communicator.HomematicGateway] - Received new (Integer) value '0' for 'LEQ0782160:4#FAULT_REPORTING' from gateway with id '17b78d3e'
2017-02-02 22:33:04.806 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#FAULT_REPORTING'
2017-02-02 22:33:04.807 [DEBUG] [ternal.communicator.HomematicGateway] - Received new (Integer) value '0' for 'LEQ0782160:4#PARTY_START_TIME' from gateway with id '17b78d3e'
2017-02-02 22:33:04.809 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#PARTY_START_TIME'
2017-02-02 22:33:04.810 [DEBUG] [ternal.communicator.HomematicGateway] - Received new (Double) value '17.0' for 'LEQ0782160:4#SET_TEMPERATURE' from gateway with id '17b78d3e'
2017-02-02 22:33:04.812 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#SET_TEMPERATURE'
2017-02-02 22:33:04.814 [DEBUG] [ternal.communicator.HomematicGateway] - Received new (Integer) value '0' for 'LEQ0782160:4#VALVE_STATE' from gateway with id '17b78d3e'
2017-02-02 22:33:04.816 [WARN ] [ematic.handler.HomematicThingHandler] - Channel not found for datapoint 'LEQ0782160:4#VALVE_STATE'

but what is missing here?

Here is the complete log: https://dl.dropboxusercontent.com/u/311345/openhab.log
Does anyone spot the problem?

Please try the latest snapshot build (>= 779), there was a fix in the onNewDevice method that should fix your problem too.
If it still does not work with the snapshot, please post a TRACE log again.

I re-added the Thing and it worked, I’m not sure it’s related.
I noticed the exception is still in the log, but didn’t have any problems.

have same problem; did not appear at the beginning but saw it after oh2 was running a while.
So did same, e.g. removing homematic CCU as thing and re-adding it again and null pointer exception has been removed after restart

2017-02-12 14:40:39.138 [INFO ] [ternal.communicator.HomematicGateway] - HmGatewayInfo[id=CCU,type=HMLGW2,firmware=2.25.15,address=KEQ1066857,wired=true,hmip=false,cuxd=false]
2017-02-12 14:40:39.141 [INFO ] [ternal.communicator.HomematicGateway] - Used Homematic transfer modes: RF:BIN_RPC, WIRED:BIN_RPC
2017-02-12 14:40:40.213 [ERROR] [ternal.communicator.HomematicGateway] - 
java.lang.NullPointerException
    at org.openhab.binding.homematic.handler.HomematicBridgeHandler.updateThing(HomematicBridgeHandler.java:221)[220:org.openhab.binding.homematic:2.0.0]
    at org.openhab.binding.homematic.handler.HomematicBridgeHandler.onNewDevice(HomematicBridgeHandler.java:243)[220:org.openhab.binding.homematic:2.0.0]
    at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.newDevices(AbstractHomematicGateway.java:609)[220:org.openhab.binding.homematic:2.0.0]
    at org.openhab.binding.homematic.internal.communicator.server.BinRpcCallbackHandler.handleNewDevice(BinRpcCallbackHandler.java:143)[220:org.openhab.binding.homematic:2.0.0]
    at org.openhab.binding.homematic.internal.communicator.server.BinRpcCallbackHandler.handleMethodCall(BinRpcCallbackHandler.java:90)[220:org.openhab.binding.homematic:2.0.0]
    at org.openhab.binding.homematic.internal.communicator.server.BinRpcCallbackHandler.run(BinRpcCallbackHandler.java:62)[220:org.openhab.binding.homematic:2.0.0]
    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]
2017-02-12 14:40:40.698 [INFO ] [ng.homematic.internal.misc.MiscUtils] - Datapoint name '${sysVarAlarmZone1}' contains invalid characters, new Datapoint name '__sysVarAlarmZone1_'
2017-02-12 14:40:40.701 [INFO ] [ng.homematic.internal.misc.MiscUtils] - Datapoint name '${sysVarPresence}' contains invalid characters, new Datapoint name '__sysVarPresence_'
2017-02-12 14:40:40.745 [INFO ] [atic.type.HomematicTypeGeneratorImpl] - Multiple firmware versions for device type 'HM-LC-Bl1-FM' found (2.5, 2.8). Make sure, all devices of the same type have the same firmware version, otherwise you MAY have channel and/or datapoint errors in the logfile

After re-start I realize that all homematic things connected to my bridge are not going online; so finally had to delete all homematic things and added them again as things… Now realize that all links to items disappeared… OMG want to have my manual configuration back instead…

If you want you can mix the configuration in Paper UI with manual configuration. E.g. configure the Bridge (and maybe the things) in Paper UI and define items in a separate items file.

I had the items in a separate items file anyway.
Now added the link {channel=“homematic: …”} for all my homematic devices after each item.
Works well but now I get loads of warnings in the log file.
Will open a new thread for this