Mi(Xiaomi) Smart home bindings?

I found one more thing regarding cloud communication. I’m not very keen to share my house actions with xiaomi servers.
This post on Domoticz forum may be helpful:

DNS requests for: ot.io.mi.com,
DNS answer: 42.62.48.114, 58.83.200.2-12, 42.62.48.225, 42.62.48.2, 42.62.48.112, 42.62.48.113
DNS requests for: ott.io.mi.com
DNS answer: 58.83.160.36,58.83.160.14,42.62.94.185

Sniffing Results:
UDP: 58.83.200.0/24, 42.62.48.114
TCP: 58.83.160.36

It might be worth to include it in README.md of the binding as well.

1 Like

Hello everyone,
I’m very new to OpenHab and I want to integrate my mi home gateway, but I can’t find the .jar-file you mentioned earlier before? Were can I get it?

Just scroll up a bit…

2 Likes

Hello, can you please create a new jar file for openhab2 with the updates.
Thanks for this great work.

This new things aren’t included yet.

I have done all the instructions from the 2.1 binding readme. But Xiaomi Gateway still is offline in Paper UI Things. I entered the developer key, i can see the gateway connected to my wifi on my router.

How can i get the gateway showing online in Paper UI?

I added one temp sensor already. Can someone help me? How can i set up this in OH2? Do i have to do this with a rule or can i add the temp/humidity sensor as an item?

Hi,

What a great job. I tested it today and managed to have the gateway connected as well as the cube. For the cube all actions are working except the “rotate” one. The following error appears in the logs

2017-02-18 19:30:20.856 [ERROR] [g.mihome.handler.XiaomiBridgeHandler] - An exception occurred while calling the BridgeHeartbeatListener
java.lang.NullPointerException
    at org.openhab.binding.mihome.handler.XiaomiItemHandler.onItemUpdate(XiaomiItemHandler.java:254)[186:org.openhab.binding.mihome:2.1.0.201702041736]
    at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.notifyListeners(XiaomiBridgeHandler.java:159)[186:org.openhab.binding.mihome:2.1.0.201702041736]
    at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.onDataReceived(XiaomiBridgeHandler.java:142)[186:org.openhab.binding.mihome:2.1.0.201702041736]
    at org.openhab.binding.mihome.internal.socket.XiaomiSocket$ReceiverThread.receiveData(XiaomiSocket.java:127)[186:org.openhab.binding.mihome:2.1.0.201702041736]
    at org.openhab.binding.mihome.internal.socket.XiaomiSocket$ReceiverThread.run(XiaomiSocket.java:113)[186:org.openhab.binding.mihome:2.1.0.201702041736]

In addition to those items I also have some smart socket plug that can connect with the cube through the MiHome app. But in OpenHAB I have been scanning for new things without success, they never appear. Any idea on what could be done to add them to OpenHAB?

Ben

Just a heads up - I’ve submitted a PR to @pboos work here: https://github.com/carecon/openhab2-addons/pull/1

These are some minor changes in the binding. I’ve added low battery report, but still not tested.
According to the docs in Chinese, “voltage” parameter is sent once a 60 minutes.

In the binding if the voltage is below 2600 mv, the batteryLevel event is triggered as LOW, e.g

rule "Xiaomi battery low
when
    Channel "mihome:sensor_switch:158d00013f9a48:batteryLevel" triggered LOW
then 
  ...

I will publish JAR later today if my solution works :slight_smile:

1 Like

is there ability to show voltage instead of low, too?

Yeah, I’ve added the Voltage channel too. But it doesn’t seem to respond yet - need further development by either @pboos or anyone else:)

Can someone tell me, what is this home security? If i press gateway button two times (double click), then i can trigger a function called home security.

But what is this? What can i do with this?

Thanks!

Does the mi gateway support audio sink functionality? Or is it only light. Because its a lot of money for a simple “bulb”

It doesn’t yet.
There’s a lot in the API to be exposed.
“louisZL” is doing a great job delivering notes on how to communicate with the gateway and recently he submitted docs on playing Ringtone on the gateway.

Based on that findings I’ve created two stub functions in @pboos pull request, but there’s a lot more work needed to validate the idea, test it and eventually use it.

Audio Sink would be a dream come true. But I don’t think there’s a way to directly send audio to the gateway’s speaker. I hope I’m wrong, though! :slight_smile:

@Oliver_Roed_Scholer note that the gateway is not only a bulb - it’s also needed to connect the sensors with openHAB.

hello, i have a problem with OH2 binding. log show me: https://www.dropbox.com/s/423dtjkhvx1sbb6/mihomeoh2.txt?dl=0

Xiaomi Gateway discovered, add developer key. show me online
when i discover device show me device connected to gateway, when i add things gateway go to status offline

when i restart openhab, xiaomi unit give me only one data from devices. for example humidity and temperature. After go to offine

Hello everyone,
I’ve been following this thread for some time now, and found it very interesting. I currently have many xiaomi devices: 1 gateway, 4 temperature sensors, 2 plugs, 1 switch, 1 cube, 1 presence sensor, 3 light bulbs and 2 door sensors. Although using another software platform would be so much better than the Mi home app in order to do the monitoring, automations and so on, my interest right now is to find a way of downloading the historic data. That means, I would like to have access to the historic data of temperature, door opening logs, presence etc. directly from the xiaomi gateway or servers, without needing a software on a computer or raspberry measuring all the time.
I know the information must be stored in someplace, so I’ve tried wireshark in order to find the information exchange between the gateway and the internet, the mobile phone connected to the wifi while retrieving the historic data etc., but so far I have not been able to access the historic information. I have managed to locate the heartbeats and some measurements, but not the history log. There must be a way, since the information has to reach the app when it shows the monthly temperature profile for example.
Any help would be so much appreciated!

Hey guys,
I’m currently trying to integrate my Xiaomi door sensors in opnhab2. Temperature, wireless switch and motion sensor are working fine, but I’m not able to get a feedback from my door sensor.
What did I wrong?

rule "door sensor kitchen"
when
	Channel "mihome:sensor_magnet:xxxxxxxxxxxxxx:isOpen" triggered
then
	//GatewaySensorDoor_KR.sendCommand(ON)
	sendTelegram("smartHome", "Test")
end

Okay, it’s working for me now:)

Hi Alex

Where do you buy this controller ?

Hey guys, sorry to jump in but I’m also using these sensors and gateway (not with OH). I’m also using their local api (the one activated on the hidden settings). Unfortunately, from time to time the gateway reports false positives, i.e., it reports “open” and “motion” states when the door does not open nor there is any movement.
On the Mi Home app there are no false states.

Doesn’t anyone here has this issue? Any tips?