Mi(Xiaomi) Smart home bindings?

Do anyone use the .things file?
Mine is very simple and looks like this:

Bridge mihome:bridge:34ce0088ce2f "Xiaomi Gateway" [ serialNumber="34ce0088ce2f", ipAddress="192.168.1.73", port=9898, key="lyvoc1hhbpbxxxxx", pollingInterval=6000 ]
{
	Thing mihome:gateway:34ce0088ce2f "Xiaomi Mi Smart Home Gateway" [itemId="34ce0088ce2f"]
	Thing mihome:sensor_cube:158d00010aed80 "Xiaomi cube" [itemId="158d00010aed80"]
}

When I try it, it says in the logs:

2017-09-15 19:07:18.045 [ThingAddedEvent           ] - Thing 'mihome:bridge:34ce0088ce2f' has been added.
2017-09-15 19:07:18.063 [hingStatusInfoChangedEvent] - 'mihome:bridge:34ce0088ce2f' changed from UNINITIALIZED to INITIALIZING
2017-09-15 19:07:18.072 [ThingAddedEvent           ] - Thing 'mihome:gateway:34ce0088ce2f' has been added.
2017-09-15 19:07:18.073 [hingStatusInfoChangedEvent] - 'mihome:gateway:34ce0088ce2f' changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
2017-09-15 19:07:18.083 [ThingAddedEvent           ] - Thing 'mihome:sensor_cube:158d00010aed80' has been added.
2017-09-15 19:07:18.090 [hingStatusInfoChangedEvent] - 'mihome:sensor_cube:158d00010aed80' changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
2017-09-15 19:07:18.124 [ThingUpdatedEvent         ] - Thing 'mihome:bridge:34ce0088ce2f' has been updated.
2017-09-15 19:07:18.130 [ThingUpdatedEvent         ] - Thing 'mihome:gateway:34ce0088ce2f' has been updated.
2017-09-15 19:07:18.132 [ThingUpdatedEvent         ] - Thing 'mihome:sensor_cube:158d00010aed80' has been updated.
2017-09-15 19:07:19.074 [hingStatusInfoChangedEvent] - 'mihome:bridge:34ce0088ce2f' changed from INITIALIZING to ONLINE
2017-09-15 19:07:19.082 [hingStatusInfoChangedEvent] - 'mihome:gateway:34ce0088ce2f' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
2017-09-15 19:07:19.083 [hingStatusInfoChangedEvent] - 'mihome:sensor_cube:158d00010aed80' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
2017-09-15 19:07:19.089 [hingStatusInfoChangedEvent] - 'mihome:sensor_cube:158d00010aed80' changed from INITIALIZING to ONLINE
2017-09-15 19:07:19.089 [hingStatusInfoChangedEvent] - 'mihome:gateway:34ce0088ce2f' changed from INITIALIZING to ONLINE
2017-09-15 19:07:19.091 [ItemStateChangedEvent     ] - Cube_Battery changed from 76 to 81
2017-09-15 19:07:19.099 [ItemStateChangedEvent     ] - Xiaomi1GatewayColor changed from 0,0,100 to 0,0,0

Everything looks great, but nothing really happens when I press anything light on in the MI APP.

However if I try a switch in openhab it throws error:

2017-09-15 19:12:49.095 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occurred while calling handler: java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at org.eclipse.smarthome.core.common.SafeMethodCaller.executeDirectly(SafeMethodCaller.java:220)[98:org.eclipse.smarthome.core:0.9.0.201708041325]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:189)[98:org.eclipse.smarthome.core:0.9.0.201708041325]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:83)[98:org.eclipse.smarthome.core:0.9.0.201708041325]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:67)[98:org.eclipse.smarthome.core:0.9.0.201708041325]
	at org.eclipse.smarthome.core.thing.internal.ThingManager.receiveCommand(ThingManager.java:374)[105:org.eclipse.smarthome.core.thing:0.9.0.201708041325]
	at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:47)[98:org.eclipse.smarthome.core:0.9.0.201708041325]
	at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:193)[98:org.eclipse.smarthome.core:0.9.0.201708041325]
	at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:1)[98:org.eclipse.smarthome.core:0.9.0.201708041325]
	at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:181)[98:org.eclipse.smarthome.core:0.9.0.201708041325]
	at java.util.concurrent.FutureTask.run(Unknown Source)[:1.8.0_144]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)[:1.8.0_144]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)[:1.8.0_144]
	at java.lang.Thread.run(Unknown Source)[:1.8.0_144]
Caused by: java.lang.NullPointerException
	at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:69)[242:org.openhab.binding.mihome:2.2.0.201709071552]
	at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:42)[242:org.openhab.binding.mihome:2.2.0.201709071552]
	at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.getEncryptedKey(XiaomiBridgeHandler.java:292)[242:org.openhab.binding.mihome:2.2.0.201709071552]
	at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.createDataJsonString(XiaomiBridgeHandler.java:278)[242:org.openhab.binding.mihome:2.2.0.201709071552]
	at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.writeToBridge(XiaomiBridgeHandler.java:274)[242:org.openhab.binding.mihome:2.2.0.201709071552]
	at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeLightColor(XiaomiActorGatewayHandler.java:183)[242:org.openhab.binding.mihome:2.2.0.201709071552]
	at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeLightColor(XiaomiActorGatewayHandler.java:179)[242:org.openhab.binding.mihome:2.2.0.201709071552]
	at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.execute(XiaomiActorGatewayHandler.java:68)[242:org.openhab.binding.mihome:2.2.0.201709071552]
	at org.openhab.binding.mihome.handler.XiaomiDeviceBaseHandler.handleCommand(XiaomiDeviceBaseHandler.java:103)[242:org.openhab.binding.mihome:2.2.0.201709071552]
	at org.eclipse.smarthome.core.thing.internal.ThingManager$3.call(ThingManager.java:377)[105:org.eclipse.smarthome.core.thing:0.9.0.201708041325]
	at org.eclipse.smarthome.core.thing.internal.ThingManager$3.call(ThingManager.java:1)[105:org.eclipse.smarthome.core.thing:0.9.0.201708041325]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.executeDirectly(SafeMethodCaller.java:218)[98:org.eclipse.smarthome.core:0.9.0.201708041325]
	... 12 more

If I autodiscover the gateway, it is found and works perfectly!
But I want to have it all in items, things and sitemaps files.
Can anyone help me troubleshoot this?