Xiaomi Gateway Integration

Have you specified a key in the config?
Do you have the same problem with the original version? (Not my fork)

Didn’t realise you were getting offended… I was just curious and wanted to understand the logic, to see if i had something wrong with my installation… If you get so offended by having people asking stuff. I won’t do it anymore.

Have a nice day!!!

Tried the original version by @rave and the same thing happens.

Generated a new key after the log stated that the key was invalid. That was yesterday and I thought that was the problem. But even then I was able to get the values from the sensors (temperature & humidity)

@rave please don’t get frustrated - as a matter of fact I was seeing the same issue as @Ordep, so I did some digging - it appears I had the problem only with @Danielhiversen’s fork. Once I switched to your latest code - the light works again!

@Ordep - for the time being if you want to get the light going use https://github.com/lazcad/homeassistant

2 Likes

I just saw this “OSError: [Errno 9] Bad file descriptor” error too when restarting HA.
Never seen it before, and I didnt see it when I restarted HA a second time.
Any idea why it happens?

Check out these FCC applications for Lumi/Aqara devices (aka the company that manufactures the sensors for Xiaomi)
Seem to overlap with the xiaomi device, so maybe they are old prototypes?
But different physical enclosures, although following a similar design language, and all were posted fairly recently (dec 2016/jan 2017 i.e. AFTER xiaomi devices released)

This is the main one of note as there is Xiaomi equivilent… a Vibration sensor:

1 Like

Or use the newest version of my fork

1 Like

Is temperature and humidity sensor supported?

Yes, check the documentation

you mean this link ?


I can’t find support or not support

Haven’t seen the vibration sensor from Xiaomi

I think it might be the basis of the cube. From the info on the FCC site seems it has gyro/accelerometer

The answer is yes.
The gh readme needs a small update
But you can search this tread too :slight_smile:

What’s your stance on making the polling for PIRs and Door/window sensors optional and rely only on the broadcast to mark motion/no motion; open/close? This might be the easiest solution to handle ghost openings until the API is fixed.

Hello Daniel.

Have you removed poll motion sensor option from your branch?

I was trying to set it up on your version of component and got error.

Yes, it is broken in the main repo, so I just removed it. But can fix it and add it again if it is wanted.

Well I do not know is it good feature or not. I’ll test components with default 2 min for motion sensor deactivation. I’m planing to uses motion sensor for my lights in corridor. It should trigger lights off after someone passed corridor.
For may case I guess 2 min will be enough for passing corridor.

Just a note for anyone else that gets the error below:

File “/home/homeassistant/.homeassistant/custom_components/binary_sensor/xiaomi.py”, line 28, in setup_platform
gateways = PY_XIAOMI_GATEWAY.gateways
AttributeError: ‘NoneType’ object has no attribute ‘gateways’

For me this was caused by having the files in both the home assistant and virtual environment folders (must only have one in the location based on your setup as per the documentation).

If you have it in both the home assistant folder and virtual environment, you’ll get that error and need to delete the one inappropiate for your setup

thanks a lot.

there is another problem.
17-03-26 17:35:30 WARNING (Thread-4) [netdisco.ssdp] Error fetching description at 192.168.0.156
17-03-26 17:47:40 ERROR (MainThread) [custom_components.xiaomi] Cannot connect to Gateway
17-03-26 17:47:40 ERROR (MainThread) [custom_components.xiaomi] No data in response from hub None
17-03-26 17:47:40 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting

is anyone have the same problem?everything works fine. but the log shows the problem.