Exception with AVMFritz Binding DECT 200 after Switch-Event

Hi,

i’ve got some problems with the AVM DECT 200 Binding for OpenHAB 2 (Cloudbee Snapshot from 8.May ).

I’ve created the following items:

Number gHaus_Jens_Buero_LaserdruckerTemperature			"Temperatur [%.1f °C]"	(gHaus_Jens_Buero)	{channel="avmfritz:FRITZ_DECT_200:192_168_0_253:08xxxxx026841:temperature"}
Switch gHaus_Jens_Buero_LaserdruckerSwitch			"Schalter"				(gHaus_Jens_Buero)	{channel="avmfritz:FRITZ_DECT_200:192_168_0_253:0876xxxx6841:outlet"}
Number gHaus_Jens_Buero_LaserdruckerPower			"Leistung [%.1f Watt]"	(gHaus_Jens_Buero)	{channel="avmfritz:FRITZ_DECT_200:192_168_0_253:0876xxxxx6841:power"}
Number gHaus_Jens_Buero_LaserdruckerEnergy			"Verbrauch [%.0f kWh]"	(gHaus_Jens_Buero)	{channel="avmfritz:FRITZ_DECT_200:192_168_0_253:087xxxxx6841:energy"}

and set it on the sitemap:

Frame label="Klimaanlage" {
	Switch item=gHaus_Jens_Gesamt_KlimaSwitch icon="switch"
	Text item=gHaus_Jens_Gesamt_KlimaTemperature icon="temperature"
	Text item=gHaus_Jens_Gesamt_KlimaPower icon="energy"
	Text item=gHaus_Jens_Gesamt_KlimaEnergy icon="energy"
}

I’ve got on the Web-GUI the correct temperature and energy/power-information.

But after using the switch for “gHaus_Jens_Gesamt_KlimaSwitch” nothing happened and i’ve got the following exception:

2016-05-11 19:28:09.071 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'gHaus_Jens_Gesamt_KlimaSwitch' received command OFF
2016-05-11 19:28:09.084 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while calling handler: java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_91]
	at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_91]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:179)[96:org.eclipse.smarthome.core:0.8.0.201605042120]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:72)[96:org.eclipse.smarthome.core:0.8.0.201605042120]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:56)[96:org.eclipse.smarthome.core:0.8.0.201605042120]
	at org.eclipse.smarthome.core.thing.internal.ThingManager.receiveCommand(ThingManager.java:362)[102:org.eclipse.smarthome.core.thing:0.8.0.201605042120]
	at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:46)[96:org.eclipse.smarthome.core:0.8.0.201605042120]
	at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:192)[96:org.eclipse.smarthome.core:0.8.0.201605042120]
	at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:1)[96:org.eclipse.smarthome.core:0.8.0.201605042120]
	at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:170)[96:org.eclipse.smarthome.core:0.8.0.201605042120]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_91]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_91]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_91]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_91]
Caused by: java.lang.NullPointerException
	at org.openhab.binding.avmfritz.handler.DeviceHandler.handleCommand(DeviceHandler.java:162)[190:org.openhab.binding.avmfritz:2.0.0.201605080102]
	at org.eclipse.smarthome.core.thing.internal.ThingManager$2.call(ThingManager.java:365)[102:org.eclipse.smarthome.core.thing:0.8.0.201605042120]
	at org.eclipse.smarthome.core.thing.internal.ThingManager$2.call(ThingManager.java:1)[102:org.eclipse.smarthome.core.thing:0.8.0.201605042120]
	... 5 more

Could somebody confirm this behavior?

I might be blind, but I can’t see a definition for item “gHaus_Jens_Gesamt_KlimaSwitch”

thanks, i’ve just copied the wrong item for this thread. The items exists in my main.items:

Number gHaus_Jens_Gesamt_KlimaTemperature "Temperatur [%.1f °C]" (gHaus_Jens) {channel="avmfritz:FRITZ_DECT_200:192_168_0_253: 0876xxx3689:temperature"} Switch gHaus_Jens_Gesamt_KlimaSwitch "Schalter" (gHaus_Jens) {channel="avmfritz:FRITZ_DECT_200:192_168_0_253: 0876xxx3689:outlet"} Number gHaus_Jens_Gesamt_KlimaPower "Leistung [%.1f Watt]" (gHaus_Jens) {channel="avmfritz:FRITZ_DECT_200:192_168_0_253: 0876xxx3689:power"} Number gHaus_Jens_Gesamt_KlimaEnergy "Verbrauch [%.0f kWh]" (gHaus_Jens) {channel="avmfritz:FRITZ_DECT_200:192_168_0_253:0876xxx3689:energy"}

I am not shure, but what about deleting the “space” in your definition.
Is your laser printer switch working, cause you did not define it with a space.

Thanks Hans-Jörg,

yes and no - yes, the whitespace is wrong - but it was added after sending this message (in don’t know why). The original main.items didn’t have this whitespace and the item is correctly linked.

Because the power/energy and temperature items are working without any problem, this Nullpointer Exception shouldn’t be raised by the configuration and the this behavior showed up on three different Fritz!DECT 200.

I’ve i should guess, it maybe caused because the Device looked liked to me uninitialized ->
(DeviceHandler.java / Line 83)

Hello,

I got the same NPE:

2016-05-16 18:38:36.060 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘avmfritz_FRITZ_DECT_200_18d182fd_087610236298_outlet’ received command OFF
2016-05-16 18:38:36.067 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while calling handler: java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_65]
at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_65]
at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:179)[96:org.eclipse.smarthome.core:0.8.0.201605141733]
at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:72)[96:org.eclipse.smarthome.core:0.8.0.201605141733]
at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:56)[96:org.eclipse.smarthome.core:0.8.0.201605141733]
at org.eclipse.smarthome.core.thing.internal.ThingManager.receiveCommand(ThingManager.java:375)[102:org.eclipse.smarthome.core.thing:0.8.0.201605141733]
at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:46)[96:org.eclipse.smarthome.core:0.8.0.201605141733]
at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:192)[96:org.eclipse.smarthome.core:0.8.0.201605141733]
at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:1)[96:org.eclipse.smarthome.core:0.8.0.201605141733]
at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:170)[96:org.eclipse.smarthome.core:0.8.0.201605141733]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[: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]
Caused by: java.lang.NullPointerException
at org.openhab.binding.avmfritz.handler.DeviceHandler.handleCommand(DeviceHandler.java:162)[189:org.openhab.binding.avmfritz:2.0.0.201605160102]
at org.eclipse.smarthome.core.thing.internal.ThingManager$2.call(ThingManager.java:378)[102:org.eclipse.smarthome.core.thing:0.8.0.201605141733]
at org.eclipse.smarthome.core.thing.internal.ThingManager$2.call(ThingManager.java:1)[102:org.eclipse.smarthome.core.thing:0.8.0.201605141733]
… 5 more

I didn’t use any sitemap, because I configured the FritzBox with the paper UI. I’ve got on the Web-GUI the correct temperature and energy/power-information like Jens.

Thank you for help.
Haiko

I get the same exception with my two devices. Both of them are showing up as online in the paperUI and display all other information correctly. They even correctly display the on/off state of the outlet, but the exception is thrown when trying to switch them via openHAB.