Mi(Xiaomi) Smart home bindings?

I’ve trouble to configure my wifi adapter on my server, I have to swtich to network-manager 'cause wpa_supplicant is messing with me but I’m too pissed off to try now.
I’ll first try to reset once more the gateway :frowning:

Did you tried to reach your gateway with python script or something else ? I’m trying to reach my gateway without using openhab binding, the aim is to point and understand where is the problem but I have limited knowledge in Python dev / socket / networking.
I’m studying how to use this kind of project https://github.com/jon1012/mihome

Ok, so it seems to have an issue with some kind of Xiaomi Gateway where the “local area network communication protocol” switch do nothing.

See this : https://community.home-assistant.io/t/xiaomi-gateway-not-discovered/25030/62

It’s for HA but we all have the same problem. A way to test is the port is opened is to do :

# nmap -sU -p 9898 192.168.0.22

Starting Nmap 7.01 ( https://nmap.org ) at 2017-08-29 14:18 CEST
Nmap scan report for 192.168.0.22
Host is up (0.0050s latency).
PORT     STATE  SERVICE
9898/udp closed unknown
MAC Address: 34:CE:00:FA:5A:CF (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 0.53 seconds

In my case, as you can see, it’s not working.

Interesting. I played around a little bit with wireshark yesterday and the only thing I saw coming from my gateway was mdns.

I saw a lot of talk about multicast and IGMP on the HA forums. I have a somewhat more advanced setup than most probably have, pfSense router, Powerconnect 5324 switch, Unifi AP. Neither the switch nor AP should be blocking multicast from what I could tell, and the traffic should never be hitting the router.

Mine reports the port is closed also. At least I can stop going crazy now. Unfortunately this puts us at the mercy of waiting for a new firmware update. Or hoping someone can find a way to force it to enable. I haven’t found any info on downgrading the gateway firmware.

It looks like some over at HA have had luck getting it working after resetting the gateway. Not sure what’s changed since I’m sure we’ve all tried that several times over the last couple days, but fingers crossed.

Edit: I reset my gateway, reconnected to wifi, and turned developer mode back on and everything is working great now.

Yep, me too :slight_smile: And now nmap returns :

# nmap -sU -p 9898 192.168.0.22

Starting Nmap 7.01 ( https://nmap.org ) at 2017-08-30 01:49 CEST
Nmap scan report for 192.168.0.22
Host is up (0.0051s latency).
PORT     STATE SERVICE
9898/udp open  unknown
MAC Address: 34:CE:00:FA:5A:CF (Unknown)
Nmap done: 1 IP address (1 host up) scanned in 0.53 seconds

The issue is now fixed, without any firmware or Mi Home app update.

my gateway just arrived and it too refused to be found until i reset the gateway (hold down the gateway button for ~10s or so )…
After this it was discovered and i was able to add all the things.

Great work on this binding!

I have a delay when i want to play a sound from the gateway.

For testing i connected my doorbell with the gateway. When someone is pressing the bell then the xiaomi gateway should play the doorbell-sound.

But the sound comes out not immediately, there is a small delay - a few seconds.

Can someone test this? Is this the same behavior with your gateway?

Is there a way to make the gateway play the sound immediately when the switch is pressed?

Hello it possible detect when alarm is armed ? In status console inst information with status. I need for setup status led on ESP. Thanks

The Xiaomi sensors are cheap compared to Zwave and Zigbee sensors. Are the sensors reliable?

I am interested in the Smart Home Occupancy Sensor. It seems I will need a Hub to work with. Which Hub do i need, the original one or the Aqara one. Also, there seems to be two motion sensors, https://www.gearbest.com/smart-light-bulb/pp_257678.html and https://www.gearbest.com/alarm-systems/pp_659226.html.

Reliability was my main concern also when considering the Xiaomi sensors. I’ve only had mine for about a week, but so far they are working well. Hardest part is finding a position for the motion sensor to reliably trigger yet not have the cat constantly triggering it. :sweat_smile:

I have a motion sensor controlling my under cabinet lights and a couple of the round switches for bedroom lamps/lights (single/double click control respective lamps, long press controls main Wemo light). I installed one of my door sensors today and my testing shows it working well too. When arriving home and front door opens, lights turn on 20%. Just need to get Astro configured correctly so I can trigger them only when dark.

As a side note, persistence doesn’t seem to work for setting the motion timer. My thing shows the configured timeout after a reboot, but the behavior seems to revert to the default 120? seconds. Adding a startup rule to send the value to the item seems to fix it.

2 Likes

You probably mean the Aqara air conditioner hub? I have the normal one (https://www.gearbest.com/living-appliances/pp_344667.html). Don’t know if anyone has the Aqara version.
Regarding the 2 motion sensors. The Aqara version is the latest and van also report lux value. I have them both and they’re working great. At the moment I have almost all sensors which are available and they’re all performing great. Time will tell how long the batteries will last.

Hello,
is there somewhere a documentation about ACTIONS for smart plug ?
For example:
rule "Xiaomi Switch"
when
Channel “mihome:sensor_switch:iD:button” triggered
then
var actionName = receivedEvent.getEvent()
switch(actionName) {
case “SHORT_PRESSED”: {
ACTION
}

Also, it is possible to set days and time for triggers of occupancy sensor and smart plugs ?

Thank you

anyone own Cube and able to perform TAP TWICE?
don’t know how to make this work

See documentation…

rule “Xiaomi Cube”
when
Channel ‘mihome:sensor_cube::action’ triggered
then
var actionName = receivedEvent.getEvent()
switch(actionName) {
case “TAP_TWICE”: {
ACTION
}
}
end

I know the rules, what I mean is I never get it triggered,
that’s why I ask how to get it triggered.
I have tried tap or knock twice on cube with difference speed but never get it work

It works for me!, when i pull it up say 1cm, down, up 1cm, down, It switches a light on, logging says:

2017-09-11 14:17:37.829 [ChannelTriggeredEvent ] - mihome:sensor_cube:158d00010aec11:action triggered ALERT
2017-09-11 14:17:38.796 [ChannelTriggeredEvent ] - mihome:sensor_cube:158d00010aec11:action triggered TAP_TWICE

thanks, I just don’t understand “tap twice” mean,
now it works for me too~~!

Thanks mate

1 Like

I’m having a field day, youre the second person I could help in an hour!:nerd_face:
sometimes the hardest questions have the easiest answers

Will support the Xiaomi Water sensor? Just arrived. Posted it at Jul 23.