Have looked through and can’t see an answer to my issue.
OpenHAB : openHAB 2.1.0 - release build -
MiHome : Firmware 1.4.1_150.0143
Gateway : V2
Binding : org.openhab.binding.mihome-2.2.0-SNAPSHOT.jar
It found my Gateway and Bridge with in seconds and I entered (is correct! ) developer key and created the items, sitemap map etc.
Issue I’m having is my items don’t read the current status of the gateway and aren’t changing when I perform an action from openHAB or the Mi Home APP. Below is the events log and openHAB log which is generating an error.
Events log
2017-11-22 19:26:03.737 [ItemCommandEvent ] - Item 'Gateway_LightSwitch' received command ON
2017-11-22 19:26:03.742 [ItemStateChangedEvent ] - Gateway_LightSwitch changed from OFF to ON
2017-11-22 19:26:05.179 [ItemCommandEvent ] - Item 'Gateway_LightSwitch' received command OFF
2017-11-22 19:26:05.181 [ItemStateChangedEvent ] - Gateway_LightSwitch changed from ON to OFF
Openhab Log
Caused by: java.lang.NullPointerException
at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:69)[198:org.openhab.binding.mihome:2.2.0.201707020013]
at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:42)[198:org.openhab.binding.mihome:2.2.0.201707020013]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.getEncryptedKey(XiaomiBridgeHandler.java:290)[198:org.openhab.binding.mihome:2.2.0.201707020013]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.createDataJsonString(XiaomiBridgeHandler.java:276)[198:org.openhab.binding.mihome:2.2.0.201707020013]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.writeToBridge(XiaomiBridgeHandler.java:272)[198:org.openhab.binding.mihome:2.2.0.201707020013]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeLightColor(XiaomiActorGatewayHandler.java:183)[198:org.openhab.binding.mihome:2.2.0.201707020013]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeLightColor(XiaomiActorGatewayHandler.java:179)[198:org.openhab.binding.mihome:2.2.0.201707020013]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.execute(XiaomiActorGatewayHandler.java:68)[198:org.openhab.binding.mihome:2.2.0.201707020013]
at org.openhab.binding.mihome.handler.XiaomiDeviceBaseHandler.handleCommand(XiaomiDeviceBaseHandler.java:101)[198:org.openhab.binding.mihome:2.2.0.201707020013]
at org.eclipse.smarthome.core.thing.internal.ThingManager$4.call(ThingManager.java:377)[105:org.eclipse.smarthome.core.thing:0.9.0.b5]
at org.eclipse.smarthome.core.thing.internal.ThingManager$4.call(ThingManager.java:1)[105:org.eclipse.smarthome.core.thing:0.9.0.b5]
at org.eclipse.smarthome.core.common.SafeMethodCaller.executeDirectly(SafeMethodCaller.java:218)[98:org.eclipse.smarthome.core:0.9.0.b5]
... 12 more
Looking if anyone has an idea to whats wrong with my configuration.
hey @Murpher ,
a quick search on EncryptionHelper gave me this guy who was using a VPN - and this guy, who had to configure his firewall.
The error seems to appear often with network related solutions. Please make sure you try out different ways to ensure the communication is working
rule "Xiaomi Switch"
when
Channel "mihome:sensor_switch:<ID>:button" triggered
then
var actionName = receivedEvent.getEvent()
switch(actionName) {
case "SHORT_PRESSED": {
Garden_Light.sendCommand(ON)
}
case "DOUBLE_PRESSED": {
Garden_Light.sendCommand(OFF)
}
case "LONG_PRESSED": {
<ACTION>
}
case "LONG_RELEASED": {
<ACTION>
}
}
end
I’m runnning openHAB 2.2.0 Build #1068 but I still don’t see my light gets turned ON.
I do see the events though, so openHAB sees the buttons pressed…
I tried reading through this long thread, so I might have missed something! Is there any solution to this?
There as been a change, so the code doesn’t work anymore.
Try this instead:
rule " "
when
Channel "mihome:sensor_switch:<ID>:button" triggered SHORT_PRESSED
then
<code> }
end
rule " "
when
Channel "mihome:sensor_switch:<ID>:button" triggered DOUBLE_PRESSED
then
<code> }
end
rule " "
when
Channel "mihome:sensor_switch:<ID>:button" triggered LONG_PRESSED
then
<code> }
end
rule "Xiaomi Switch - Doorbell "
when
Channel "mihome:sensor_switch:158d00014d0cc0:button" triggered SHORT_PRESSED
then
gGarden_Back_Beds.sendCommand(ON) }
end
Also, now my other Xioami rules doesn’t work - when above is in my rules file.
I just bought Xiaomi Mijia Aqara Smart IP Camera
It is camera with getaway functionality. Do you think it will work with the binding? If not who should I ask to update the binding?
Does anyone having problem getting to developer mode in the new mi home app version 5? I press the version in the about page and the only thing I get is a bunch of information about my gateway (ip, wifi password, devices, …).
Just tried it again, is still working. Don’t you see the ‘local area network communication protocol’ item in the About menu? This should appear after enabling developer mode.
My gateway has firmware 1.4.1_150.0143 (version 2.46) (I don’t think a gateway v3 exists)
MiHome v5.0.10
Maybe the one I have is not supported for such developer mode.
In the readme page for the mi home binding there is this step that the gateway 3 is mentioned:
•Add Gateway 2 or 3 to your WiFi Network
this gateway is supported. there are different versions of it and it is the original gateway v3 - there is an older v2 of this which looks the same. these are montioned in the readme…