Yep, installed v2.2. That helped
Hello friend, what example do you have of what you did with the xiaomi temperature sensors? What tutorial do you follow to achieve it with Grafana?
Hello friend, a query
This example that you share can be used to capture the information from the xiaomi temperature sensors, how would you connect it to my device?
Hello friend, a query
This example that you share can be used to capture the information from the xiaomi temperature sensors, how would you connect it to my device? Do you have any video of this tutorial?
Is there a way to ask Alexa to turn on,off Xiaomi switch?
I was trying using ifttt applet connecting to openhab exposed mi socket but it didn’t work
but what have you already done? and what does not work? the very beginning here in the pictures ![]()
Well, as correctly marked the @kubawolanin , in the documents everything is there! I did everything according to this instruction.
Hi all,
I’m new here.
I am trying to add xiaomi mi smart home gateway to the OH, I’m using 2.2.0-snapshot.
I connected the gateway to my network and enabled local area network communication protocol.
I’ve installed Xiaomi Mi Smart Home Binding, when I try to add the gateway the list is empty.
anyone know what is the problem?
I followed this tutorial: http://docs.openhab.org/addons/bindings/mihome/readme.html
thanks a lot,
Avi
I too am new here. But nice to start with an answer instead of a question ![]()
This binding has been the most challenging for my setup too. For me it was my router was not well configured for Multicast traffic.
Check your router configuration is allowing IGMP snooping (Somewhere in your wireless settings). Then in your LAN settings look for a setting to enable multicast routing (usually under IPTV settings). Also ensure the udp port 9898 is correctly forwarded (not to the WAN though!). And the things should start appearing in the inbox.
Hello Friend
I would like you to help me as you did to be able to read the temperature with this method?
With this, have you made it possible to save the data in a database?
Hey @dimalo,
Solved my problem. In case it happens to someone else.
My Gateway and openHAB (running on raspberry pi) are in different areas of the house. The Gateway is next to the router and the raspberry pi is connected to a wireless access point (WAP).
My issue was the router wifi was set to a fixed channel and the WAP wifi channels where set to auto. Once I changed auto in the WAP to a fixed channel (same as router) was able to receive and send values to the gateway and items.
Simple when you know whats wrong!![]()
Hi,
i have some issues with the MiHome Binding. I start with oh 2.2 from scratch. I install the miHome binding and discover the Gateway in PaperUI. There i can add the IP and the developerKey. But i cant add the Serial Number - is it normal/okay?
After that i connect some Mi devices (temperature and motion sensors). I can see the actual values, but i cant send commands. If i will switch the sound/light of the gateway on, i only get a security error.
java.lang.NullPointerException: null
at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:69) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:42) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.getEncryptedKey(XiaomiBridgeHandler.java:291) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.createDataJsonString(XiaomiBridgeHandler.java:277) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.writeToBridge(XiaomiBridgeHandler.java:273) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeLightColor(XiaomiActorGatewayHandler.java:188) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeLightColor(XiaomiActorGatewayHandler.java:184) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.execute(XiaomiActorGatewayHandler.java:67) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiDeviceBaseHandler.handleCommand(XiaomiDeviceBaseHandler.java:104) [207: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.$Proxy142.handleCommand(Unknown Source) [207: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) [?:?]
I cann ping the gateway without problems, i can switch the light from the miHome app, but OH wont be able to speak with the gateway
i hope you can help me !
I checked out the SourceCode of the MiHome Binding. If i see correctly, the gatewayToken isnt set. the token should be set by the command “heartbeat”. why i dont get the heartbeat?
In wireshark, i see that the gateway push the heartbeat - but why does not the pi get the heartbeat?
Can anyone explain if there is a way to see the names of sensors/devices from the openhab side of things ?
I have added my gateway and it’s found the 14 sensors that are added to it, but they all have random id’s (like mihome:sensor_magnet:158d00015843a9)
Is there a good way of relating these to the named devices in the app? (short of going round opening and closing doors.. etc to see what changes in openhab)
If you have named all your items in the Xiaomi app, you should see them all in the gateway information tab in the about tab, just under where you get the developer key from.
Awesome, thanks Paul. I figured there must be a better way than trying to match sensor responses to identify them ![]()
I bought a “1 Channel Neutral switch” 4 months ago, it works perfect with your binding.
But I bought another “1 Channel Neutral switch” again last week, the new one not working. (while the old one is still working)
I finally find out, the ID of them are different
OLD one is:
{“model”:“lumi.ctrl_ln1.v1”,“did”:“lumi.158d00012a4007”,“name”:“switch 1”}
While the new one is
{“model”:“lumi.ctrl_ln1.aq1”,“did”:“lumi.158d0001f98de9”,“name”:“switch 2”},
it changed from v1 to aq1, then your binding cannot recognize it,
Can you please help?
Thanks
Hey Sven,
thank you for that post - could not find anything about that behavior (not even in the documentation of that binding for 2.2 snapshot..). Is there no way to have the whole button in one rule anymore?..
I got like 15 rules or so with these buttons and I do not want to split up all the rules - that will be really worse to handle ![]()
Thank you in advance.
Edit: Even the examples at github are still the old ones… (https://github.com/openhab/openhab2-addons/tree/master/addons/binding/org.openhab.binding.mihome )
I had it working with the normal rule with “getEvent” in 2.2 and after a restart it is not working anymore…
The error is:
18:50:28.716 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Office Andreas Button': 'getEvent' is not a member of 'org.eclipse.smarthome.core.thing.events.ChannelTriggeredEvent'; line 48, column 20, length 24
Is it possible to make “getEvent” a member of these events?..
Edit:
I do not know if this website is up to date, but there is getEvent: Archived Projects | The Eclipse Foundation
I have the same problem. My setup is Raspberry 3, latest Openhabian, 2 gateways with latest firmware, 12 sensors.
I used hostapd to create a hotspot on the raspberry, and told my 2 gateways connect to it. The gateways and some sensors are found, but nothing works. Logfiles gave the same error as you have.
After activating debug logging for the binding it appears that no gateway heartbeats are coming in.
I changed my setup to use an old router instead, with the gateways connected via wifi and the raspberry connected via wired ethernet.
Now it works, somewhat. Hartbeats come in but commands seem not to be fully reliable.
I have code in a background timer thread that makes both gateway lights flash red (500ms on, 500ms off).
The gateways don’t flash in synch. Some on/off commands seem to be lost, so one of the gateways misses an on or off cycle.
Sometimes both are in synch for a few seconds, then one misses an on/off command, then maybe the other gateway. Unpredictable.
The same rules running on my windows PC work flawlessly.
Has anyone exerienced something similar?
603/5000
I do not know how to continue. I deleted the gateway and reconfigured. Now I see no more heartbeats in Wireshark
There was a heartbeat when setting the new IP in the PaperUI.The token now seems to be set, but I get now another error message.The temperatures of my MiHome sensors are read out correctly.
If I restart the RPI, the Toekn will not be set either. The whole thing is very strange. Before I installed the latest Openhabian image, I could easily use the binding.
Does anyone have an idea or a tip for me?
EDIT: I have just noticed that the temperature values do not change anymore. They seem to be read out at initialization and then stay that way.
java.lang.NullPointerException: null
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.toJsonValue(XiaomiBridgeHandler.java:320) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.sendCommandToBridge(XiaomiBridgeHandler.java:258) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.sendCommandToBridge(XiaomiBridgeHandler.java:240) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.writeToBridge(XiaomiBridgeHandler.java:272) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeRingtone(XiaomiActorGatewayHandler.java:199) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.execute(XiaomiActorGatewayHandler.java:98) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiDeviceBaseHandler.handleCommand(XiaomiDeviceBaseHandler.java:104) [207: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.$Proxy146.handleCommand(Unknown Source) [207: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) [?:?]