Xiaomi Gateway Integration

Yes, please

is that available on which fork?

The one of @Danielhiversen https://github.com/danielhiversen/homeassistant.

xiaomi:
  check_ghost: true
  gateways:
    - sid:
      key: xxxxxxxxxxxxxxxx

You should not use the feature. It doesn’t improve the issue.

Thanks @syssi, that’s the one I was using. And also yes: the ghost option doesn’t help.
Admittedly I don’t know which fork to use best right now. @syssi if you followed the recent progress, I’d be curious to know which fork is the most mature.
This is the NodeRED solution I came up with. Just use mqtt sensors in hass and you’re good to go:
I just don’t use the Xiaomi component ones. Keep in mind that this is just an early version.

@anon35356645 you can find the flow here:
http://flows.nodered.org/flow/803d78e2ddfc5d5c7d2e135f975f9a60

2 Likes

Cool.

Can you write your code … sorry nodesomething is totally new to me

I’m happy with https://github.com/danielhiversen/homeassistant. You can skip heartbeats if you edit line 283 of custom_components/xiaomi.py:

elif cmd == 'report' or cmd == 'heartbeat':
    _LOGGER.debug('MCAST (%s) << %s', cmd, data)
    self.hass.add_job(gateway.push_data, data)

by removing the back part of the condition:

elif cmd == 'report':
    _LOGGER.debug('MCAST (%s) << %s', cmd, data)
    self.hass.add_job(gateway.push_data, data)

Be careful. It’s untested and just a workaround to ignore wrong states/messages.

Even if heartbeat’s are skipped there’s still the problem that on restart the component polls for the initial state the gateway, and the chances are that if there’s a restart it’s because of a power cut - thus the door and motion sensors will still be stuck in the open state, until they are “reset” by either moving or opening the door. To workaround this bug in the API the initial state shouldn’t be polled from gateway at all, and just rely on reports from the gatway.

Hi all, not sure if this was covered or not, my hass to gateway connection seems to break after 12-24 hours, essentially the light sensor reports old values (since it disconnected) the gateway light switch can’t be switched on ( invalid key, even though it did work), and the door sensor I have also doesn’t report correct state.

The gateway still functions, as a have a basic automation on it with the door sensor.

I have run tcpdump and the gateway is in the logs, any tips of debugging this?

My only solution is a hass restart/pi3 reboot, which seems to fix the issue.

You updated the firmware?

Latest 1.4.1xxx

WiFi Zigbee interference?

I’m using a door/window sensor as switch now. May be somebody like the solution. It’s very cheap and made quickly. It looks like you have to click on the image to see all steps.

The automation looks like this:

  - alias: Toggle bedroom light
    trigger:
      - platform: state
        entity_id: binary_sensor.door_window_sensor_158d0xxxxxxxxx
        from: 'off'
        to: 'on'
      - platform: state
        entity_id: binary_sensor.door_window_sensor_158d0xxxxxxxxx
        from: 'on'
        to: 'off'
    action:
      service: light.toggle
      entity_id: light.bedroom

Please be careful. The pads of the reed contact are big but brittle. Next time I will use thinner cables.

4 Likes

@rave and @Danielhiversen:
What’s the status on releasing the xiaomi component to the main repo? I totally understand that we do not want to bypass @rave, since he started the project. But @rave’s last post was quite a while ago, and the latest github commit on his repo is 25 days ago. Is there any way to contact @rave outside of github and here?
I am running @Danielhiversen’s fork now since a couple of versions without any issues. What is the best course of action?

But you or someone else can add it to the main repo if you want.

Hi guys. I tried the method in the chinese forum to get the key needed for this to work however, whenever i press the gateway information button in development mode, the app crashes.

I tried on 3 different android devices - unpair, pair, and etc but the app just crashes whenever i try to enter.

Is there any other way i can get the key?

edit: clicking on local area network communication protocol gives me a message : current device does not support this feature. Does that mean im having v1 w/o radio? And does that mean my xiaomi gateway cannot be integrated?

I really like ti, can you explain better and upload some others screenshots? What do you psyticaly do for activate the light? Thanks

The lights are powered always now (compare the first image). The switch does not disconnect mains anymore. The lights are some yeelights which are integrated into home assistant. If the door sensor / switch changes the state an automation toggles the light.

This just surfaced:

http://www.gearbest.com/access-control/pp_626702.html

Anyone has an idea whether it’s just a different form of the old temperature/humidity sensor?

I found the same a few weeks back from FCC docs:

If you compare the PCB photos of the Aqara device here:
https://fccid.io/document.php?id=3240118

with the Xiaomi device here:

You can see they are very similar, but its not as simple a change to the physical enclosure. There is a board shape AND layout change, too.
Which to me is quite surprising… I would have thought they would be the same internally.

BTW there are apps for both EigenStone and Aqara on iOS appstore.
Both apps appear the same, but it seems you need a chinese mobile number to register. I tried with my UK number and never receiver the registration code by SMS.

Its currently cheaper than the old version, too :slight_smile: