Mi(Xiaomi) Smart home bindings?


(Fontoura) #550

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

It is that one:
https://pt.aliexpress.com/item/2017-Xiaomi-Smart-Home-Gateway-3-Aqara-Smart-Light-Control-ZiGBee-Wifi-Wireless-Key-and-Wall/32790262169.html
However In the xiaomi mi page they mention only as a air condition companion.
https://xiaomi-mi.com/sockets-and-sensors/xiaomi-aqara-air-conditioning-companion-temperature-humidity-sensor/

Has anyone succesfully used the “gateway 3”?


(Dimalo) #551

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…


(Zoran Ruzic) #552

Did you find correct way?


(Sasha) #553

Yep, installed v2.2. That helped


(Cr Peña) #554

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?


(Cr Peña) #555

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?


(Kuba Wolanin) #556

@CR_Pena docs.openhab.org/addons/bindings/mihome/readme.html


(Cr Peña) #557

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?


(Zoran Ruzic) #558

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


(Sergey M) #559

but what have you already done? and what does not work? the very beginning here in the pictures :slight_smile:

Well, as correctly marked the @kubawolanin , in the documents everything is there! I did everything according to this instruction.


(Avi Elgal) #560

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


(Paul) #561

I too am new here. But nice to start with an answer instead of a question :slight_smile:
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.


(Cr Peña) #562

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?


(Murpher) #563

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!:slight_smile:


(Patrik) #564

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 :frowning: 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?


(Realroywalker) #565

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)


(Paul) #566

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.


(Realroywalker) #567

Awesome, thanks Paul. I figured there must be a better way than trying to match sensor responses to identify them :slight_smile:


(Gary Lau) #568

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


(Andreas B ) #569

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 :confused:

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 )