Xiaomi Gateway Integration

Hi DIYers, Hackers and Homebrew sensor makers

I found these xiaomi sensor hacks you might be interested in.
To be clear, these are not allowing to change or subvert behaviour when using the xiaomi GW. You would need some other zigbee interface to make use of the hacked sensors. Still… interesting what people get up to…

in french:

in English:
https://translate.google.co.uk/translate?sl=fr&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Ffaire-ca-soi-meme.fr%2Fhack%2F2017%2F02%2F27%2Fhack-xiaomi-mi-smart-temperature-and-humidity-sensor%2F&edit-text=

2 Likes

Now all that’s left is for someone to write a new “firmware” for those devices and we’re all set to ditch the gateway :wink:

I’ve submitted new pull request to Daniel’s branch. Adding ringtone play.
https://github.com/Danielhiversen/homeassistant/pull/6

7 Likes

As far as I noticed the gateway is able to play some (chinese) radio tunes via the MiHome-App.
Has anyone tried to teach the gateway some custom radio streams?

Lately HA hass been showing errors about it not being able to connect to the Gateway: “[custom_component.xiaomi] Cannot connect to Gateway”, and “[custom_component.xiaomi] No data in response from hub None”. My switches and sensors still work though. Should I be worried?

It’s only possible by some dns hackery to divert the gateways request to another server.
That server needs to sent the radio stream in some proprietary chunked format.
There is some Russian site that you can get server software from.
Imo not worth the effort :slight_smile:

Edit: more info here
http://en.miui.com/thread-301617-1-1.html

Ok, thanks for the info. Indeed not worth the effort… Maybe wait for an official integration. :slight_smile:

On another subject:
Does anyone have working notifications regarding the Xiaomi humidity-/temperature-sensors? E.g. “notify me when room abc reaches a humidity level 123”?

Did your fork eliminate the ghost problem?

For me the fork (xiaomi: check_ghost: true) does not eliminate the ghost problem. The polling retrieves wrong states from the gateway (https://github.com/louisZL/lumi-gateway-local-api/issues/11). May be also heartbeat messages should be ignored for the present.

hi @Danielhiversen where is the illumination sensors from? Is it in the gateway or?
Simple test seems that the value is not changing. I will test further when i come home…

Thanks to @Lapatoc ringtone play is now supported:
https://github.com/Danielhiversen/homeassistant/pull/6

The illumination sensor is from the gateway. It works fine for me.

Light sensor is located on left side of gateway in the middle. It behave a little bit strange. It can detect light increasing quick but decreasing goes slow.

What that mean to Adding ringtone?
i do not understand.

2 Repos of the same is a bit confusing :frowning: I have to stay on the original one because of the smoke sensor support :confused:

2 Likes

Brilliant, been after this for a while now.

You can play ringtones on your gateway (predefined in app and your personal uploaded) like alarm and so on.

It is actually 33 different forks of the repo; https://github.com/lazcad/homeassistant/network :confused:

It is not optimal, but since it takes very long time to add fixes to the main repo https://github.com/lazcad/homeassistant/pull/26
I had to start maintaining my own version to make sure it works for me.

This will hopefully be avoided if the component gets added to the official repo in the future.

4 Likes

What bothers me about the illumination is that it reports it in lumens, and never goes to 0, the lowest it goes is ~300 lm, on the other hand I have a z-wave sensor that measures luminance - reported in lux - that one shows 0 during the night.

Is someone actually clear whether the reported values for the sensor are in lumens or in lux, they are not the same unit of measure.

value range is from 300 to 1300 But unit of measurement is not specified. I’m guessing it’s lumen (lm)

https://github.com/Danielhiversen/homeassistant/pull/5

So it might be lux that is the correct unit