question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[mihome] No token received from the gateway yet. Unable to encrypt the access key.

See original GitHub issue

I’m trying to bind xiaomi home security hardware with openhab, I add the items. I can change the settings in the interface but nothing happens on the lamp. (as if the data was not sending itself)

Expected Behavior

I would like control my xiaomi gateway via openhab

Current Behavior

The lux goes well but the ignition control, for example, does not work.

Possible Solution

When I move the cursor ON/OFF of brightness :

2018-05-15 23:46:49.321 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.handleCommand()’ on ‘org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler@40520dd1’: null
java.lang.NullPointerException: null
at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:69) [202:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:42) [202:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.getEncryptedKey(XiaomiBridgeHandler.java:291) [202:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.createDataJsonString(XiaomiBridgeHandler.java:277) [202:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.writeToBridge(XiaomiBridgeHandler.java:273) [202:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeLightColor(XiaomiActorGatewayHandler.java:188) [202:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeLightColor(XiaomiActorGatewayHandler.java:184) [202:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.execute(XiaomiActorGatewayHandler.java:73) [202:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiDeviceBaseHandler.handleCommand(XiaomiDeviceBaseHandler.java:104) [202:org.openhab.binding.mihome:2.2.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [109:org.eclipse.smarthome.core:0.10.0.b1]
at com.sun.proxy.$Proxy137.handleCommand(Unknown Source) [202:org.openhab.binding.mihome:2.2.0]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:72) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]

Your Environment

VM with Ubuntu 16.04 java 8 I try with openhabian 1.4.1 openHAB2 installation from scratch only plugin binding-mihome - 2.2.0 application mi home on android phone : 5.1.33

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
pulciuxcommented, Nov 4, 2018

Me too. I’ve tried 2.3, 2.4.M3, 2.4.M4 docker image amd64-debian and alpine. Always the same error:

2018-11-04 11:19:21.272 [WARN ] [g.mihome.handler.XiaomiBridgeHandler] - No token received from the gateway yet. Unable to encrypt the access key.
2018-11-04 11:19:21.274 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler@578e7cbc': null
java.lang.NullPointerException: null
	at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.toJsonValue(XiaomiBridgeHandler.java:323) [223:org.openhab.binding.mihome:2.4.0.M3]
0reactions
hmerkcommented, Jul 26, 2021

closed due to inactivity

Read more comments on GitHub >

github_iconTop Results From Across the Web

No token received from the gateway yet. Unable to encrypt the ...
openHAB 2.3.0 I have the Xiaomi gateway with the latest firmware. It was working for a couple of weeks. Then, when I ran...
Read more >
Not able to get Xiaomi Gateway Key - Configuration
Hi there, I've been trying to get the key and token for my xiaomi AC gateway (the v3 one), but I'm not able...
Read more >
Aqara hub does not show on mi home app but connects to ...
Hi, after installing the aqara hub in the mi home app via the homekit qr code the hub doesnt appear on the mi...
Read more >
BreakMi: Reversing, Exploiting and Fixing Xiaomi Fitness ...
No encryption. Despite sharing a pairing key and supporting encryption algorithms, the tracker and the app do not encrypt their sessions. Hence ...
Read more >
XIAOMI Gateway funktioniert nicht wie es soll
handler.XiaomiBridgeHandler] - No token received from the gateway yet. Unable to encrypt the access key. ... at org.openhab.binding.mihome.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found