Xiaomi Gateway Integration

Apparently i’m having the same issue with Door sensor showing as ‘Open’. I have one on my window which the last time i opened was few days ago.

This is the response from gateway.

 {'data': '{"status":"open"}', 'model': 'magnet',....

So it appears that the gateway is sending wrong information. Upon opening the window and closing it again, the gateway now send the right status.

it happened also to me… tonight…

Do you see an entry in the Mi Home Door sensor log? i didn’t last time, when it was internet connected.

No, there’s no log in Mi Home app. Is your device also has not been activated for a while?

I had the same issue no entry.

I just restricted internet access for the xiaomi gateway intentionally it was anyway annoying as the application asked already for login credentials every time when i wanted to use it. :frowning:

It could be that the gateway forgot the sensor status after there’s no activity for a while. Since Mi Home app is showing the data that’s being pushed to its server, the status or log shown in the App could be different than from what’s retrieved from the API.

If you enable debugging for the xiaomi component, and check the output from here: https://github.com/lazcad/homeassistant/blob/master/components/xiaomi.py#L235

It would be interesting if there is anything different with the data received from “ghost” movement and the real movement.

No, i have 3 door sensors in use atm, 6 are on the way. The window sensor in the master bathroom is getting triggered 3 up to 10 times per day. The terrace door sensor is getting triggered minimum 2-4 times per day the one in the guest bathroom doesn’t get triggered when we don’t have guests, but i have the ghost opening for all door sensors almost simultaneously.

one around 6pm the other around 5am and the last one around 5:30am, maybe we really have a ghost ;-).

I will run debugging, when i updated to the latest commit and hope to get some data’s as it didn’t happen for the last days and suddently yesterday 2 times.

Funny my sophos is busy to block the packets from the yeelight bulbs and the xiaomi gateway, 80% cpu usage for a couple bulbs and the gateway :frowning:

Hi have question about this gateway.

I see more and more people writhing they have turn off the internet connection to the gateway? Why do they do that? And is the gateway sending our sensor information to the internet?

And what happens to the app, if you do that. Can’t you use the app on the gateway any more?

First of all, the concept behind the xiaomi gateway: It’s an IOT device, so basically it connects to some server and stores there the states. The app from your phone simple connects to this server, in combination with your account and the device binding to your account you can retrieve the data from everywhere.

If you cut off the internet connection, you will not be able to use the app anymore, hass uses the API of the xiaomi gateway which just requires a local network connection, if you use HASS only you can cut it off.

You need to allow access again, if you want to add new devices to the gateway as you have to configure them with the app.

The data’s are unencrypted and to my personal taste, i don’t want permanent communication of my light to some server.

Okay thats funny, now i had ghost opening of 2 door sensors, my “automation’s after 20 minutes close window” didn’t get executed.

Did you turned on the debugging yet?

I thought I’m the only one who has same issues. I’m also has no history for some components. And I have empty logbook. Initially I thought it’s problem with history component. But it’s not. I’ve turned off all components and started to enable them one by one. And history appeared, logbook entities start appear. So I’ve left two components WU and Darksky. I’m running latest version of HA on Linux.

some chinese hacker :smiley:

Okay thank you. Yes I can see a problem in it sending the sensor to some server.

But it stills works with hass with no internet connection?

Funny but that’s exactly why my gateway doesn’t have internet access ;-).

Yes, that’s how i use it, configure it with firewall allow policy, set the deny after you finished your setup. :wink:

Didn’t manage it yet, i’m on the run. i will update on the latest commit with debugging and activate it.

is that correct:

homeassistant.components.binary_sensor.xiaomi: debug
homeassistant.components.xiaomi: debug

?