Mi(Xiaomi) Smart home bindings?


(horschte) #831

@Sladaar
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.mihome/2.4.0-SNAPSHOT/org.openhab.binding.mihome-2.4.0-SNAPSHOT.jar


(Ed) #832

Many thanks @horschte, i just figured out while searching for the problem that I still was in OH2.2 (so the xiaomi binding couldn’t update i guess and was still in 2.2), and I was damn sure i was in 2.3.
Only now i remember how painful was the migration (in windows 10), too many problems and i used the 2.2 backup to have a working system again.
Thanks for the hint!


(JustAProgrammer) #833

So anybody corrected the Xiaomi Smart home binding issues without going back to 2.2?
I’m losing my mind on this one, tried absolute everything.
Paper UI detects all devices and the gateway is online, but after 2 hours all devices go offline and doesn’t send any values.
Any Help is highly appreciated


(Dietrich) #834

Hi @horschte, what is the right way to install this binding?

I downloaded it to /usr/share/openhab2/addons an changed user and group like:

chown openhab:openhab org.openhab.binding.mihome-2.4.0-SNAPSHOT.jar

Should I change execution-flag? chmod +x

Is there anything else I should do?

Log shows this

2018-09-19 18:54:48.332 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.mihome-2.4.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.mihome [269]
  Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="2.3.0"; osgi.identity="org.openhab.binding.mihome"; singleton:="true"

        at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [9:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [9:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [9:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [9:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [9:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [9:org.apache.felix.fileinstall:3.6.4]

(Ward) #835

I just copy the jar file in this folder and everything works. If not, a restart of openhab is needed. First uninstall the binding via paperui (or via text files if you used this)


(Ed) #836

actually, the 2.4 binding works for me too.
I was in OH 2.2, upgrading to 2.3 gave me the possibility to install the new binding (2.4), which seems to work perfectly and even supports the new Aqara Vibration sensors.


(Svilen) #837

Does anyone already tried the new Aqara Hub (Gateway) which is HomeKit compatible?


(Thomas Binder) #838

You mean this one: https://www.gearbest.com/smart-home-controls/pp_009661787808.html?
Does it only report Vibration - or also orientation like axis? it says it can react to “inclination”? Is this a channel in OH2 and does it report inclination in realtime?
I’d like to monitor my blinds and stop them, if they’re not coming down correctly…


(Ed) #839

Yes, that one.
As far as i know (at the moment, i’ve just configured them) they support these channels:
lastAction, tiltAngle, orientationX, orientationY, orientationZ, bedActivity, batteryLevel, lowBattery.

BUT, the big problem to me it’s that after a reading they go in standby for 1minute, to save energy.
It means that they aren’t actually real “sensors”, but they act more like switches, because they report a state and wait for a minute, they don’t continue to report.
So, if I am not wrong, no they don’t report in realtime, sadly.
I wanted to use them for home security, to hear for vibrations of windows…but i think they’re best use is like knock knock switches or something similar, even if they still can be used for other purposes.

So i guess you need something else, they won’t report as many informations as you may need.


(Gad Ofir) #840

Hi can anyone tell me if the new gateway camera is working with the binding?
i whuld like to dive into the Aqara world but i dont have gateway
and i see no purpuse with big ones


(Bart Snijder) #841

I’ve seen more post on this device.
What is the added value of the new Aquara Hub compared to the “normal” hub. I guess people using openhab have all control arranged by openhab so even if a homekit would be owned those poeple would still have a homekit thing defined and avoid direct communication from homekit to sensors & devices as this does put openhab out of control right?


(Dimalo) #842

@binderth have a look in the log here.
You see how the device reports a tilt angle and axes on each movement.
If it is moved, it reports. I cannot confirm, that it only reports once per minute, this you can see in the timestamps of the example log.

@Svil Tahnk you! I guess the gateway needs an update first to be able to tell the model. If you are on the latest SW, we have to be patient and wait for it to be updated…

@Masssssy please make a log and open a github issue for that. How to log and github issues page


(Hallo Ween) #844

How do you fix the temp sensors and magnet sensors to the wall or to the door/windows?

Do you use the glue on the backside? But what is, when you have to change the battery?


(Daniel Linder) #845

It is double sided tape. When you need to change battery you simply twist the sensor. The battery door / back of the sensor will stay, since it taped. Replace the 2032 cell and then twist the sensor back.


(Maciek B) #846

I heard some rumors about Xiaomi gateway in EU version. Do you know anything? I’m not sure if I should wait as I hate adapters…


(Mike Polinowski) #847

Be careful @Tribon I just bought the Hongkong version of the Xiaomi Mijia Gateway and so far could not figure out how to set it up in Developer Mode to be able to integrate it into OpenHAB. It seems you have to use the App with China Mainland locale to activate the Dev Mode - but I have to switch it to Hongkong to add the Gateway, which makes the menu point disappear. I am just trying to get the Chinese version of the Hardware or find a way to flash the Gateway with the chinese Firmware… but no luck so far.


(jjmeseguer) #848

FYI, it is possible to use the gateway for TTS:


(Maciek B) #849

@mpol Try to downgrade Mi Home app to 5.0.19. It was working for me to get token for another MI IO Binding with use of MIToolKit. It might be like that that Xiaomi is upgrading Mi home up to stop messing with developer mode. I might be also wrong but worth trying.


(Mike Polinowski) #850

@Tribon I was already told to downgrade to a version 4 of the Mi Home App - but it refused to login to my XiaoMi account. I can give v5.0.19 a try maybe this one still works. Thx!

EDIT: I tried it. Uninstalled the latest version, installed v5.0.19 and logged in with my account. The dashboard is working, but I was unable to access the devices - usually there is an initialization step when you access one of the added devices through the Mi Home App, but it never starts. Updating to the newest version solves this issue.

No luck getting this to work.


(JustAProgrammer) #851

Anyone else having problem receiving data on port 9898?
Wireshark tells me, that the correct values are sent to the unicast adress(225.0.0.50) , but monkeycom on port 9898 blocks it.
I’m getting a TTL Error too.
ANY help is appreciated